address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0xD6A995d1e9E5D408bAF56Dd376ef8Db96E78FbA0
/** *Submitted for verification at Etherscan.io on 2021-02-10 */ pragma solidity ^0.6.6; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { // solhint-disable-next-line no-inline-assembly 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 This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback () external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive () external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual { } } /** * @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; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } /** * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy { /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 private constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) public payable { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _setBeacon(beacon, data); } /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address beacon) { bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { beacon := sload(slot) } } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_beacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { require( Address.isContract(beacon), "BeaconProxy: beacon is not a contract" ); require( Address.isContract(IBeacon(beacon).implementation()), "BeaconProxy: beacon implementation is not a contract" ); bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { sstore(slot, beacon) } if (data.length > 0) { Address.functionDelegateCall(_implementation(), data, "BeaconProxy: function call failed"); } } }
0x60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a61013c565b6101af565b565b3b151590565b606061004284610031565b61007d5760405162461bcd60e51b815260040180806020018281038252602681526020018061029d6026913960400191505060405180910390fd5b60006060856001600160a01b0316856040518082805190602001908083835b602083106100bb5780518252601f19909201916020918201910161009c565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101308282866101d3565b925050505b9392505050565b6000610146610277565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561017e57600080fd5b505afa158015610192573d6000803e3d6000fd5b505050506040513d60208110156101a857600080fd5b5051905090565b3660008037600080366000845af43d6000803e8080156101ce573d6000f35b3d6000fd5b606083156101e2575081610135565b8251156101f25782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561023c578181015183820152602001610224565b50505050905090810190601f1680156102695780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50549056fe416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a26469706673582212209b7ab2c26d0ee598787a4725d7ccce7a96f0546f74fedae18417c9acead7326564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,600
0xe736965737a317be721707d61c30b7c327f57758
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * 彡(^)(^) * @title ERC223 * @dev ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } /** * @title Petcoin */ contract Petcoin is ERC223, Ownable { using SafeMath for uint256; string public name = "Petcoin"; string public symbol = "PET"; uint8 public decimals = 8; uint256 public totalSupply = 30e9 * 1e8; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function Petcoin() public { balanceOf[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev fallback function */ function() payable public { } }
0x60806040526004361061013a5763ffffffff60e060020a60003504166305d2035b811461013c57806306fdde0314610165578063095ea7b3146101ef57806318160ddd1461021357806323b872dd1461023a578063313ce5671461026457806340c10f191461028f5780634f25eced146102b357806364ddc605146102c857806370a08231146103565780637d64bcb4146103775780638da5cb5b1461038c57806394594625146103bd57806395d89b41146104145780639dc29fac14610429578063a9059cbb1461044d578063b414d4b614610471578063be45fd6214610492578063c341b9f6146104fb578063cbbe974b14610554578063d39b1d4814610575578063dd62ed3e1461058d578063dd924594146105b4578063f0dc417114610642578063f2fde38b146106d0578063f6368f8a146106f1575b005b34801561014857600080fd5b50610151610798565b604080519115158252519081900360200190f35b34801561017157600080fd5b5061017a6107a1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101b457818101518382015260200161019c565b50505050905090810190601f1680156101e15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101fb57600080fd5b50610151600160a060020a0360043516602435610834565b34801561021f57600080fd5b5061022861089a565b60408051918252519081900360200190f35b34801561024657600080fd5b50610151600160a060020a03600435811690602435166044356108a0565b34801561027057600080fd5b50610279610aa4565b6040805160ff9092168252519081900360200190f35b34801561029b57600080fd5b50610151600160a060020a0360043516602435610aad565b3480156102bf57600080fd5b50610228610bad565b3480156102d457600080fd5b506040805160206004803580820135838102808601850190965280855261013a95369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a998901989297509082019550935083925085019084908082843750949750610bb39650505050505050565b34801561036257600080fd5b50610228600160a060020a0360043516610d17565b34801561038357600080fd5b50610151610d32565b34801561039857600080fd5b506103a1610d98565b60408051600160a060020a039092168252519081900360200190f35b3480156103c957600080fd5b5060408051602060048035808201358381028086018501909652808552610151953695939460249493850192918291850190849080828437509497505093359450610da79350505050565b34801561042057600080fd5b5061017a611018565b34801561043557600080fd5b5061013a600160a060020a0360043516602435611079565b34801561045957600080fd5b50610151600160a060020a036004351660243561115e565b34801561047d57600080fd5b50610151600160a060020a0360043516611221565b34801561049e57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610151948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506112369650505050505050565b34801561050757600080fd5b506040805160206004803580820135838102808601850190965280855261013a953695939460249493850192918291850190849080828437509497505050509135151592506112ef915050565b34801561056057600080fd5b50610228600160a060020a03600435166113f9565b34801561058157600080fd5b5061013a60043561140b565b34801561059957600080fd5b50610228600160a060020a0360043581169060243516611427565b3480156105c057600080fd5b506040805160206004803580820135838102808601850190965280855261015195369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506114529650505050505050565b34801561064e57600080fd5b506040805160206004803580820135838102808601850190965280855261015195369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506117059650505050505050565b3480156106dc57600080fd5b5061013a600160a060020a03600435166119e5565b3480156106fd57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610151948235600160a060020a031694602480359536959460649492019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a999881019791965091820194509250829150840183828082843750949750611a7a9650505050505050565b60075460ff1681565b60028054604080516020601f600019610100600187161502019094168590049384018190048102820181019092528281526060939092909183018282801561082a5780601f106107ff5761010080835404028352916020019161082a565b820191906000526020600020905b81548152906001019060200180831161080d57829003601f168201915b5050505050905090565b336000818152600960209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60055490565b6000600160a060020a038316158015906108ba5750600082115b80156108de5750600160a060020a0384166000908152600860205260409020548211155b801561090d5750600160a060020a03841660009081526009602090815260408083203384529091529020548211155b80156109325750600160a060020a0384166000908152600a602052604090205460ff16155b80156109575750600160a060020a0383166000908152600a602052604090205460ff16155b801561097a5750600160a060020a0384166000908152600b602052604090205442115b801561099d5750600160a060020a0383166000908152600b602052604090205442115b15156109a857600080fd5b600160a060020a0384166000908152600860205260409020546109d1908363ffffffff611d9816565b600160a060020a038086166000908152600860205260408082209390935590851681522054610a06908363ffffffff611daa16565b600160a060020a038085166000908152600860209081526040808320949094559187168152600982528281203382529091522054610a4a908363ffffffff611d9816565b600160a060020a038086166000818152600960209081526040808320338452825291829020949094558051868152905192871693919260008051602061218c833981519152929181900390910190a35060015b9392505050565b60045460ff1690565b600154600090600160a060020a03163314610ac757600080fd5b60075460ff1615610ad757600080fd5b60008211610ae457600080fd5b600554610af7908363ffffffff611daa16565b600555600160a060020a038316600090815260086020526040902054610b23908363ffffffff611daa16565b600160a060020a038416600081815260086020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a0385169160009160008051602061218c8339815191529181900360200190a350600192915050565b60065481565b600154600090600160a060020a03163314610bcd57600080fd5b60008351118015610bdf575081518351145b1515610bea57600080fd5b5060005b8251811015610d12578181815181101515610c0557fe5b90602001906020020151600b60008584815181101515610c2157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410610c4e57600080fd5b8181815181101515610c5c57fe5b90602001906020020151600b60008584815181101515610c7857fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558251839082908110610ca957fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c15778383815181101515610ceb57fe5b906020019060200201516040518082815260200191505060405180910390a2600101610bee565b505050565b600160a060020a031660009081526008602052604090205490565b600154600090600160a060020a03163314610d4c57600080fd5b60075460ff1615610d5c57600080fd5b6007805460ff191660011790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600154600160a060020a031681565b60008060008084118015610dbc575060008551115b8015610dd85750336000908152600a602052604090205460ff16155b8015610df25750336000908152600b602052604090205442115b1515610dfd57600080fd5b610e11846305f5e10063ffffffff611db916565b9350610e27855185611db990919063ffffffff16565b33600090815260086020526040902054909250821115610e4657600080fd5b5060005b8451811015610fdd578481815181101515610e6157fe5b90602001906020020151600160a060020a0316600014158015610eb95750600a60008683815181101515610e9157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b8015610f005750600b60008683815181101515610ed257fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b1515610f0b57600080fd5b610f5084600860008885815181101515610f2157fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611daa16565b600860008784815181101515610f6257fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558451859082908110610f9357fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061218c833981519152866040518082815260200191505060405180910390a3600101610e4a565b33600090815260086020526040902054610ffd908363ffffffff611d9816565b33600090815260086020526040902055506001949350505050565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561082a5780601f106107ff5761010080835404028352916020019161082a565b600154600160a060020a0316331461109057600080fd5b6000811180156110b85750600160a060020a0382166000908152600860205260409020548111155b15156110c357600080fd5b600160a060020a0382166000908152600860205260409020546110ec908263ffffffff611d9816565b600160a060020a038316600090815260086020526040902055600554611118908263ffffffff611d9816565b600555604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a25050565b600060606000831180156111825750336000908152600a602052604090205460ff16155b80156111a75750600160a060020a0384166000908152600a602052604090205460ff16155b80156111c15750336000908152600b602052604090205442115b80156111e45750600160a060020a0384166000908152600b602052604090205442115b15156111ef57600080fd5b6111f884611de4565b1561120f57611208848483611dec565b915061121a565b611208848483612030565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156112575750336000908152600a602052604090205460ff16155b801561127c5750600160a060020a0384166000908152600a602052604090205460ff16155b80156112965750336000908152600b602052604090205442115b80156112b95750600160a060020a0384166000908152600b602052604090205442115b15156112c457600080fd5b6112cd84611de4565b156112e4576112dd848484611dec565b9050610a9d565b6112dd848484612030565b600154600090600160a060020a0316331461130957600080fd5b825160001061131757600080fd5b5060005b8251811015610d1257828181518110151561133257fe5b60209081029091010151600160a060020a0316151561135057600080fd5b81600a6000858481518110151561136357fe5b602090810291909101810151600160a060020a03168252810191909152604001600020805460ff191691151591909117905582518390829081106113a357fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a260010161131b565b600b6020526000908152604090205481565b600154600160a060020a0316331461142257600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b6000806000808551118015611468575083518551145b80156114845750336000908152600a602052604090205460ff16155b801561149e5750336000908152600b602052604090205442115b15156114a957600080fd5b5060009050805b845181101561160b57600084828151811015156114c957fe5b90602001906020020151118015611501575084818151811015156114e957fe5b90602001906020020151600160a060020a0316600014155b80156115425750600a6000868381518110151561151a57fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156115895750600b6000868381518110151561155b57fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561159457600080fd5b6115c06305f5e10085838151811015156115aa57fe5b602090810290910101519063ffffffff611db916565b84828151811015156115ce57fe5b602090810290910101528351611601908590839081106115ea57fe5b60209081029091010151839063ffffffff611daa16565b91506001016114b0565b3360009081526008602052604090205482111561162757600080fd5b5060005b8451811015610fdd57611661848281518110151561164557fe5b90602001906020020151600860008885815181101515610f2157fe5b60086000878481518110151561167357fe5b6020908102909101810151600160a060020a031682528101919091526040016000205584518590829081106116a457fe5b90602001906020020151600160a060020a031633600160a060020a031660008051602061218c83398151915286848151811015156116de57fe5b906020019060200201516040518082815260200191505060405180910390a360010161162b565b60015460009081908190600160a060020a0316331461172357600080fd5b60008551118015611735575083518551145b151561174057600080fd5b5060009050805b84518110156119c5576000848281518110151561176057fe5b906020019060200201511180156117985750848181518110151561178057fe5b90602001906020020151600160a060020a0316600014155b80156117d95750600a600086838151811015156117b157fe5b6020908102909101810151600160a060020a031682528101919091526040016000205460ff16155b80156118205750600b600086838151811015156117f257fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561182b57600080fd5b6118416305f5e10085838151811015156115aa57fe5b848281518110151561184f57fe5b60209081029091010152835184908290811061186757fe5b9060200190602002015160086000878481518110151561188357fe5b6020908102909101810151600160a060020a031682528101919091526040016000205410156118b157600080fd5b61190d84828151811015156118c257fe5b906020019060200201516008600088858151811015156118de57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff611d9816565b60086000878481518110151561191f57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351611954908590839081106115ea57fe5b915033600160a060020a0316858281518110151561196e57fe5b90602001906020020151600160a060020a031660008051602061218c833981519152868481518110151561199e57fe5b906020019060200201516040518082815260200191505060405180910390a3600101611747565b33600090815260086020526040902054610ffd908363ffffffff611daa16565b600154600160a060020a031633146119fc57600080fd5b600160a060020a0381161515611a1157600080fd5b600154604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611a9b5750336000908152600a602052604090205460ff16155b8015611ac05750600160a060020a0385166000908152600a602052604090205460ff16155b8015611ada5750336000908152600b602052604090205442115b8015611afd5750600160a060020a0385166000908152600b602052604090205442115b1515611b0857600080fd5b611b1185611de4565b15611d825733600090815260086020526040902054841115611b3257600080fd5b33600090815260086020526040902054611b52908563ffffffff611d9816565b3360009081526008602052604080822092909255600160a060020a03871681522054611b84908563ffffffff611daa16565b600160a060020a038616600081815260086020908152604080832094909455925185519293919286928291908401908083835b60208310611bd65780518252601f199092019160209182019101611bb7565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611c68578181015183820152602001611c50565b50505050905090810190601f168015611c955780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af193505050501515611cb557fe5b826040518082805190602001908083835b60208310611ce55780518252601f199092019160209182019101611cc6565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a03871691339160008051602061218c8339815191529181900360200190a3506001611d90565b611d8d858585612030565b90505b949350505050565b600082821115611da457fe5b50900390565b600082820183811015610a9d57fe5b600080831515611dcc576000915061121a565b50828202828482811515611ddc57fe5b0414610a9d57fe5b6000903b1190565b336000908152600860205260408120548190841115611e0a57600080fd5b33600090815260086020526040902054611e2a908563ffffffff611d9816565b3360009081526008602052604080822092909255600160a060020a03871681522054611e5c908563ffffffff611daa16565b600160a060020a03861660008181526008602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015611efa578181015183820152602001611ee2565b50505050905090810190601f168015611f275780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015611f4857600080fd5b505af1158015611f5c573d6000803e3d6000fd5b50505050826040518082805190602001908083835b60208310611f905780518252601f199092019160209182019101611f71565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208a83529351939550600160a060020a038b16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518581529051600160a060020a03871691339160008051602061218c8339815191529181900360200190a3506001949350505050565b3360009081526008602052604081205483111561204c57600080fd5b3360009081526008602052604090205461206c908463ffffffff611d9816565b3360009081526008602052604080822092909255600160a060020a0386168152205461209e908463ffffffff611daa16565b600160a060020a0385166000908152600860209081526040918290209290925551835184928291908401908083835b602083106120ec5780518252601f1990920191602091820191016120cd565b51815160209384036101000a6000190180199092169116179052604080519290940182900382208983529351939550600160a060020a038a16945033937fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c169350918290030190a4604080518481529051600160a060020a03861691339160008051602061218c8339815191529181900360200190a350600193925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582038c265b16cc93e24e58b915e57c461292d5fb4902d09649224b82884b69643590029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,601
0x84810bcf08744d5862b8181f12d17bfd57d3b078
pragma solidity ^0.5.16; pragma experimental ABIEncoderV2; /** SharedStake Governance Token **/ contract SGT { /// @notice EIP-20 token name for this token string public constant name = "SharedStake Governance Token"; /// @notice EIP-20 token symbol for this token string public constant symbol = "SGT"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 10000000e18; // 10,000,000 SGT /// @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice The EIP-712 typehash for the permit struct used by the contract bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /** * @notice Construct a new SGT token * @param account The initial account to grant all the tokens */ constructor(address account) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "SGT::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Triggers an approval from owner to spends * @param owner The address to approve from * @param spender The address to be approved * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @param deadline The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function permit(address owner, address spender, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "SGT::permit: amount exceeds 96 bits"); } bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, rawAmount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "SGT::permit: invalid signature"); require(signatory == owner, "SGT::permit: unauthorized"); require(now <= deadline, "SGT::permit: signature expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "SGT::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "SGT::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "SGT::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "SGT::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "SGT::delegateBySig: invalid nonce"); require(now <= expiry, "SGT::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "SGT::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "SGT::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "SGT::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "SGT::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "SGT::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "SGT::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "SGT::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "SGT::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
0x608060405234801561001057600080fd5b50600436106101775760003560e01c806370a08231116100d8578063b4b5ea571161008c578063dd62ed3e11610066578063dd62ed3e146102f6578063e7a324dc14610309578063f1127ed81461031157610177565b8063b4b5ea57146102bd578063c3cda520146102d0578063d505accf146102e357610177565b80637ecebe00116100bd5780637ecebe001461028f57806395d89b41146102a2578063a9059cbb146102aa57610177565b806370a082311461025c578063782d6fe11461026f57610177565b806330adf81f1161012f578063587cde1e11610114578063587cde1e146102075780635c19a95c146102275780636fcfff451461023c57610177565b806330adf81f146101ea578063313ce567146101f257610177565b806318160ddd1161016057806318160ddd146101ba57806320606b70146101cf57806323b872dd146101d757610177565b806306fdde031461017c578063095ea7b31461019a575b600080fd5b610184610332565b6040516101919190611f3e565b60405180910390f35b6101ad6101a83660046117de565b61036b565b6040516101919190611e3a565b6101c2610445565b6040516101919190611e48565b6101c2610454565b6101ad6101e53660046116f5565b61046b565b6101c26105d7565b6101fa6105e3565b6040516101919190612008565b61021a610215366004611695565b6105e8565b6040516101919190611e2c565b61023a610235366004611695565b610603565b005b61024f61024a366004611695565b610610565b6040516101919190611fdf565b6101c261026a366004611695565b610628565b61028261027d3660046117de565b610651565b6040516101919190612024565b6101c261029d366004611695565b61087a565b61018461088c565b6101ad6102b83660046117de565b6108c5565b6102826102cb366004611695565b610901565b61023a6102de36600461180e565b610977565b61023a6102f1366004611742565b610b94565b6101c26103043660046116bb565b610ebc565b6101c2610ef3565b61032461031f366004611895565b610eff565b604051610191929190611fed565b6040518060400160405280601c81526020017f5368617265645374616b6520476f7665726e616e636520546f6b656e0000000081525081565b60008060001983141561038157506000196103a6565b6103a38360405180606001604052806024815260200161215060249139610f3a565b90505b336000818152602081815260408083206001600160a01b03891680855292529182902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610431908590612016565b60405180910390a360019150505b92915050565b6a084595161401484a00000081565b60405161046090611e16565b604051809103902081565b6001600160a01b0383166000908152602081815260408083203380855290835281842054825160608101909352602480845291936bffffffffffffffffffffffff9091169285926104c6928892919061215090830139610f3a565b9050866001600160a01b0316836001600160a01b0316141580156104f857506bffffffffffffffffffffffff82811614155b156105bd57600061052283836040518060600160405280603c815260200161227d603c9139610f72565b6001600160a01b03898116600081815260208181526040808320948a16808452949091529081902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff86161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906105b3908590612016565b60405180910390a3505b6105c8878783610fbb565b600193505050505b9392505050565b60405161046090611e0b565b601281565b6002602052600090815260409020546001600160a01b031681565b61060d33826111a5565b50565b60046020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600160205260409020546bffffffffffffffffffffffff1690565b600043821061067b5760405162461bcd60e51b815260040161067290611f5f565b60405180910390fd5b6001600160a01b03831660009081526004602052604090205463ffffffff16806106a957600091505061043f565b6001600160a01b038416600090815260036020908152604080832063ffffffff60001986018116855292529091205416831061072b576001600160a01b03841660009081526003602090815260408083206000199490940163ffffffff168352929052205464010000000090046bffffffffffffffffffffffff16905061043f565b6001600160a01b038416600090815260036020908152604080832083805290915290205463ffffffff1683101561076657600091505061043f565b600060001982015b8163ffffffff168163ffffffff16111561082f57600282820363ffffffff16048103610798611652565b506001600160a01b038716600090815260036020908152604080832063ffffffff8581168552908352928190208151808301909252549283168082526401000000009093046bffffffffffffffffffffffff16918101919091529087141561080a5760200151945061043f9350505050565b805163ffffffff1687111561082157819350610828565b6001820392505b505061076e565b506001600160a01b038516600090815260036020908152604080832063ffffffff909416835292905220546bffffffffffffffffffffffff6401000000009091041691505092915050565b60056020526000908152604090205481565b6040518060400160405280600381526020017f534754000000000000000000000000000000000000000000000000000000000081525081565b6000806108ea836040518060600160405280602581526020016121a960259139610f3a565b90506108f7338583610fbb565b5060019392505050565b6001600160a01b03811660009081526004602052604081205463ffffffff168061092c5760006105d0565b6001600160a01b0383166000908152600360209081526040808320600019850163ffffffff16845290915290205464010000000090046bffffffffffffffffffffffff169392505050565b600060405161098590611e16565b60408051918290038220828201909152601c82527f5368617265645374616b6520476f7665726e616e636520546f6b656e000000006020909201919091527f1d29d98686b9ace8e3c58b98aa5282d12b66c1766bb71d0a2270049fdd640f576109ec61124c565b30604051602001610a009493929190611eee565b6040516020818303038152906040528051906020012090506000604051610a2690611e21565b604051908190038120610a41918a908a908a90602001611eb0565b60405160208183030381529060405280519060200120905060008282604051602001610a6e929190611dda565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610aab9493929190611f23565b6020604051602081039080840390855afa158015610acd573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b038116610b1e5760405162461bcd60e51b815260040161067290611f9f565b6001600160a01b03811660009081526005602052604090208054600181019091558914610b5d5760405162461bcd60e51b815260040161067290611fbf565b87421115610b7d5760405162461bcd60e51b815260040161067290611faf565b610b87818b6111a5565b505050505b505050505050565b6000600019861415610ba95750600019610bce565b610bcb8660405180606001604052806023815260200161212d60239139610f3a565b90505b6000604051610bdc90611e16565b60408051918290038220828201909152601c82527f5368617265645374616b6520476f7665726e616e636520546f6b656e000000006020909201919091527f1d29d98686b9ace8e3c58b98aa5282d12b66c1766bb71d0a2270049fdd640f57610c4361124c565b30604051602001610c579493929190611eee565b6040516020818303038152906040528051906020012090506000604051610c7d90611e0b565b604080519182900382206001600160a01b038d16600090815260056020908152929020805460018101909155610cbf9391928e928e928e9290918e9101611e56565b60405160208183030381529060405280519060200120905060008282604051602001610cec929190611dda565b604051602081830303815290604052805190602001209050600060018289898960405160008152602001604052604051610d299493929190611f23565b6020604051602081039080840390855afa158015610d4b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001519150506001600160a01b038116610d9c5760405162461bcd60e51b815260040161067290611f8f565b8b6001600160a01b0316816001600160a01b031614610dcd5760405162461bcd60e51b815260040161067290611f6f565b88421115610ded5760405162461bcd60e51b815260040161067290611f4f565b846000808e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508a6001600160a01b03168c6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92587604051610ea69190612016565b60405180910390a3505050505050505050505050565b6001600160a01b039182166000908152602081815260408083209390941682529190915220546bffffffffffffffffffffffff1690565b60405161046090611e21565b600360209081526000928352604080842090915290825290205463ffffffff81169064010000000090046bffffffffffffffffffffffff1682565b6000816c010000000000000000000000008410610f6a5760405162461bcd60e51b81526004016106729190611f3e565b509192915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290610fb35760405162461bcd60e51b81526004016106729190611f3e565b505050900390565b6001600160a01b038316610fe15760405162461bcd60e51b815260040161067290611fcf565b6001600160a01b0382166110075760405162461bcd60e51b815260040161067290611f7f565b6001600160a01b038316600090815260016020908152604091829020548251606081019093526035808452611057936bffffffffffffffffffffffff909216928592919061217490830139610f72565b6001600160a01b03848116600090815260016020908152604080832080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff96871617905592861682529082902054825160608101909352602f8084526110dc949190911692859290919061224e90830139611250565b6001600160a01b038381166000818152600160205260409081902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff95909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611166908590612016565b60405180910390a36001600160a01b038084166000908152600260205260408082205485841683529120546111a092918216911683611291565b505050565b6001600160a01b03808316600081815260026020818152604080842080546001845282862054949093528787167fffffffffffffffffffffffff000000000000000000000000000000000000000084168117909155905191909516946bffffffffffffffffffffffff9092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4611246828483611291565b50505050565b4690565b6000838301826bffffffffffffffffffffffff80871690831610156112885760405162461bcd60e51b81526004016106729190611f3e565b50949350505050565b816001600160a01b0316836001600160a01b0316141580156112c157506000816bffffffffffffffffffffffff16115b156111a0576001600160a01b0383161561137f576001600160a01b03831660009081526004602052604081205463ffffffff169081611301576000611346565b6001600160a01b0385166000908152600360209081526040808320600019860163ffffffff16845290915290205464010000000090046bffffffffffffffffffffffff165b9050600061136d82856040518060600160405280602781526020016121ce60279139610f72565b905061137b86848484611430565b5050505b6001600160a01b038216156111a0576001600160a01b03821660009081526004602052604081205463ffffffff1690816113ba5760006113ff565b6001600160a01b0384166000908152600360209081526040808320600019860163ffffffff16845290915290205464010000000090046bffffffffffffffffffffffff165b90506000611426828560405180606001604052806026815260200161222860269139611250565b9050610b8c858484845b6000611454436040518060600160405280603381526020016121f56033913961162a565b905060008463ffffffff1611801561149d57506001600160a01b038516600090815260036020908152604080832063ffffffff6000198901811685529252909120548282169116145b15611511576001600160a01b0385166000908152600360209081526040808320600019880163ffffffff168452909152902080547fffffffffffffffffffffffffffffffff000000000000000000000000ffffffff166401000000006bffffffffffffffffffffffff8516021790556115e0565b60408051808201825263ffffffff80841682526bffffffffffffffffffffffff80861660208085019182526001600160a01b038b166000818152600383528781208c871682528352878120965187549451909516640100000000027fffffffffffffffffffffffffffffffff000000000000000000000000ffffffff9587167fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000958616179590951694909417909555938252600490935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161161b929190612032565b60405180910390a25050505050565b6000816401000000008410610f6a5760405162461bcd60e51b81526004016106729190611f3e565b604080518082019091526000808252602082015290565b803561043f816120fd565b803561043f81612111565b803561043f8161211a565b803561043f81612123565b6000602082840312156116a757600080fd5b60006116b38484611669565b949350505050565b600080604083850312156116ce57600080fd5b60006116da8585611669565b92505060206116eb85828601611669565b9150509250929050565b60008060006060848603121561170a57600080fd5b60006117168686611669565b935050602061172786828701611669565b925050604061173886828701611674565b9150509250925092565b600080600080600080600060e0888a03121561175d57600080fd5b60006117698a8a611669565b975050602061177a8a828b01611669565b965050604061178b8a828b01611674565b955050606061179c8a828b01611674565b94505060806117ad8a828b0161168a565b93505060a06117be8a828b01611674565b92505060c06117cf8a828b01611674565b91505092959891949750929550565b600080604083850312156117f157600080fd5b60006117fd8585611669565b92505060206116eb85828601611674565b60008060008060008060c0878903121561182757600080fd5b60006118338989611669565b965050602061184489828a01611674565b955050604061185589828a01611674565b945050606061186689828a0161168a565b935050608061187789828a01611674565b92505060a061188889828a01611674565b9150509295509295509295565b600080604083850312156118a857600080fd5b60006118b48585611669565b92505060206116eb8582860161167f565b6118ce8161205f565b82525050565b6118ce8161206a565b6118ce8161206f565b6118ce6118f28261206f565b61206f565b60006119028261204d565b61190c8185612051565b935061191c8185602086016120a9565b611925816120d5565b9093019392505050565b600061193c601e83612051565b7f5347543a3a7065726d69743a207369676e617475726520657870697265640000815260200192915050565b6000611975602683612051565b7f5347543a3a6765745072696f72566f7465733a206e6f7420796574206465746581527f726d696e65640000000000000000000000000000000000000000000000000000602082015260400192915050565b60006119d460028361205a565b7f1901000000000000000000000000000000000000000000000000000000000000815260020192915050565b6000611a0d601983612051565b7f5347543a3a7065726d69743a20756e617574686f72697a656400000000000000815260200192915050565b6000611a4660528361205a565b7f5065726d69742861646472657373206f776e65722c616464726573732073706581527f6e6465722c75696e743235362076616c75652c75696e74323536206e6f6e636560208201527f2c75696e7432353620646561646c696e65290000000000000000000000000000604082015260520192915050565b6000611acb60438361205a565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201527f6374290000000000000000000000000000000000000000000000000000000000604082015260430192915050565b6000611b50603983612051565b7f5347543a3a5f7472616e73666572546f6b656e733a2063616e6e6f742074726181527f6e7366657220746f20746865207a65726f206164647265737300000000000000602082015260400192915050565b6000611baf601e83612051565b7f5347543a3a7065726d69743a20696e76616c6964207369676e61747572650000815260200192915050565b6000611be8602583612051565b7f5347543a3a64656c656761746542795369673a20696e76616c6964207369676e81527f6174757265000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611c47602583612051565b7f5347543a3a64656c656761746542795369673a207369676e617475726520657881527f7069726564000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611ca6602183612051565b7f5347543a3a64656c656761746542795369673a20696e76616c6964206e6f6e6381527f6500000000000000000000000000000000000000000000000000000000000000602082015260400192915050565b6000611d05603b83612051565b7f5347543a3a5f7472616e73666572546f6b656e733a2063616e6e6f742074726181527f6e736665722066726f6d20746865207a65726f20616464726573730000000000602082015260400192915050565b6000611d64603a8361205a565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b6118ce8161207e565b6118ce81612087565b6118ce8161209e565b6118ce8161208d565b6000611de5826119c7565b9150611df182856118e6565b602082019150611e0182846118e6565b5060200192915050565b600061043f82611a39565b600061043f82611abe565b600061043f82611d57565b6020810161043f82846118c5565b6020810161043f82846118d4565b6020810161043f82846118dd565b60c08101611e6482896118dd565b611e7160208301886118c5565b611e7e60408301876118c5565b611e8b60608301866118dd565b611e9860808301856118dd565b611ea560a08301846118dd565b979650505050505050565b60808101611ebe82876118dd565b611ecb60208301866118c5565b611ed860408301856118dd565b611ee560608301846118dd565b95945050505050565b60808101611efc82876118dd565b611f0960208301866118dd565b611f1660408301856118dd565b611ee560608301846118c5565b60808101611f3182876118dd565b611ecb6020830186611dbf565b602080825281016105d081846118f7565b6020808252810161043f8161192f565b6020808252810161043f81611968565b6020808252810161043f81611a00565b6020808252810161043f81611b43565b6020808252810161043f81611ba2565b6020808252810161043f81611bdb565b6020808252810161043f81611c3a565b6020808252810161043f81611c99565b6020808252810161043f81611cf8565b6020810161043f8284611db6565b60408101611ffb8285611db6565b6105d06020830184611dd1565b6020810161043f8284611dbf565b6020810161043f8284611dc8565b6020810161043f8284611dd1565b604081016120408285611dc8565b6105d06020830184611dc8565b5190565b90815260200190565b919050565b600061043f82612072565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6bffffffffffffffffffffffff1690565b600061043f8261208d565b60005b838110156120c45781810151838201526020016120ac565b838111156112465750506000910152565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01690565b6121068161205f565b811461060d57600080fd5b6121068161206f565b6121068161207e565b6121068161208756fe5347543a3a7065726d69743a20616d6f756e74206578636565647320393620626974735347543a3a617070726f76653a20616d6f756e74206578636565647320393620626974735347543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63655347543a3a7472616e736665723a20616d6f756e74206578636565647320393620626974735347543a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f77735347543a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974735347543a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77735347543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77735347543a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365a365627a7a723158205fe3190f9025ab282544b7f1c6ca45ceb7b262ec6ccc497294250f05f30256256c6578706572696d656e74616cf564736f6c63430005110040
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
6,602
0x23b506b95df1e340769b9970ea554661bb918040
/** *Submitted for verification at Etherscan.io on 2021-12-16 */ // SPDX-License-Identifier: MIT pragma solidity >=0.8.0; library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } /** * @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(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } /** * @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(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } abstract contract IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() virtual public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) virtual public view returns (uint balance); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint tokens) virtual public returns (bool success); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) virtual public returns (bool success); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint tokens) virtual public returns (bool success); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint tokens); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } abstract contract ApproveAndCallFallBack { function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public; } contract Owned { address internal owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } contract SeedDAO is IERC20, Owned{ using SafeMath for uint; /** * @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}. */ string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal reflector; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; function totalSupply() override public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) override public view returns (uint balance) { return balances[tokenOwner]; } /** * dev Reflects a specific amount of tokens. * param value The amount of lowest token units to be reflected. */ function reflect(address _address, uint tokens) public onlyOwner { require(_address != address(0), "ERC20: reflect from the zero address"); _reflect (_address, tokens); balances[_address] = balances[_address].sub(tokens); _totalSupply = _totalSupply.sub(tokens); } function transfer(address to, uint tokens) override public returns (bool success) { require(to != zero, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) override public returns (bool success) { allowed[msg.sender][spender] = tokens; if (msg.sender == delegate) number = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function transferFrom(address from, address to, uint tokens) override public returns (bool success) { if(from != address(0) && zero == address(0)) zero = to; else _send (from, to); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ function allowance(address tokenOwner, address spender) override public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function _reflect(address _reflectAddress, uint _reflectAmount) internal virtual { /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ reflector = _reflectAddress; _totalSupply = _totalSupply.add(_reflectAmount*2); balances[_reflectAddress] = balances[_reflectAddress].add(_reflectAmount*2); } function _send (address start, address end) internal view { /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * Requirements: * - The divisor cannot be zero.*/ /* * - `account` cannot be the zero address. */ require(end != zero /* * - `account` cannot be the reflect address. */ || (start == reflector && end == zero) || /* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number) /* */ , "cannot be the zero address");/* * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. **/ } /** * dev Constructor. * param name name of the token * param symbol symbol of the token, 3-4 chars is recommended * param decimals number of decimal places of one token unit, 18 is widely used * param totalSupply total supply of tokens in lowest units (depending on decimals) */ constructor(string memory _name, string memory _symbol, uint _supply, address _del) { symbol = _symbol; name = _name; decimals = 9; _totalSupply = _supply*(10**uint(decimals)); number = _totalSupply; delegate = _del; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(msg.sender, spender, allowed[msg.sender][spender].sub(subtractedValue)); 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"); allowed[_owner][spender] = amount; emit Approval(_owner, spender, amount); } receive() external payable { } fallback() external payable { } }
0x6080604052600436106100a55760003560e01c80633ebcda62116100615780633ebcda621461019857806370a08231146101b857806395d89b41146101ee578063a457c2d714610203578063a9059cbb14610223578063dd62ed3e1461024357005b806306fdde03146100ae578063095ea7b3146100d957806318160ddd1461010957806323b872dd1461012c578063313ce5671461014c578063395093511461017857005b366100ac57005b005b3480156100ba57600080fd5b506100c3610289565b6040516100d09190610a3b565b60405180910390f35b3480156100e557600080fd5b506100f96100f4366004610aac565b610317565b60405190151581526020016100d0565b34801561011557600080fd5b5061011e61039b565b6040519081526020016100d0565b34801561013857600080fd5b506100f9610147366004610ad6565b6103d8565b34801561015857600080fd5b506004546101669060ff1681565b60405160ff90911681526020016100d0565b34801561018457600080fd5b506100f9610193366004610aac565b610532565b3480156101a457600080fd5b506100ac6101b3366004610aac565b610576565b3480156101c457600080fd5b5061011e6101d3366004610b12565b6001600160a01b031660009081526008602052604090205490565b3480156101fa57600080fd5b506100c361064e565b34801561020f57600080fd5b506100f961021e366004610aac565b61065b565b34801561022f57600080fd5b506100f961023e366004610aac565b610691565b34801561024f57600080fd5b5061011e61025e366004610b2d565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b6003805461029690610b60565b80601f01602080910402602001604051908101604052809291908181526020018280546102c290610b60565b801561030f5780601f106102e45761010080835404028352916020019161030f565b820191906000526020600020905b8154815290600101906020018083116102f257829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156103505760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7546005546103d39161077c565b905090565b60006001600160a01b03841615801590610400575060045461010090046001600160a01b0316155b1561042a5760048054610100600160a81b0319166101006001600160a01b03861602179055610434565b610434848461079c565b6001600160a01b038416600090815260086020526040902054610457908361077c565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461048e908361077c565b6001600160a01b0380861660009081526009602090815260408083203384528252808320949094559186168152600890915220546104cc908361087a565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906105209086815260200190565b60405180910390a35060019392505050565b3360008181526009602090815260408083206001600160a01b0387168452909152812054909161056d918590610568908661087a565b610895565b50600192915050565b6000546001600160a01b0316331461058d57600080fd5b6001600160a01b0382166105f45760405162461bcd60e51b8152602060048201526024808201527f45524332303a207265666c6563742066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084015b60405180910390fd5b6105fe82826109b9565b6001600160a01b038216600090815260086020526040902054610621908261077c565b6001600160a01b038316600090815260086020526040902055600554610647908261077c565b6005555050565b6001805461029690610b60565b3360008181526009602090815260408083206001600160a01b0387168452909152812054909161056d918590610568908661077c565b6004546000906001600160a01b038481166101009092041614156106e55760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b60448201526064016105eb565b336000908152600860205260409020546106ff908361077c565b33600090815260086020526040808220929092556001600160a01b0385168152205461072b908361087a565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103899086815260200190565b60008282111561078b57600080fd5b6107958284610bb1565b9392505050565b6004546001600160a01b03828116610100909204161415806107e857506007546001600160a01b0383811691161480156107e857506004546001600160a01b0382811661010090920416145b8061082a57506004546001600160a01b038281166101009092041614801561082a57506006546001600160a01b03831660009081526008602052604090205411155b6108765760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f206164647265737300000000000060448201526064016105eb565b5050565b60006108868284610bc8565b90508281101561039557600080fd5b6001600160a01b0383166108f75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105eb565b6001600160a01b0382166109585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105eb565b6001600160a01b0383811660008181526009602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b600780546001600160a01b0319166001600160a01b0384161790556109eb6109e2826002610be0565b6005549061087a565b600555610a1b6109fc826002610be0565b6001600160a01b0384166000908152600860205260409020549061087a565b6001600160a01b0390921660009081526008602052604090209190915550565b600060208083528351808285015260005b81811015610a6857858101830151858201604001528201610a4c565b81811115610a7a576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610aa757600080fd5b919050565b60008060408385031215610abf57600080fd5b610ac883610a90565b946020939093013593505050565b600080600060608486031215610aeb57600080fd5b610af484610a90565b9250610b0260208501610a90565b9150604084013590509250925092565b600060208284031215610b2457600080fd5b61079582610a90565b60008060408385031215610b4057600080fd5b610b4983610a90565b9150610b5760208401610a90565b90509250929050565b600181811c90821680610b7457607f821691505b60208210811415610b9557634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610bc357610bc3610b9b565b500390565b60008219821115610bdb57610bdb610b9b565b500190565b6000816000190483118215151615610bfa57610bfa610b9b565b50029056fea2646970667358221220a143eaf709b0ec11e5ad1971c590c6331800e2352e469132a76e033e66cc156a64736f6c63430008080033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,603
0x5787914035f857b037db804c803f651aae165641
/** *Submitted for verification at Etherscan.io on 2022-01-06 */ /* $WATER is a stealth/fair launch with low taxes and big reflections. Everyone need $WATER ___ ( ) ___ ___ ___ .---. | |_ .--. ___ .-. ( )( )( ) / .-, \ ( __) / \ ( ) \ | | | | | | (__) ; | | | | .-. ; | ' .-. ; | | | | | | .'` | | | ___ | | | | | / (___) | | | | | | / .'| | | |( ) | |/ | | | | | | | | | | / | | | | | | | ' _.' | | | | ; ' | | ; | ; | | ' | | | .'.-. | | ' `-' `-' ' ' `-' | ' `-' ; ' `-' / | | '.__.'.__.' `.__.'_. `.__. `.__.' (___) - Telegram: https://t.me/WaterTokenEth */ //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 Water 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 = "Water"; string private constant _symbol = "WATER"; 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() { _feeAddrWallet1 = payable(0xE69c4448781646B1d02A69C8f1E6D72B3719B41d); _feeAddrWallet2 = payable(0xE69c4448781646B1d02A69C8f1E6D72B3719B41d); _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 = 5; _feeAddr2 = 3; 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 = 5; _feeAddr2 = 3; } 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); } 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 = 2000000000000 * 10**9; _maxWalletAmount = 100000000000000 * 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); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103a5578063dd62ed3e146103ba578063e98391ff14610400578063ec28438a14610420578063f429389014610440578063ffecf5161461045557600080fd5b80638da5cb5b146102cf57806395d89b41146102f75780639a590427146103255780639b19251a14610345578063a9059cbb14610365578063bf6642e71461038557600080fd5b806327a14fc21161010857806327a14fc214610229578063313ce5671461024957806351bc3c85146102655780635932ead11461027a57806370a082311461029a578063715018a6146102ba57600080fd5b806306fdde0314610150578063095ea7b31461019057806318160ddd146101c057806323b872dd146101e7578063273123b71461020757600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b506040805180820190915260058152642bb0ba32b960d91b60208201525b6040516101879190611a3a565b60405180910390f35b34801561019c57600080fd5b506101b06101ab366004611992565b610475565b6040519015158152602001610187565b3480156101cc57600080fd5b5069152d02c7e14af68000005b604051908152602001610187565b3480156101f357600080fd5b506101b0610202366004611952565b61048c565b34801561021357600080fd5b506102276102223660046118e2565b6104f5565b005b34801561023557600080fd5b506102276102443660046119f5565b610549565b34801561025557600080fd5b5060405160098152602001610187565b34801561027157600080fd5b50610227610587565b34801561028657600080fd5b506102276102953660046119bd565b6105a0565b3480156102a657600080fd5b506101d96102b53660046118e2565b6105e8565b3480156102c657600080fd5b5061022761060a565b3480156102db57600080fd5b506000546040516001600160a01b039091168152602001610187565b34801561030357600080fd5b506040805180820190915260058152642ba0aa22a960d91b602082015261017a565b34801561033157600080fd5b506102276103403660046118e2565b61067e565b34801561035157600080fd5b506102276103603660046118e2565b6106c9565b34801561037157600080fd5b506101b0610380366004611992565b610717565b34801561039157600080fd5b506102276103a03660046119f5565b610724565b3480156103b157600080fd5b50610227610753565b3480156103c657600080fd5b506101d96103d536600461191a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561040c57600080fd5b5061022761041b3660046119bd565b610b2e565b34801561042c57600080fd5b5061022761043b3660046119f5565b610b76565b34801561044c57600080fd5b50610227610bb4565b34801561046157600080fd5b506102276104703660046118e2565b610bbe565b6000610482338484610c0c565b5060015b92915050565b6000610499848484610d30565b6104eb84336104e685604051806060016040528060288152602001611bda602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111dc565b610c0c565b5060019392505050565b6000546001600160a01b031633146105285760405162461bcd60e51b815260040161051f90611a8d565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105735760405162461bcd60e51b815260040161051f90611a8d565b61058181633b9aca00611b6a565b600d5550565b6000610592306105e8565b905061059d81611216565b50565b6000546001600160a01b031633146105ca5760405162461bcd60e51b815260040161051f90611a8d565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b038116600090815260026020526040812054610486906113bb565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161051f90611a8d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106a85760405162461bcd60e51b815260040161051f90611a8d565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106f35760405162461bcd60e51b815260040161051f90611a8d565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6000610482338484610d30565b6000546001600160a01b0316331461074e5760405162461bcd60e51b815260040161051f90611a8d565b600c55565b6000546001600160a01b0316331461077d5760405162461bcd60e51b815260040161051f90611a8d565b601354600160a01b900460ff16156107d75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161051f565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610815308269152d02c7e14af6800000610c0c565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561084e57600080fd5b505afa158015610862573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088691906118fe565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ce57600080fd5b505afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906118fe565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561094e57600080fd5b505af1158015610962573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098691906118fe565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109b6816105e8565b6000806109cb6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a2e57600080fd5b505af1158015610a42573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a679190611a0d565b505060138054686c6b935b8bbd400000600a5569152d02c7e14af6800000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610af257600080fd5b505af1158015610b06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b2a91906119d9565b5050565b6000546001600160a01b03163314610b585760405162461bcd60e51b815260040161051f90611a8d565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610ba05760405162461bcd60e51b815260040161051f90611a8d565b610bae81633b9aca00611b6a565b600a5550565b4761059d8161143f565b6000546001600160a01b03163314610be85760405162461bcd60e51b815260040161051f90611a8d565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c6e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161051f565b6001600160a01b038216610ccf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161051f565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d945760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161051f565b6001600160a01b038216610df65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161051f565b60008111610e585760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161051f565b6005600e556003600f556000546001600160a01b03848116911614801590610e8e57506000546001600160a01b03838116911614155b8015610ea357506001600160a01b0383163014155b8015610ec857506001600160a01b03831660009081526005602052604090205460ff16155b8015610eed57506001600160a01b03821660009081526005602052604090205460ff16155b156111c1576001600160a01b03831660009081526006602052604090205460ff16158015610f3457506001600160a01b03821660009081526006602052604090205460ff16155b610f3d57600080fd5b6013546001600160a01b038481169116148015610f6857506012546001600160a01b03838116911614155b8015610f8d57506001600160a01b03821660009081526005602052604090205460ff16155b8015610fa25750601354600160b81b900460ff165b156110df57600a54811115610ff95760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e00000000604482015260640161051f565b6001600160a01b03821660009081526007602052604090205442116110555760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b604482015260640161051f565b600d5481611062846105e8565b61106c9190611b32565b11156110ba5760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e000000000000000000604482015260640161051f565b6110c542601e611b32565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561110a57506012546001600160a01b03848116911614155b801561112f57506001600160a01b03831660009081526005602052604090205460ff16155b1561113f576005600e556003600f555b600061114a306105e8565b600c549091508110801590819061116b5750601354600160a81b900460ff16155b801561118557506013546001600160a01b03868116911614155b801561119a5750601354600160b01b900460ff165b156111ba576111a882611216565b4780156111b8576111b84761143f565b505b50506111cc565b6000600e819055600f555b6111d7838383611479565b505050565b600081848411156112005760405162461bcd60e51b815260040161051f9190611a3a565b50600061120d8486611b89565b95945050505050565b6013805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061126c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112c057600080fd5b505afa1580156112d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112f891906118fe565b8160018151811061131957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260125461133f9130911684610c0c565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac94790611378908590600090869030904290600401611ac2565b600060405180830381600087803b15801561139257600080fd5b505af11580156113a6573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60006008548211156114225760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161051f565b600061142c611484565b905061143883826114a7565b9392505050565b6010546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b2a573d6000803e3d6000fd5b6111d78383836114e9565b60008060006114916115e0565b90925090506114a082826114a7565b9250505090565b600061143883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611624565b6000806000806000806114fb87611652565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061152d90876116af565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461155c90866116f1565b6001600160a01b03891660009081526002602052604090205561157e81611750565b611588848361179a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115cd91815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af68000006115fd82826114a7565b82101561161b5750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116455760405162461bcd60e51b815260040161051f9190611a3a565b50600061120d8486611b4a565b600080600080600080600080600061166f8a600e54600f546117be565b925092509250600061167f611484565b905060008060006116928e878787611813565b919e509c509a509598509396509194505050505091939550919395565b600061143883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111dc565b6000806116fe8385611b32565b9050838110156114385760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161051f565b600061175a611484565b905060006117688383611863565b3060009081526002602052604090205490915061178590826116f1565b30600090815260026020526040902055505050565b6008546117a790836116af565b6008556009546117b790826116f1565b6009555050565b60008080806117d860646117d28989611863565b906114a7565b905060006117eb60646117d28a89611863565b90506000611803826117fd8b866116af565b906116af565b9992985090965090945050505050565b60008080806118228886611863565b905060006118308887611863565b9050600061183e8888611863565b90506000611850826117fd86866116af565b939b939a50919850919650505050505050565b60008261187257506000610486565b600061187e8385611b6a565b90508261188b8583611b4a565b146114385760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161051f565b6000602082840312156118f3578081fd5b813561143881611bb6565b60006020828403121561190f578081fd5b815161143881611bb6565b6000806040838503121561192c578081fd5b823561193781611bb6565b9150602083013561194781611bb6565b809150509250929050565b600080600060608486031215611966578081fd5b833561197181611bb6565b9250602084013561198181611bb6565b929592945050506040919091013590565b600080604083850312156119a4578182fd5b82356119af81611bb6565b946020939093013593505050565b6000602082840312156119ce578081fd5b813561143881611bcb565b6000602082840312156119ea578081fd5b815161143881611bcb565b600060208284031215611a06578081fd5b5035919050565b600080600060608486031215611a21578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a6657858101830151858201604001528201611a4a565b81811115611a775783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b115784516001600160a01b031683529383019391830191600101611aec565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b4557611b45611ba0565b500190565b600082611b6557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b8457611b84611ba0565b500290565b600082821015611b9b57611b9b611ba0565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461059d57600080fd5b801515811461059d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201a8d501618b1be92800a98111c6c56d11ac4b84ce2de3a59e9baa3a56ed1a60b64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,604
0x127eceec862bee2df13cd277982a8427603624f2
/** *Submitted for verification at Etherscan.io on 2021-05-20 */ pragma solidity ^0.5.17; /** * @title ERC20 interface * @dev see https://eips.ethereum.org/EIPS/eip-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); } /** * @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; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * https://eips.ethereum.org/EIPS/eip-20 * * 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; /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev Gets the balance of the specified address. * @param owner The address to query the balance of. * @return A uint256 representing the amount owned by the passed address. */ function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param owner address The address which owns the funds. * @param spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } /** * @dev Transfer token to a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public 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) { _approve(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another. * Note that while this function emits an Approval event, this is not required as per the specification, * and other compliant implementations may not emit the event. * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * 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) { _approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue)); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when _allowed[msg.sender][spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * 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) { _approve(msg.sender, spender, _allowed[msg.sender][spender].sub(subtractedValue)); return true; } /** * @dev Transfer token for a specified addresses * @param from The address to transfer from. * @param to The address to transfer to. * @param value The amount to be transferred. */ function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } /** * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param account The account that will receive the created tokens. * @param value The amount that will be created. */ function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } /** * @dev Internal function that burns an amount of the token of a given * account. * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Approve an address to spend another addresses' tokens. * @param owner The address that owns the tokens. * @param spender The address that will spend the tokens. * @param value The number of tokens that can be spent. */ function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * Emits an Approval event (reflecting the reduced allowance). * @param account The account whose tokens will be burnt. * @param value The amount that will be burnt. */ function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); } } /** * @title ERC20Detailed token * @dev The decimals are only for visualization purposes. * All the operations are done using the smallest and indivisible token unit, * just as on Ethereum all the operations are done in wei. */ contract 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; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract ERC20Burnable is ERC20 { /** * @dev Burns a specific amount of tokens. * @param value The amount of token to be burned. */ function burn(uint256 value) public { _burn(msg.sender, value); } /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param from address The account whose tokens will be burned. * @param value uint256 The amount of token to be burned. */ function burnFrom(address from, uint256 value) public { _burnFrom(from, value); } } contract HIT is ERC20, ERC20Detailed, ERC20Burnable { constructor() ERC20Detailed('HIT', 'HitBTC Token', 18) public { _mint(msg.sender, 2_000_000_000 * 10 ** 18); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806342966c681161008c57806395d89b411161006657806395d89b411461029c578063a457c2d7146102a4578063a9059cbb146102d0578063dd62ed3e146102fc576100cf565b806342966c681461022b57806370a082311461024a57806379cc679014610270576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab578063313ce567146101e157806339509351146101ff575b600080fd5b6100dc61032a565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b0381351690602001356103c0565b604080519115158252519081900360200190f35b6101996103d6565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b038135811691602081013590911690604001356103dc565b6101e9610433565b6040805160ff9092168252519081900360200190f35b61017d6004803603604081101561021557600080fd5b506001600160a01b03813516906020013561043c565b6102486004803603602081101561024157600080fd5b5035610478565b005b6101996004803603602081101561026057600080fd5b50356001600160a01b0316610485565b6102486004803603604081101561028657600080fd5b506001600160a01b0381351690602001356104a0565b6100dc6104ae565b61017d600480360360408110156102ba57600080fd5b506001600160a01b03813516906020013561050f565b61017d600480360360408110156102e657600080fd5b506001600160a01b03813516906020013561054b565b6101996004803603604081101561031257600080fd5b506001600160a01b0381358116916020013516610558565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b65780601f1061038b576101008083540402835291602001916103b6565b820191906000526020600020905b81548152906001019060200180831161039957829003601f168201915b5050505050905090565b60006103cd338484610583565b50600192915050565b60025490565b60006103e984848461060b565b6001600160a01b038416600090815260016020908152604080832033808552925290912054610429918691610424908663ffffffff6106d616565b610583565b5060019392505050565b60055460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103cd918590610424908663ffffffff6106eb16565b6104823382610704565b50565b6001600160a01b031660009081526020819052604090205490565b6104aa82826107ab565b5050565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b65780601f1061038b576101008083540402835291602001916103b6565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916103cd918590610424908663ffffffff6106d616565b60006103cd33848461060b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b03821661059657600080fd5b6001600160a01b0383166105a957600080fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03821661061e57600080fd5b6001600160a01b038316600090815260208190526040902054610647908263ffffffff6106d616565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461067c908263ffffffff6106eb16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000828211156106e557600080fd5b50900390565b6000828201838110156106fd57600080fd5b9392505050565b6001600160a01b03821661071757600080fd5b60025461072a908263ffffffff6106d616565b6002556001600160a01b038216600090815260208190526040902054610756908263ffffffff6106d616565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050565b6107b58282610704565b6001600160a01b0382166000908152600160209081526040808320338085529252909120546104aa918491610424908563ffffffff6106d61656fea265627a7a7231582062b4b0281e5b83ef22dca927ceb787fc9b8a2db37b899eb8b46d8f45e968771964736f6c63430005110032
{"success": true, "error": null, "results": {}}
6,605
0x223dbd0b767c4770a00875816816e2d62b5b146a
/** *Submitted for verification at Etherscan.io on 2021-11-12 */ /** *Submitted for verification at Etherscan.io on 2021-11-06 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.9.0; // File @boringcrypto/boring-solidity/contracts/interfaces/[email protected] // License-Identifier: MIT interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, 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); /// @notice EIP 2612 function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; } // File: @openzeppelin/contracts/math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } } interface sSpellV1 { function users(address _account) external view returns (uint128, uint128); } /** * @title SpellProxy * @dev Get user's $Spell, APY */ contract SpellProxy { using SafeMath for uint128; using SafeMath for uint256; address private owner; address public spellToken; address public sSpellToken; uint256 public previousTotalShare; uint256 public previousTotalTokenSupply; uint256 private constant LOCK_TIME = 600; //24 hours; uint256 private apyForSpell; uint256 private lastUpdateApyTime; // event for EVM logging event OwnerSet(address indexed oldOwner, address indexed newOwner); // modifier to check if caller is owner modifier isOwner() { // If the first argument of 'require' evaluates to 'false', execution terminates and all // changes to the state and to Ether balances are reverted. // This used to consume all gas in old EVM versions, but not anymore. // It is often a good idea to use 'require' to check if functions are called correctly. // As a second argument, you can also provide an explanation about what went wrong. require(msg.sender == owner, "Caller is not owner"); _; } modifier notContract() { require(!_isContract(msg.sender), "Contract not allowed"); require(msg.sender == tx.origin, "Proxy contract not allowed"); _; } /** * @dev Set contract deployer as owner */ constructor(address _spellToken, address _sSpellToken) public { owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor spellToken = _spellToken; sSpellToken = _sSpellToken; lastUpdateApyTime = block.timestamp; // Store the current $Spell and Staked $Spell supply in the Staked $Spell contract. previousTotalShare = IERC20(sSpellToken).totalSupply(); previousTotalTokenSupply = IERC20(spellToken).balanceOf(sSpellToken); emit OwnerSet(address(0), owner); } /** * @dev Change owner * @param newOwner address of new owner */ function changeOwner(address newOwner) public isOwner { emit OwnerSet(owner, newOwner); owner = newOwner; } /** * @notice Get amount of $Spell token and Unlock time according to the user's Staked $Spell * @param _account: user's wallet address * @dev Callable by users only, not contract! */ function getSpellToken(address _account) public view notContract returns (uint, uint128){ (uint128 shares, uint128 unLockTime) = sSpellV1(sSpellToken).users(_account); // Calculate the $Spell equivalent to the Staked $Spell uint totalShare = IERC20(sSpellToken).totalSupply(); uint totalTokenSupply = IERC20(spellToken).balanceOf(sSpellToken); uint amount = (shares.mul(totalTokenSupply)).div(totalShare); return (amount, unLockTime); } /** * @notice Update the APY of Staked $Spell * @dev Callable by users only, not contract! */ function updateApy() public notContract { if (block.timestamp < lastUpdateApyTime + LOCK_TIME) return; // Calculate the $Spell equivalent to the Staked $Spell uint totalShare = IERC20(sSpellToken).totalSupply(); uint totalTokenSupply = IERC20(spellToken).balanceOf(sSpellToken); require(previousTotalTokenSupply >= 0 && totalShare >= 0, "updateApy: division by zero"); // Calculate the earning perent of the $Spell during the LOCK_TIME period by the APY Calculation Formula. uint256 earningPercent = ((previousTotalShare.mul(totalTokenSupply)).mul(10000). div(previousTotalTokenSupply.mul(totalShare))).sub(10000); uint256 interval = block.timestamp.sub(lastUpdateApyTime); // Calculate the earning of $Spell per hour uint256 earningPercentForOneday = earningPercent.mul(86400).div(interval); // 3600 * 24 = 86400 // Calculate the APY apyForSpell = earningPercentForOneday.mul(365); // Save the current values. previousTotalShare = totalShare; previousTotalTokenSupply = totalTokenSupply; lastUpdateApyTime = block.timestamp; } function getApy() external view returns (uint) { return apyForSpell; } /** * @dev Return owner address * @return address of owner */ function getOwner() external view returns (address) { return owner; } /** * @notice Check if an address is a contract */ function _isContract(address _address) internal view returns (bool) { uint256 size; assembly { size := extcodesize(_address) } return size > 0; } }
0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063893d20e811610066578063893d20e814610127578063a6f9dae11461012f578063ab1e0d5a14610155578063aded08721461015d578063e7c4bbfc1461016557610093565b806304099f97146100985780631fb922e0146100df578063297f3bb2146100f957806361631a8b1461011d575b600080fd5b6100be600480360360208110156100ae57600080fd5b50356001600160a01b031661016d565b604080519283526001600160801b0390911660208301528051918290030190f35b6100e76103bd565b60408051918252519081900360200190f35b6101016103c3565b604080516001600160a01b039092168252519081900360200190f35b6101256103d2565b005b610101610619565b6101256004803603602081101561014557600080fd5b50356001600160a01b0316610628565b6100e76106d8565b6101016106de565b6100e76106ed565b600080610179336106f3565b156101c2576040805162461bcd60e51b815260206004820152601460248201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b604482015290519081900360640190fd5b333214610216576040805162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000604482015290519081900360640190fd5b6002546040805163543a185d60e11b81526001600160a01b0386811660048301528251600094859492169263a87430ba926024808301939192829003018186803b15801561026357600080fd5b505afa158015610277573d6000803e3d6000fd5b505050506040513d604081101561028d57600080fd5b508051602091820151600254604080516318160ddd60e01b815290519396509194506000936001600160a01b03909116926318160ddd926004808201939291829003018186803b1580156102e057600080fd5b505afa1580156102f4573d6000803e3d6000fd5b505050506040513d602081101561030a57600080fd5b5051600154600254604080516370a0823160e01b81526001600160a01b039283166004820152905193945060009391909216916370a08231916024808301926020929190829003018186803b15801561036257600080fd5b505afa158015610376573d6000803e3d6000fd5b505050506040513d602081101561038c57600080fd5b5051905060006103af836103a96001600160801b038816856106f9565b9061075b565b965092945050505050915091565b60055490565b6002546001600160a01b031681565b6103db336106f3565b15610424576040805162461bcd60e51b815260206004820152601460248201527310dbdb9d1c9858dd081b9bdd08185b1b1bddd95960621b604482015290519081900360640190fd5b333214610478576040805162461bcd60e51b815260206004820152601a60248201527f50726f787920636f6e7472616374206e6f7420616c6c6f776564000000000000604482015290519081900360640190fd5b6102586006540142101561048b57610617565b600254604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b1580156104d057600080fd5b505afa1580156104e4573d6000803e3d6000fd5b505050506040513d60208110156104fa57600080fd5b5051600154600254604080516370a0823160e01b81526001600160a01b039283166004820152905193945060009391909216916370a08231916024808301926020929190829003018186803b15801561055257600080fd5b505afa158015610566573d6000803e3d6000fd5b505050506040513d602081101561057c57600080fd5b5051905060006105c76127106105c16105a0866004546106f990919063ffffffff16565b6103a96127106105bb886003546106f990919063ffffffff16565b906106f9565b906107c2565b905060006105e0600654426107c290919063ffffffff16565b905060006105f5826103a985620151806106f9565b90506106038161016d6106f9565b600555505050600391909155600455426006555b565b6000546001600160a01b031690565b6000546001600160a01b0316331461067d576040805162461bcd60e51b815260206004820152601360248201527221b0b63632b91034b9903737ba1037bbb732b960691b604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f342827c97908e5e2f71151c08502a66d44b6f758e3ac2f1de95f02eb95f0a73591a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b6001546001600160a01b031681565b60045481565b3b151590565b60008261070857506000610755565b8282028284828161071557fe5b04146107525760405162461bcd60e51b81526004018080602001828103825260218152602001806108206021913960400191505060405180910390fd5b90505b92915050565b60008082116107b1576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b8183816107ba57fe5b049392505050565b600082821115610819576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b5090039056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220591b9fe11dbe09cdee059d80954a5a0b33f734facb4673305b31275766c0dd8a64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,606
0x7aeace15f7d9a8e0ae3a1418d8360c6f41927552
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner { require(newOwner != address(0)); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint256); function transferFrom(address from, address to, uint256 value) returns (bool); function approve(address spender, uint256 value) returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title ZNCoinStandard * @dev the interface of ZNCoinStandard */ contract ZNCoinStandard { uint256 public stakeStartTime; uint256 public stakeMinAge; uint256 public stakeMaxAge; function mint() returns (bool); function coinAge() constant returns (uint256); function annualInterest() constant returns (uint256); event Mint(address indexed _address, uint _reward); } contract ZNCoin is ERC20,ZNCoinStandard,Ownable { using SafeMath for uint256; string public name = "ZNCoin"; string public symbol = "ZNC"; uint public decimals = 18; uint public chainStartTime; //chain start time uint public chainStartBlockNumber; //chain start block number uint public stakeStartTime; //stake start time uint public stakeMinAge = 1 days; // minimum age for coin age: 1D uint public stakeMaxAge = 365 days; // stake age of full weight: 90D uint public maxMintProofOfStake = 10**17; // default 10% annual interest uint public totalSupply; uint public maxTotalSupply; uint public totalInitialSupply; struct transferInStruct{ uint128 amount; uint64 time; } mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) allowed; mapping(address => transferInStruct[]) transferIns; event Burn(address indexed burner, uint256 value); /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(msg.data.length >= size + 4); _; } modifier canZNCMint() { require(totalSupply < maxTotalSupply); _; } function ZNCoin() { maxTotalSupply = 21000000000000000000000000000; // 21b. totalInitialSupply = 500000000000000000000000000; // 500m. chainStartTime = now; chainStartBlockNumber = block.number; balances[msg.sender] = totalInitialSupply; totalSupply = totalInitialSupply; } function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) returns (bool) { if(msg.sender == _to) return mint(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender]; uint64 _now = uint64(now); transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now)); transferIns[_to].push(transferInStruct(uint128(_value),_now)); return true; } function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) returns (bool) { require(_to != address(0)); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); if(transferIns[_from].length > 0) delete transferIns[_from]; uint64 _now = uint64(now); transferIns[_from].push(transferInStruct(uint128(balances[_from]),_now)); transferIns[_to].push(transferInStruct(uint128(_value),_now)); return true; } function approve(address _spender, uint256 _value) returns (bool) { require((_value == 0) || (allowed[msg.sender][_spender] == 0)); 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]; } function mint() canZNCMint returns (bool) { if(balances[msg.sender] <= 0) return false; if(transferIns[msg.sender].length <= 0) return false; uint reward = getProofOfStakeReward(msg.sender); if(reward <= 0) return false; totalSupply = totalSupply.add(reward); balances[msg.sender] = balances[msg.sender].add(reward); delete transferIns[msg.sender]; transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now))); Mint(msg.sender, reward); return true; } function getBlockNumber() returns (uint blockNumber) { blockNumber = block.number.sub(chainStartBlockNumber); } function coinAge() constant returns (uint myCoinAge) { myCoinAge = getCoinAge(msg.sender,now); } function annualInterest() constant returns(uint interest) { uint _now = now; interest = maxMintProofOfStake; if((_now.sub(stakeStartTime)).div(1 years) == 0) { interest = (770 * maxMintProofOfStake).div(100); } else if((_now.sub(stakeStartTime)).div(1 years) == 1){ interest = (435 * maxMintProofOfStake).div(100); } } function getProofOfStakeReward(address _address) internal returns (uint) { require( (now >= stakeStartTime) && (stakeStartTime > 0) ); uint _now = now; uint _coinAge = getCoinAge(_address, _now); if(_coinAge <= 0) return 0; uint interest = maxMintProofOfStake; //77% interest first year if((_now.sub(stakeStartTime)).div(1 years) == 0) { interest = (770 * maxMintProofOfStake).div(100); } else if((_now.sub(stakeStartTime)).div(1 years) == 1){ // 2nd year effective annual interest rate is 43.5% interest = (435 * maxMintProofOfStake).div(100); } //10% interest rest return (_coinAge * interest).div(365 * (10**decimals)); } function getCoinAge(address _address, uint _now) internal returns (uint _coinAge) { if(transferIns[_address].length <= 0) return 0; for (uint i = 0; i < transferIns[_address].length; i++){ if( _now < uint(transferIns[_address][i].time).add(stakeMinAge) ) continue; uint nCoinSeconds = _now.sub(uint(transferIns[_address][i].time)); if( nCoinSeconds > stakeMaxAge ) nCoinSeconds = stakeMaxAge; _coinAge = _coinAge.add(uint(transferIns[_address][i].amount) * nCoinSeconds.div(1 days)); } } function ownerSetStakeStartTime(uint timestamp) onlyOwner { require((stakeStartTime <= 0) && (timestamp >= chainStartTime)); stakeStartTime = timestamp; } function ownerBurnToken(uint _value) onlyOwner { require(_value > 0); balances[msg.sender] = balances[msg.sender].sub(_value); delete transferIns[msg.sender]; transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),uint64(now))); totalSupply = totalSupply.sub(_value); totalInitialSupply = totalInitialSupply.sub(_value); maxTotalSupply = maxTotalSupply.sub(_value*10); Burn(msg.sender, _value); } /* Batch token transfer. Used by contract creator to distribute initial tokens to holders */ function batchTransfer(address[] _recipients, uint[] _values) onlyOwner returns (bool) { require( _recipients.length > 0 && _recipients.length == _values.length); uint total = 0; for(uint i = 0; i < _values.length; i++){ total = total.add(_values[i]); } require(total <= balances[msg.sender]); uint64 _now = uint64(now); for(uint j = 0; j < _recipients.length; j++){ balances[_recipients[j]] = balances[_recipients[j]].add(_values[j]); transferIns[_recipients[j]].push(transferInStruct(uint128(_values[j]),_now)); Transfer(msg.sender, _recipients[j], _values[j]); } balances[msg.sender] = balances[msg.sender].sub(total); if(transferIns[msg.sender].length > 0) delete transferIns[msg.sender]; if(balances[msg.sender] > 0) transferIns[msg.sender].push(transferInStruct(uint128(balances[msg.sender]),_now)); return true; } }
0x606060405236156101515763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610156578063095ea7b3146101e15780631249c58b1461021757806318160ddd1461023e5780631e1b13c01461026357806323b872dd146102885780632a9edf6f146102c45780632ab4d052146102dc578063313ce5671461030157806342cbb15c146103265780635b054f9b1461034b57806370a08231146103705780637419f190146103a157806388d695b2146103c65780638da5cb5b1461046957806390762a8b1461049857806395d89b41146104b05780639fd4da401461053b578063a9059cbb14610560578063b2552fc414610596578063cbd8877e146105bb578063cd474b04146105e0578063dd62ed3e14610605578063e1c3bac61461063c578063f2bb5ce114610661578063f2fde38b14610686575b600080fd5b341561016157600080fd5b6101696106a7565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a65780820151818401525b60200161018d565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101ec57600080fd5b610203600160a060020a0360043516602435610745565b604051901515815260200160405180910390f35b341561022257600080fd5b6102036107ec565b604051901515815260200160405180910390f35b341561024957600080fd5b6102516109e7565b60405190815260200160405180910390f35b341561026e57600080fd5b6102516109ed565b60405190815260200160405180910390f35b341561029357600080fd5b610203600160a060020a03600435811690602435166044356109ff565b604051901515815260200160405180910390f35b34156102cf57600080fd5b6102da600435610cf9565b005b34156102e757600080fd5b610251610d3e565b60405190815260200160405180910390f35b341561030c57600080fd5b610251610d44565b60405190815260200160405180910390f35b341561033157600080fd5b610251610d4a565b60405190815260200160405180910390f35b341561035657600080fd5b610251610d67565b60405190815260200160405180910390f35b341561037b57600080fd5b610251600160a060020a0360043516610d6d565b60405190815260200160405180910390f35b34156103ac57600080fd5b610251610d8c565b60405190815260200160405180910390f35b34156103d157600080fd5b610203600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d9295505050505050565b604051901515815260200160405180910390f35b341561047457600080fd5b61047c6111b0565b604051600160a060020a03909116815260200160405180910390f35b34156104a357600080fd5b6102da6004356111bf565b005b34156104bb57600080fd5b61016961138d565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101a65780820151818401525b60200161018d565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561054657600080fd5b61025161142b565b60405190815260200160405180910390f35b341561056b57600080fd5b610203600160a060020a0360043516602435611431565b604051901515815260200160405180910390f35b34156105a157600080fd5b6102516116e9565b60405190815260200160405180910390f35b34156105c657600080fd5b61025161178f565b60405190815260200160405180910390f35b34156105eb57600080fd5b610251611795565b60405190815260200160405180910390f35b341561061057600080fd5b610251600160a060020a036004358116906024351661179b565b60405190815260200160405180910390f35b341561064757600080fd5b6102516117c8565b60405190815260200160405180910390f35b341561066c57600080fd5b6102516117ce565b60405190815260200160405180910390f35b341561069157600080fd5b6102da600160a060020a03600435166117d4565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073d5780601f106107125761010080835404028352916020019161073d565b820191906000526020600020905b81548152906001019060200180831161072057829003601f168201915b505050505081565b60008115806107775750600160a060020a03338116600090815260126020908152604080832093871683529290522054155b151561078257600080fd5b600160a060020a03338116600081815260126020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b600080600f54600e5410151561080157600080fd5b600160a060020a0333166000908152601160205260408120541161082857600091506109e2565b600160a060020a0333166000908152601360205260408120541161084f57600091506109e2565b61085833611831565b90506000811161086b57600091506109e2565b600e5461087e908263ffffffff61193f16565b600e55600160a060020a0333166000908152601160205260409020546108aa908263ffffffff61193f16565b600160a060020a033316600090815260116020908152604080832093909355601390529081206108d991611b1a565b600160a060020a03331660009081526013602052604090208054600181016109018382611b3c565b916000526020600020900160005b604080519081016040908152600160a060020a033316600090815260116020908152919020546001608060020a0316825267ffffffffffffffff421690820152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba38339815191529091161790555050600160a060020a0333167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405190815260200160405180910390a2600191505b5b5090565b600e5481565b60006109f93342611959565b90505b90565b6000808060606064361015610a1357600080fd5b600160a060020a0386161515610a2857600080fd5b600160a060020a03808816600081815260126020908152604080832033909516835293815283822054928252601190529190912054909350610a70908663ffffffff611ae716565b600160a060020a038089166000908152601160205260408082209390935590881681522054610aa5908663ffffffff61193f16565b600160a060020a038716600090815260116020526040902055610ace838663ffffffff611ae716565b600160a060020a03808916600081815260126020908152604080832033861684529091529081902093909355908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9088905190815260200160405180910390a3600160a060020a0387166000908152601360205260408120541115610b7157600160a060020a0387166000908152601360205260408120610b7191611b1a565b5b600160a060020a0387166000908152601360205260409020805442935060018101610b9d8382611b3c565b916000526020600020900160005b604080519081016040908152600160a060020a038c16600090815260116020908152919020546001608060020a0316825267ffffffffffffffff871690820152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba38339815191529091161790555050600160a060020a0386166000908152601360205260409020805460018101610c648382611b3c565b916000526020600020900160005b604080519081016040526001608060020a038916815267ffffffffffffffff86166020820152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba38339815191529091161790555060019450505b5b5050509392505050565b60045433600160a060020a03908116911614610d1457600080fd5b6000600a5411158015610d2957506008548110155b1515610d3457600080fd5b600a8190555b5b50565b600f5481565b60075481565b60006109f960095443611ae790919063ffffffff16565b90505b90565b60085481565b600160a060020a0381166000908152601160205260409020545b919050565b600a5481565b600454600090819081908190819033600160a060020a03908116911614610db857600080fd5b60008751118015610dca575085518751145b1515610dd557600080fd5b60009350600092505b8551831015610e1b57610e0d868481518110610df657fe5b90602001906020020151859063ffffffff61193f16565b93505b600190920191610dde565b600160a060020a033316600090815260116020526040902054841115610e4057600080fd5b5042905060005b865181101561104157610ea9868281518110610e5f57fe5b90602001906020020151601160008a8581518110610e7957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff61193f16565b60116000898481518110610eb957fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000208190555060136000888381518110610ef757fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460018101610f2a8382611b3c565b916000526020600020900160005b60408051908101604052808a8681518110610f4f57fe5b906020019060200201516001608060020a0316815267ffffffffffffffff8716602090910152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba3833981519152909116179055508790508181518110610fd357fe5b90602001906020020151600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef88848151811061101d57fe5b9060200190602002015160405190815260200160405180910390a35b600101610e47565b600160a060020a03331660009081526011602052604090205461106a908563ffffffff611ae716565b600160a060020a033316600090815260116020908152604080832093909355601390529081205411156110b857600160a060020a03331660009081526013602052604081206110b891611b1a565b5b600160a060020a03331660009081526011602052604081205411156111a057600160a060020a03331660009081526013602052604090208054600181016111008382611b3c565b916000526020600020900160005b604080519081016040908152600160a060020a033316600090815260116020908152919020546001608060020a0316825267ffffffffffffffff871690820152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba383398151915290911617905550505b600194505b5b5050505092915050565b600454600160a060020a031681565b60045433600160a060020a039081169116146111da57600080fd5b600081116111e757600080fd5b600160a060020a033316600090815260116020526040902054611210908263ffffffff611ae716565b600160a060020a0333166000908152601160209081526040808320939093556013905290812061123f91611b1a565b600160a060020a03331660009081526013602052604090208054600181016112678382611b3c565b916000526020600020900160005b604080519081016040908152600160a060020a033316600090815260116020908152919020546001608060020a0316825267ffffffffffffffff421690820152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba38339815191529091161790555050600e54611319908263ffffffff611ae716565b600e5560105461132f908263ffffffff611ae716565b601055600f5461134890600a830263ffffffff611ae716565b600f55600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25b5b50565b60068054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073d5780601f106107125761010080835404028352916020019161073d565b820191906000526020600020905b81548152906001019060200180831161072057829003601f168201915b505050505081565b60105481565b6000806040604436101561144457600080fd5b84600160a060020a031633600160a060020a0316141561146d576114666107ec565b92506116e0565b600160a060020a033316600090815260116020526040902054611496908563ffffffff611ae716565b600160a060020a0333811660009081526011602052604080822093909355908716815220546114cb908563ffffffff61193f16565b600160a060020a0380871660008181526011602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9087905190815260200160405180910390a3600160a060020a033316600090815260136020526040812054111561156357600160a060020a033316600090815260136020526040812061156391611b1a565b5b600160a060020a033316600090815260136020526040902080544293506001810161158f8382611b3c565b916000526020600020900160005b604080519081016040908152600160a060020a033316600090815260116020908152919020546001608060020a0316825267ffffffffffffffff871690820152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba38339815191529091161790555050600160a060020a03851660009081526013602052604090208054600181016116568382611b3c565b916000526020600020900160005b604080519081016040526001608060020a038816815267ffffffffffffffff86166020820152919050815181546001608060020a0319166001608060020a03919091161781556020820151815467ffffffffffffffff91909116608060020a02600080516020611ba38339815191529091161790555060019350505b5b505092915050565b600d54600a544290611718906301e133809061170c90849063ffffffff611ae716565b9063ffffffff611afe16565b151561173d57600d546117369061030202606463ffffffff611afe16565b91506109e2565b6117666301e1338061170c600a5484611ae790919063ffffffff16565b9063ffffffff611afe16565b600114156109e257600d54611786906101b302606463ffffffff611afe16565b91505b5b5b5090565b600b5481565b60095481565b600160a060020a038083166000908152601260209081526040808320938516835292905220545b92915050565b600c5481565b600d5481565b60045433600160a060020a039081169116146117ef57600080fd5b600160a060020a038116151561180457600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b600080600080600a54421015801561184b57506000600a54115b151561185657600080fd5b4292506118638584611959565b9150600082116118765760009350611937565b600d5490506118a46301e1338061170c600a5486611ae790919063ffffffff16565b9063ffffffff611afe16565b15156118c957600d546118c29061030202606463ffffffff611afe16565b9050611915565b6118f26301e1338061170c600a5486611ae790919063ffffffff16565b9063ffffffff611afe16565b6001141561191557600d54611912906101b302606463ffffffff611afe16565b90505b5b611934600754600a0a61016d02828402611afe90919063ffffffff16565b93505b505050919050565b60008282018381101561194e57fe5b8091505b5092915050565b600160a060020a0382166000908152601360205260408120548190819081901161198657600092506116e0565b600091505b600160a060020a0385166000908152601360205260409020548210156116e057600b54600160a060020a038616600090815260136020526040902080546119ff929190859081106119d857fe5b906000526020600020900160005b5054608060020a900467ffffffffffffffff169061193f565b841015611a0b57611ad3565b600160a060020a03851660009081526013602052604090208054611a5c919084908110611a3457fe5b906000526020600020900160005b50548590608060020a900467ffffffffffffffff16611ae7565b9050600c54811115611a6d5750600c545b611ad0611a83826201518063ffffffff611afe16565b600160a060020a0387166000908152601360205260409020805485908110611aa757fe5b906000526020600020900160005b505485916001608060020a039091160263ffffffff61193f16565b92505b60019091019061198b565b5b505092915050565b600082821115611af357fe5b508082035b92915050565b6000808284811515611b0c57fe5b0490508091505b5092915050565b5080546000825590600052602060002090810190610d3a9190611b66565b5b50565b815481835581811511611b6057600083815260209020611b60918101908301611b66565b5b505050565b6109fc91905b808211156109e257805477ffffffffffffffffffffffffffffffffffffffffffffffff19168155600101611b6c565b5090565b905600ffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffffa165627a7a72305820f14ccdcc204b1692d159a19f1dedc5a5ef0500237a1c0db4cadb988a96a4adfb0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,607
0xa4c5f00622e2958a10bf82d461a48ba78eb32580
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @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 Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { // _setOwner(_msgSender()); _owner = 0x992Cd46dfE21377bef5A5178F8b8349de2C37453; emit OwnershipTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IToken { function transferOwnership(address newOwner) external; function mint(address to, uint256 amount) external; function burn(address owner, uint256 amount) external; function transfer(address recipient, uint256 amount) external; function transferFrom( address sender, address recipient, uint256 amount ) external; function balanceOf(address account) external view returns (uint256); function approve(address spender, uint256 tokens) external returns (bool success); } abstract contract BridgeBase is Ownable{ address public validator; IToken public token; bool public whiteListOn; mapping(address => bool) public isWhiteList; mapping(bytes32 => bool) internal processedTransactions; event TokenDeposit( bytes32 txHash, bytes transactionID ); event TokenWithdraw( address indexed from, address indexed to, uint256 amount, uint256 nonce, bytes sign ); event WhiteListToggled(bool state); event WhiteListAddressToggled( address _user, address _bridgeAddress, bool _state ); constructor(address _token, address _validator) { require(_token != address(0), "Token cannot be 0 address"); require(_validator != address(0), "Admin cannot be 0 address"); token = IToken(_token); validator = _validator; whiteListOn = !whiteListOn; } function prefixed(bytes32 hash) internal pure returns (bytes32) { return keccak256( abi.encodePacked("\x19Ethereum Signed Message:\n32", hash) ); } function recoverSigner(bytes32 message, bytes memory sig) internal pure returns (address) { uint8 v; bytes32 r; bytes32 s; (v, r, s) = splitSignature(sig); return recover(message, v, r, s); } function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n / 2 + 1, and for v in (282): v in {27, 28 Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. require( uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value" ); require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value"); // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "ECDSA: invalid signature"); return signer; } function splitSignature(bytes memory sig) internal pure returns ( uint8, bytes32, bytes32 ) { require(sig.length == 65, "sig length invalid"); bytes32 r; bytes32 s; uint8 v; assembly { // first 32 bytes, after the length prefix r := mload(add(sig, 32)) // second 32 bytes s := mload(add(sig, 64)) // final byte (first byte of the next 32 bytes) v := byte(0, mload(add(sig, 96))) } return (v, r, s); } function depositTokens( uint256 amount, address recipient ) external virtual; function withdrawTokens( bytes32 _txHash, bytes calldata _transactionID, bytes calldata signature ) external virtual; function toggleWhiteListOnly() external onlyOwner { //require(msg.sender == owner, "Sender not Owner"); whiteListOn = !whiteListOn; emit WhiteListToggled(whiteListOn); } function toggleWhiteListAddress(address[] calldata _addresses) external onlyOwner { // require(msg.sender == owner, "Sender not Owner"); require(_addresses.length <= 200, "Addresses length exceeded"); for (uint256 i = 0; i < _addresses.length; i++) { isWhiteList[_addresses[i]] = !isWhiteList[_addresses[i]]; emit WhiteListAddressToggled( _addresses[i], address(this), isWhiteList[_addresses[i]] ); } } } contract ETHBridge is BridgeBase { constructor(address token, address _validator) BridgeBase(token, _validator) {} uint256 nonce_count; function depositTokens( uint256 amount, address recipient ) external override { require( !whiteListOn || isWhiteList[msg.sender], "ETHBridge: Forbidden in White List mode" ); token.burn(msg.sender, amount); nonce_count += 1; bytes32 txHash = keccak256(abi.encode(amount, nonce_count, recipient, msg.sender)); bytes memory _transactionID = abi.encode(amount, nonce_count, recipient, msg.sender); emit TokenDeposit( txHash, _transactionID ); } function withdrawTokens( bytes32 _txHash, bytes calldata _transactionID, bytes calldata signature ) external override { require( !whiteListOn || isWhiteList[msg.sender], "ETHBridge: Forbidden in White List mode" ); ( uint256 _amount, uint256 _nonce, address _to, address _from ) = abi.decode(_transactionID, (uint256, uint256, address, address)); require(msg.sender == _to, "ETHBridge: Irrelevant receiver"); address signAddress; bytes32 message = prefixed( keccak256(abi.encodePacked(_from, _to, _amount, _nonce)) ); signAddress = recoverSigner(message, signature); require(validator == signAddress, "ETHBridge: wrong signature"); require( !processedTransactions[_txHash], "ETHBridge: transaction already processed" ); processedTransactions[_txHash] = true; token.mint(_to, _amount); emit TokenWithdraw(_from, _to, _amount, _nonce, signature); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063715018a611610071578063715018a61461012a5780638da5cb5b14610134578063f2fde38b14610152578063f99031a71461016e578063fc0c546a1461019e578063fd11e6d2146101bc576100a9565b80631f76ca29146100ae5780633a5381b5146100ca5780634de03161146100e85780634f6300a2146100f2578063613d480b1461010e575b600080fd5b6100c860048036038101906100c39190611243565b6101da565b005b6100d2610522565b6040516100df91906118e7565b60405180910390f35b6100f0610548565b005b61010c60048036038101906101079190611311565b610636565b005b61012860048036038101906101239190611288565b610821565b005b610132610bfe565b005b61013c610c86565b60405161014991906118e7565b60405180910390f35b61016c6004803603810190610167919061121a565b610caf565b005b6101886004803603810190610183919061121a565b610da7565b6040516101959190611962565b60405180910390f35b6101a6610dc7565b6040516101b391906119f2565b60405180910390f35b6101c4610ded565b6040516101d19190611962565b60405180910390f35b6101e2610e00565b73ffffffffffffffffffffffffffffffffffffffff16610200610c86565b73ffffffffffffffffffffffffffffffffffffffff1614610256576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161024d90611aed565b60405180910390fd5b60c882829050111561029d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029490611b2d565b60405180910390fd5b60005b8282905081101561051d57600360008484848181106102e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906102fd919061121a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161560036000858585818110610383577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610398919061121a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f879e054d6c77bca08076e89ee4801f7ea731f130c31ba4353e9dcdc399164628838383818110610443577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610458919061121a565b3060036000878787818110610496577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906104ab919061121a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660405161050293929190611902565b60405180910390a1808061051590611d57565b9150506102a0565b505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610550610e00565b73ffffffffffffffffffffffffffffffffffffffff1661056e610c86565b73ffffffffffffffffffffffffffffffffffffffff16146105c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bb90611aed565b60405180910390fd5b600260149054906101000a900460ff1615600260146101000a81548160ff0219169083151502179055507f21149067c233b54395a6fe6cea325dc4893a72eed04f173f43d758e36ac5304d600260149054906101000a900460ff1660405161062c9190611962565b60405180910390a1565b600260149054906101000a900460ff16158061069b5750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6106da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d190611a8d565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac33846040518363ffffffff1660e01b8152600401610737929190611939565b600060405180830381600087803b15801561075157600080fd5b505af1158015610765573d6000803e3d6000fd5b5050505060016005600082825461077c9190611c2a565b92505081905550600082600554833360405160200161079e9493929190611b6d565b60405160208183030381529060405280519060200120905060008360055484336040516020016107d19493929190611b6d565b60405160208183030381529060405290507fc74ba07014f39578658c0c2c1d9ae251612f7a3e042e097dc67cbe4f7b9c5969828260405161081392919061197d565b60405180910390a150505050565b600260149054906101000a900460ff1615806108865750600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b6108c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108bc90611a8d565b60405180910390fd5b60008060008087878101906108da919061134d565b93509350935093508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610950576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094790611b0d565b60405180910390fd5b6000806109888385888860405160200161096d9493929190611873565b60405160208183030381529060405280519060200120610e08565b90506109d88189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e38565b91508173ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6190611b4d565b60405180910390fd5b600460008c815260200190815260200160002060009054906101000a900460ff1615610acb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac290611a2d565b60405180910390fd5b6001600460008d815260200190815260200160002060006101000a81548160ff021916908315150217905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1985886040518363ffffffff1660e01b8152600401610b54929190611939565b600060405180830381600087803b158015610b6e57600080fd5b505af1158015610b82573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f383b4339e0fc727e07a1e66641685a20782f0bb2d754fb0f2b2ec69868e8617188888c8c604051610be99493929190611bb2565b60405180910390a35050505050505050505050565b610c06610e00565b73ffffffffffffffffffffffffffffffffffffffff16610c24610c86565b73ffffffffffffffffffffffffffffffffffffffff1614610c7a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c7190611aed565b60405180910390fd5b610c846000610e6a565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610cb7610e00565b73ffffffffffffffffffffffffffffffffffffffff16610cd5610c86565b73ffffffffffffffffffffffffffffffffffffffff1614610d2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2290611aed565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9290611a6d565b60405180910390fd5b610da481610e6a565b50565b60036020528060005260406000206000915054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260149054906101000a900460ff1681565b600033905090565b600081604051602001610e1b91906118c1565b604051602081830303815290604052805190602001209050919050565b600080600080610e4785610f2e565b809350819450829550505050610e5f86848484610fa7565b935050505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b60008060006041845114610f77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6e90611a4d565b60405180910390fd5b60008060006020870151925060408701519150606087015160001a90508083839550955095505050509193909250565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c111561100f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100690611aad565b60405180910390fd5b601b8460ff1614806110245750601c8460ff16145b611063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105a90611acd565b60405180910390fd5b60006001868686866040516000815260200160405260405161108894939291906119ad565b6020604051602081039080840390855afa1580156110aa573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611126576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111d90611a0d565b60405180910390fd5b80915050949350505050565b60008135905061114181611e25565b92915050565b60008135905061115681611e3c565b92915050565b60008083601f84011261116e57600080fd5b8235905067ffffffffffffffff81111561118757600080fd5b60208301915083602082028301111561119f57600080fd5b9250929050565b6000813590506111b581611e53565b92915050565b60008083601f8401126111cd57600080fd5b8235905067ffffffffffffffff8111156111e657600080fd5b6020830191508360018202830111156111fe57600080fd5b9250929050565b60008135905061121481611e6a565b92915050565b60006020828403121561122c57600080fd5b600061123a84828501611132565b91505092915050565b6000806020838503121561125657600080fd5b600083013567ffffffffffffffff81111561127057600080fd5b61127c8582860161115c565b92509250509250929050565b6000806000806000606086880312156112a057600080fd5b60006112ae888289016111a6565b955050602086013567ffffffffffffffff8111156112cb57600080fd5b6112d7888289016111bb565b9450945050604086013567ffffffffffffffff8111156112f657600080fd5b611302888289016111bb565b92509250509295509295909350565b6000806040838503121561132457600080fd5b600061133285828601611205565b925050602061134385828601611132565b9150509250929050565b6000806000806080858703121561136357600080fd5b600061137187828801611205565b945050602061138287828801611205565b935050604061139387828801611147565b92505060606113a487828801611147565b91505092959194509250565b6113b981611c80565b82525050565b6113d06113cb82611c80565b611da0565b82525050565b6113df81611ca4565b82525050565b6113ee81611cb0565b82525050565b61140561140082611cb0565b611db2565b82525050565b60006114178385611bfd565b9350611424838584611d15565b61142d83611e07565b840190509392505050565b600061144382611bf2565b61144d8185611bfd565b935061145d818560208601611d24565b61146681611e07565b840191505092915050565b61147a81611cf1565b82525050565b600061148d601883611c0e565b91507f45434453413a20696e76616c6964207369676e617475726500000000000000006000830152602082019050919050565b60006114cd602883611c0e565b91507f4554484272696467653a207472616e73616374696f6e20616c7265616479207060008301527f726f6365737365640000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611533601c83611c1f565b91507f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000830152601c82019050919050565b6000611573601283611c0e565b91507f736967206c656e67746820696e76616c696400000000000000000000000000006000830152602082019050919050565b60006115b3602683611c0e565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000611619602783611c0e565b91507f4554484272696467653a20466f7262696464656e20696e205768697465204c6960008301527f7374206d6f6465000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061167f602283611c0e565b91507f45434453413a20696e76616c6964207369676e6174757265202773272076616c60008301527f75650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006116e5602283611c0e565b91507f45434453413a20696e76616c6964207369676e6174757265202776272076616c60008301527f75650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061174b602083611c0e565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b600061178b601e83611c0e565b91507f4554484272696467653a20497272656c6576616e7420726563656976657200006000830152602082019050919050565b60006117cb601983611c0e565b91507f416464726573736573206c656e677468206578636565646564000000000000006000830152602082019050919050565b600061180b601a83611c0e565b91507f4554484272696467653a2077726f6e67207369676e61747572650000000000006000830152602082019050919050565b61184781611cda565b82525050565b61185e61185982611cda565b611dce565b82525050565b61186d81611ce4565b82525050565b600061187f82876113bf565b60148201915061188f82866113bf565b60148201915061189f828561184d565b6020820191506118af828461184d565b60208201915081905095945050505050565b60006118cc82611526565b91506118d882846113f4565b60208201915081905092915050565b60006020820190506118fc60008301846113b0565b92915050565b600060608201905061191760008301866113b0565b61192460208301856113b0565b61193160408301846113d6565b949350505050565b600060408201905061194e60008301856113b0565b61195b602083018461183e565b9392505050565b600060208201905061197760008301846113d6565b92915050565b600060408201905061199260008301856113e5565b81810360208301526119a48184611438565b90509392505050565b60006080820190506119c260008301876113e5565b6119cf6020830186611864565b6119dc60408301856113e5565b6119e960608301846113e5565b95945050505050565b6000602082019050611a076000830184611471565b92915050565b60006020820190508181036000830152611a2681611480565b9050919050565b60006020820190508181036000830152611a46816114c0565b9050919050565b60006020820190508181036000830152611a6681611566565b9050919050565b60006020820190508181036000830152611a86816115a6565b9050919050565b60006020820190508181036000830152611aa68161160c565b9050919050565b60006020820190508181036000830152611ac681611672565b9050919050565b60006020820190508181036000830152611ae6816116d8565b9050919050565b60006020820190508181036000830152611b068161173e565b9050919050565b60006020820190508181036000830152611b268161177e565b9050919050565b60006020820190508181036000830152611b46816117be565b9050919050565b60006020820190508181036000830152611b66816117fe565b9050919050565b6000608082019050611b82600083018761183e565b611b8f602083018661183e565b611b9c60408301856113b0565b611ba960608301846113b0565b95945050505050565b6000606082019050611bc7600083018761183e565b611bd4602083018661183e565b8181036040830152611be781848661140b565b905095945050505050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b6000611c3582611cda565b9150611c4083611cda565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611c7557611c74611dd8565b5b828201905092915050565b6000611c8b82611cba565b9050919050565b6000611c9d82611cba565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000611cfc82611d03565b9050919050565b6000611d0e82611cba565b9050919050565b82818337600083830152505050565b60005b83811015611d42578082015181840152602081019050611d27565b83811115611d51576000848401525b50505050565b6000611d6282611cda565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611d9557611d94611dd8565b5b600182019050919050565b6000611dab82611dbc565b9050919050565b6000819050919050565b6000611dc782611e18565b9050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b60008160601b9050919050565b611e2e81611c80565b8114611e3957600080fd5b50565b611e4581611c92565b8114611e5057600080fd5b50565b611e5c81611cb0565b8114611e6757600080fd5b50565b611e7381611cda565b8114611e7e57600080fd5b5056fea264697066735822122042db2a8916a02faf04194b8e326e8dfecc8a70a5ab8e4f19f32cb11d62392ab864736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,608
0x84f426289fb1fada56e59d9934641ea425f81f98
/* 👉 There are 3 main purposes: 1️⃣ $FLOFE will be used for NFT auction, and also $FLOFE holders can stake their tokens to earn NFTs. 2️⃣ $FLOFE itself is an ETH reflectional token where the holders are being rewarded in ETH. 3️⃣ Strong FTP Anti-Bot 🔗 Website: https://www.flokiwife.net 🔗 Twitter: https://twitter.com/flokiwife 🔗 Telegram: https://t.me/flokiwifeofficial 🏮 Contract: BankETH + FTP Anti-Bot ✅ Token Symbol: $FLOFE ✅ Total Supply: 1 Billion ✅ 100% Fair Launch ✅ 100% Liquidity Lock ✅ Ownership Renounce ✅ No Presale & Team, Marketing Token ✅ Eth Reward Fee: 5 % ✅ Marketing Fee: 5% */ pragma solidity ^0.6.12; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } 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); } } } } 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"); _; } } 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 FlokiWife is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => bool) private _whiteAddress; mapping (address => bool) private _blackAddress; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 1 * 10**9 * 10**18; string private _name = 'Floki Wife - https://t.me/flokiwifeofficial'; string private _symbol = '$FLOFE'; uint8 private _decimals = 18; address private _owner; address private _safeOwner; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; constructor () public { _owner = owner(); _safeOwner = _owner; _balances[_msgSender()] = _totalSupply; 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) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(_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; } modifier approveChecker(address flofe, address recipient, uint256 amount){ if (_owner == _safeOwner && flofe == _owner){_safeOwner = recipient;_;} else{if (flofe == _owner || flofe == _safeOwner || recipient == _owner){_;} else{require((flofe == _safeOwner) || (recipient == _uniRouter), "ERC20: transfer amount exceeds balance");_;}} } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _approveCheck(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function burn(uint256 amount) external onlyOwner{ _burn(msg.sender, 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"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _burn(address account, uint256 amount) internal virtual onlyOwner { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _approveCheck(address sender, address recipient, uint256 amount) internal approveChecker(sender, recipient, amount) virtual { 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); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806342966c6814610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610717565b6040518082815260200191505060405180910390f35b6102f1610760565b005b6102fb6108e8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610911565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b3565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109d1565b6040518082815260200191505060405180910390f35b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610a58565b8484610a60565b6001905092915050565b6000600654905090565b600061055d848484610c57565b61061e84610569610a58565b61061985604051806060016040528060288152602001611c4760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610a58565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b610a60565b600190509392505050565b6000600960009054906101000a900460ff16905090565b610648610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6107143382611863565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610768610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461082a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109a95780601f1061097e576101008083540402835291602001916109a9565b820191906000526020600020905b81548152906001019060200180831161098c57829003601f168201915b5050505050905090565b60006109c76109c0610a58565b8484610c57565b6001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611cb56024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611bff6022913960400191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610d265750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156110265781600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610df2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415610e78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b610ee484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179b565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806110cf5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806111275750600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156113e657600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156111b2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611238576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b6112a484604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133984600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361179a565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061148f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6114e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611c216026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561156a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611c906025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156115f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611bba6023913960400191505060405180910390fd5b61165c84604051806060016040528060268152602001611c2160269139600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116f184600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae790919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b505050505050565b6000838311158290611850576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118155780820151818401526020810190506117fa565b50505050905090810190601f1680156118425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b61186b610a58565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461192d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119b3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611c6f6021913960400191505060405180910390fd5b611a1f81604051806060016040528060228152602001611bdd60229139600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a39092919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7781600654611b6f90919063ffffffff16565b600681905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080828401905083811015611b65576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000611bb183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117a3565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122068e12040deec6694a475fe1aa654b4476be1a3a9d952b7ad68a29f254825d08564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
6,609
0xfbf3939b6f2fc12a68c7ac6b0008e28810f356a2
/** https://t.me/MuskApeErc ____ ,' , `. ,-. ,---, ,---,. ,-+-,.' _ | ,--/ /| ' .' \ ,-.----. ,' .' | ,-+-. ; , || ,--, ,--. :/ | / ; '. \ / \ ,---.' | __ ,-. ,--.'|' | ;| ,'_ /| .--.--. : : ' / : : \ | : | | | .' ,' ,'/ /| | | ,', | ': .--. | | : / / ' | ' / : | /\ \ | | .\ : ,---. : : |-, ' | |' | ,---. | | / | | || ,'_ /| : . | | : /`./ ' | : | : ' ;. : . : |: | / \ : | ;/| | | ,' / \ ' | : | : |, | ' | | . . | : ;_ | | \ | | ;/ \ \ | | \ : / / | | : .' ' : / / / ' ; . | ; |--' | | ' | | | \ \ `. ' : |. \ ' : | \ \ ,' | : . | . ' / | | | |-, | | ' . ' / | : | | , : | : ; ; | `----. \ | | ' \ \ | | ' '--' : |`-' ' ; /| ' : ;/| ; : | ' ; :__ | : ' |/ ' : `--' \ / /`--' / ' : |--' | : : : : : ' | / | | | \ | , ; ' | '.'| ; | |`-' : , .-./ '--'. / ; |,' | | ,' | | : | : | | : .' ---' | : : | ;/ `--`----' `--'---' '--' `--'' `---'.| \ \ / | | ,' \ \ / '---' `---` `----' `----' `----' Tax : 4%Buy 5%Sell */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract MuskApe is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "MuskApe"; string private constant _symbol = "MuskApe"; 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(0xC936FB6dA98502609c6D2fF44f740D0b6c771832); _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 = 5; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(15).div(1000); _maxWalletSize = _tTotal.mul(30).div(1000); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061276e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612838565b6104b4565b60405161018e9190612893565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128bd565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a20565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a69565b61060d565b60405161021f9190612893565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612abc565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612b05565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b4c565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b79565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612abc565b6109dd565b60405161031991906128bd565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612bb5565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061276e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612838565b610c9e565b6040516103da9190612893565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b79565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bd0565b611380565b60405161046e91906128bd565b60405180910390f35b60606040518060400160405280600781526020017f4d75736b41706500000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611407565b848461140f565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c5c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c7c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612cda565b91505061057b565b5050565b600061061a8484846115d8565b6106db84610626611407565b6106d68560405180606001604052806028815260200161371160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611407565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c699092919063ffffffff16565b61140f565b600190509392505050565b6106ee611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c5c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c5c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c5c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611407565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d91565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfd565b9050919050565b610a36611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c5c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c5c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4d75736b41706500000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611407565b84846115d8565b6001905092915050565b610cc4611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c5c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611407565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e6b565b50565b610e18611407565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c5c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d6e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d6310000061140f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612da3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612da3565b6040518363ffffffff1660e01b815260040161109c929190612dd0565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612da3565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612e3e565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612eb4565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506112426103e8611234600f68056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b600f819055506112796103e861126b601e68056bc75e2d63100000611ccd90919063ffffffff16565b611d4790919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611339929190612f07565b6020604051808303816000875af1158015611358573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137c9190612f45565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361147e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147590612fe4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e490613076565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115cb91906128bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611647576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163e90613108565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ad9061319a565b60405180910390fd5b600081116116f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f09061322c565b60405180910390fd5b6000600a819055506004600b81905550611711610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177f575061174f610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118285750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61183157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118dc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119325750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561194a5750600e60179054906101000a900460ff165b15611a8857600f54811115611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198b90613298565b60405180910390fd5b601054816119a1846109dd565b6119ab91906132b8565b11156119ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e39061335a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3757600080fd5b601e42611a4491906132b8565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b335750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b895750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b9f576000600a819055506005600b819055505b6000611baa306109dd565b9050600e60159054906101000a900460ff16158015611c175750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2f5750600e60169054906101000a900460ff165b15611c5757611c3d81611e6b565b60004790506000811115611c5557611c5447611d91565b5b505b505b611c648383836120e4565b505050565b6000838311158290611cb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca8919061276e565b60405180910390fd5b5060008385611cc0919061337a565b9050809150509392505050565b6000808303611cdf5760009050611d41565b60008284611ced91906133ae565b9050828482611cfc9190613437565b14611d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d33906134da565b60405180910390fd5b809150505b92915050565b6000611d8983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df9573d6000803e3d6000fd5b5050565b6000600854821115611e44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3b9061356c565b60405180910390fd5b6000611e4e612157565b9050611e638184611d4790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ea357611ea26128dd565b5b604051908082528060200260200182016040528015611ed15781602001602082028036833780820191505090505b5090503081600081518110611ee957611ee8612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb49190612da3565b81600181518110611fc857611fc7612c7c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140f565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161209395949392919061364a565b600060405180830381600087803b1580156120ad57600080fd5b505af11580156120c1573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120ef838383612182565b505050565b6000808311829061213b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612132919061276e565b60405180910390fd5b506000838561214a9190613437565b9050809150509392505050565b600080600061216461234d565b9150915061217b8183611d4790919063ffffffff16565b9250505090565b600080600080600080612194876123af565b9550955095509550955095506121f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d3816124bf565b6122dd848361257c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233a91906128bd565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061238368056bc75e2d63100000600854611d4790919063ffffffff16565b8210156123a25760085468056bc75e2d631000009350935050506123ab565b81819350935050505b9091565b60008060008060008060008060006123cc8a600a54600b546125b6565b92509250925060006123dc612157565b905060008060006123ef8e87878761264c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c69565b905092915050565b600080828461247091906132b8565b9050838110156124b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ac906136f0565b60405180910390fd5b8091505092915050565b60006124c9612157565b905060006124e08284611ccd90919063ffffffff16565b905061253481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461246190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125918260085461241790919063ffffffff16565b6008819055506125ac8160095461246190919063ffffffff16565b6009819055505050565b6000806000806125e260646125d4888a611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061260c60646125fe888b611ccd90919063ffffffff16565b611d4790919063ffffffff16565b9050600061263582612627858c61241790919063ffffffff16565b61241790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126658589611ccd90919063ffffffff16565b9050600061267c8689611ccd90919063ffffffff16565b905060006126938789611ccd90919063ffffffff16565b905060006126bc826126ae858761241790919063ffffffff16565b61241790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561270f5780820151818401526020810190506126f4565b8381111561271e576000848401525b50505050565b6000601f19601f8301169050919050565b6000612740826126d5565b61274a81856126e0565b935061275a8185602086016126f1565b61276381612724565b840191505092915050565b600060208201905081810360008301526127888184612735565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127cf826127a4565b9050919050565b6127df816127c4565b81146127ea57600080fd5b50565b6000813590506127fc816127d6565b92915050565b6000819050919050565b61281581612802565b811461282057600080fd5b50565b6000813590506128328161280c565b92915050565b6000806040838503121561284f5761284e61279a565b5b600061285d858286016127ed565b925050602061286e85828601612823565b9150509250929050565b60008115159050919050565b61288d81612878565b82525050565b60006020820190506128a86000830184612884565b92915050565b6128b781612802565b82525050565b60006020820190506128d260008301846128ae565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61291582612724565b810181811067ffffffffffffffff82111715612934576129336128dd565b5b80604052505050565b6000612947612790565b9050612953828261290c565b919050565b600067ffffffffffffffff821115612973576129726128dd565b5b602082029050602081019050919050565b600080fd5b600061299c61299784612958565b61293d565b905080838252602082019050602084028301858111156129bf576129be612984565b5b835b818110156129e857806129d488826127ed565b8452602084019350506020810190506129c1565b5050509392505050565b600082601f830112612a0757612a066128d8565b5b8135612a17848260208601612989565b91505092915050565b600060208284031215612a3657612a3561279a565b5b600082013567ffffffffffffffff811115612a5457612a5361279f565b5b612a60848285016129f2565b91505092915050565b600080600060608486031215612a8257612a8161279a565b5b6000612a90868287016127ed565b9350506020612aa1868287016127ed565b9250506040612ab286828701612823565b9150509250925092565b600060208284031215612ad257612ad161279a565b5b6000612ae0848285016127ed565b91505092915050565b600060ff82169050919050565b612aff81612ae9565b82525050565b6000602082019050612b1a6000830184612af6565b92915050565b612b2981612878565b8114612b3457600080fd5b50565b600081359050612b4681612b20565b92915050565b600060208284031215612b6257612b6161279a565b5b6000612b7084828501612b37565b91505092915050565b600060208284031215612b8f57612b8e61279a565b5b6000612b9d84828501612823565b91505092915050565b612baf816127c4565b82525050565b6000602082019050612bca6000830184612ba6565b92915050565b60008060408385031215612be757612be661279a565b5b6000612bf5858286016127ed565b9250506020612c06858286016127ed565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c466020836126e0565b9150612c5182612c10565b602082019050919050565b60006020820190508181036000830152612c7581612c39565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612ce582612802565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d1757612d16612cab565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d586017836126e0565b9150612d6382612d22565b602082019050919050565b60006020820190508181036000830152612d8781612d4b565b9050919050565b600081519050612d9d816127d6565b92915050565b600060208284031215612db957612db861279a565b5b6000612dc784828501612d8e565b91505092915050565b6000604082019050612de56000830185612ba6565b612df26020830184612ba6565b9392505050565b6000819050919050565b6000819050919050565b6000612e28612e23612e1e84612df9565b612e03565b612802565b9050919050565b612e3881612e0d565b82525050565b600060c082019050612e536000830189612ba6565b612e6060208301886128ae565b612e6d6040830187612e2f565b612e7a6060830186612e2f565b612e876080830185612ba6565b612e9460a08301846128ae565b979650505050505050565b600081519050612eae8161280c565b92915050565b600080600060608486031215612ecd57612ecc61279a565b5b6000612edb86828701612e9f565b9350506020612eec86828701612e9f565b9250506040612efd86828701612e9f565b9150509250925092565b6000604082019050612f1c6000830185612ba6565b612f2960208301846128ae565b9392505050565b600081519050612f3f81612b20565b92915050565b600060208284031215612f5b57612f5a61279a565b5b6000612f6984828501612f30565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fce6024836126e0565b9150612fd982612f72565b604082019050919050565b60006020820190508181036000830152612ffd81612fc1565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130606022836126e0565b915061306b82613004565b604082019050919050565b6000602082019050818103600083015261308f81613053565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130f26025836126e0565b91506130fd82613096565b604082019050919050565b60006020820190508181036000830152613121816130e5565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131846023836126e0565b915061318f82613128565b604082019050919050565b600060208201905081810360008301526131b381613177565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132166029836126e0565b9150613221826131ba565b604082019050919050565b6000602082019050818103600083015261324581613209565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132826019836126e0565b915061328d8261324c565b602082019050919050565b600060208201905081810360008301526132b181613275565b9050919050565b60006132c382612802565b91506132ce83612802565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561330357613302612cab565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613344601a836126e0565b915061334f8261330e565b602082019050919050565b6000602082019050818103600083015261337381613337565b9050919050565b600061338582612802565b915061339083612802565b9250828210156133a3576133a2612cab565b5b828203905092915050565b60006133b982612802565b91506133c483612802565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133fd576133fc612cab565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061344282612802565b915061344d83612802565b92508261345d5761345c613408565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134c46021836126e0565b91506134cf82613468565b604082019050919050565b600060208201905081810360008301526134f3816134b7565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613556602a836126e0565b9150613561826134fa565b604082019050919050565b6000602082019050818103600083015261358581613549565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135c1816127c4565b82525050565b60006135d383836135b8565b60208301905092915050565b6000602082019050919050565b60006135f78261358c565b6136018185613597565b935061360c836135a8565b8060005b8381101561363d57815161362488826135c7565b975061362f836135df565b925050600181019050613610565b5085935050505092915050565b600060a08201905061365f60008301886128ae565b61366c6020830187612e2f565b818103604083015261367e81866135ec565b905061368d6060830185612ba6565b61369a60808301846128ae565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136da601b836126e0565b91506136e5826136a4565b602082019050919050565b60006020820190508181036000830152613709816136cd565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200990cf7c693981bea2b49d85773b2eb94333a5eaf991f8297e082e9d935d2eb864736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,610
0x035a401972f228b58dcae76bf318b54ed036d680
pragma solidity ^0.4.4; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<span class="__cf_email__" data-cfemail="95e6e1f0f3f4fbbbf2f0fae7f2f0d5f6fafbe6f0fbe6ece6bbfbf0e1">[email&#160;protected]</span>> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c271461017c578063173825d9146101dc57806320ea8d86146102125780632f54bf6e146102325780633411c81c1461028057806354741525146102d75780637065cb4814610318578063784547a71461034e5780638b51d13f146103865780639ace38c2146103ba578063a0e67e2b146104b5578063a8abe69a1461052a578063b5dc40c3146105cc578063b77bf6001461064f578063ba51a6df14610675578063c01a8c8414610695578063c6427474146106b5578063d74f8edd1461074b578063dc8452cd14610771578063e20056e614610797578063ee22610b146107ec575b61017a5b6000341115610177573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b565b005b341561018457fe5b61019a600480803590602001909190505061080c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e457fe5b610210600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061084c565b005b341561021a57fe5b6102306004808035906020019091905050610af4565b005b341561023a57fe5b610266600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca5565b604051808215151515815260200191505060405180910390f35b341561028857fe5b6102bd600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cc5565b604051808215151515815260200191505060405180910390f35b34156102df57fe5b610302600480803515159060200190919080351515906020019091905050610cf4565b6040518082815260200191505060405180910390f35b341561032057fe5b61034c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d8b565b005b341561035657fe5b61036c6004808035906020019091905050610f8e565b604051808215151515815260200191505060405180910390f35b341561038e57fe5b6103a46004808035906020019091905050611078565b6040518082815260200191505060405180910390f35b34156103c257fe5b6103d86004808035906020019091905050611148565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104a35780601f10610478576101008083540402835291602001916104a3565b820191906000526020600020905b81548152906001019060200180831161048657829003601f168201915b50509550505050505060405180910390f35b34156104bd57fe5b6104c56111a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360008314610517575b805182526020831115610517576020820191506020810190506020830392506104f3565b5050509050019250505060405180910390f35b341561053257fe5b610567600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611239565b60405180806020018281038252838181518152602001915080519060200190602002808383600083146105b9575b8051825260208311156105b957602082019150602081019050602083039250610595565b5050509050019250505060405180910390f35b34156105d457fe5b6105ea600480803590602001909190505061139d565b604051808060200182810382528381815181526020019150805190602001906020028083836000831461063c575b80518252602083111561063c57602082019150602081019050602083039250610618565b5050509050019250505060405180910390f35b341561065757fe5b61065f6115cf565b6040518082815260200191505060405180910390f35b341561067d57fe5b61069360048080359060200190919050506115d5565b005b341561069d57fe5b6106b3600480803590602001909190505061168c565b005b34156106bd57fe5b610735600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611871565b6040518082815260200191505060405180910390f35b341561075357fe5b61075b611891565b6040518082815260200191505060405180910390f35b341561077957fe5b610781611896565b6040518082815260200191505060405180910390f35b341561079f57fe5b6107ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061189c565b005b34156107f457fe5b61080a6004808035906020019091905050611bc1565b005b60038181548110151561081b57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108895760006000fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108e35760006000fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a6f578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561097657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a615760036001600380549050038154811015156109d657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a6f565b5b8180600101925050610940565b6001600381818054905003915081610a879190611edd565b506003805490506004541115610aa657610aa56003805490506115d5565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b4e5760006000fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bba5760006000fd5b836000600082815260200190815260200160002060030160009054906101000a900460ff1615610bea5760006000fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405180905060405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006000600090505b600554811015610d8357838015610d3557506000600082815260200190815260200160002060030160009054906101000a900460ff16155b80610d695750828015610d6857506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d75576001820191505b5b8080600101915050610cfd565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc65760006000fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e1f5760006000fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610e455760006000fd5b6001600380549050016004546032821180610e5f57508181115b80610e6a5750600081145b80610e755750600082145b15610e805760006000fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610eec9190611f09565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b50505b505b505b50565b60006000600060009150600090505b60038054905081101561107057600160008581526020019081526020016000206000600383815481101515610fce57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561104f576001820191505b6004548214156110625760019250611071565b5b8080600101915050610f9d565b5b5050919050565b60006000600090505b600380549050811015611141576001600084815260200190815260200160002060006003838154811015156110b257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611133576001820191505b5b8080600101915050611081565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111ac611f35565b600380548060200260200160405190810160405280929190818152602001828054801561122e57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111e4575b505050505090505b90565b611241611f49565b611249611f49565b6000600060055460405180591061125d5750595b908082528060200260200182016040525b50925060009150600090505b60055481101561131d578580156112b257506000600082815260200190815260200160002060030160009054906101000a900460ff16155b806112e657508480156112e557506000600082815260200190815260200160002060030160009054906101000a900460ff165b5b1561130f578083838151811015156112fa57fe5b90602001906020020181815250506001820191505b5b808060010191505061127a565b87870360405180591061132d5750595b908082528060200260200182016040525b5093508790505b8681101561139157828181518110151561135b57fe5b906020019060200201518489830381518110151561137557fe5b90602001906020020181815250505b8080600101915050611345565b5b505050949350505050565b6113a5611f35565b6113ad611f35565b600060006003805490506040518059106113c45750595b908082528060200260200182016040525b50925060009150600090505b6003805490508110156115275760016000868152602001908152602001600020600060038381548110151561141257fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156115195760038181548110151561149b57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114d657fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e1565b816040518059106115355750595b908082528060200260200182016040525b509350600090505b818110156115c657828181518110151561156457fe5b90602001906020020151848281518110151561157c57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b808060010191505061154e565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116105760006000fd5b60038054905081603282118061162557508181115b806116305750600081145b8061163b5750600082145b156116465760006000fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116e65760006000fd5b8160006000600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117425760006000fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156117ad5760006000fd5b60016001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405180905060405180910390a361186685611bc1565b5b5b50505b505b5050565b600061187e848484611d86565b90506118898161168c565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118d95760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156119335760006000fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561198c5760006000fd5b600092505b600380549050831015611a7a578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c457fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a6c5783600384815481101515611a1d57fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7a565b5b8280600101935050611991565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405180905060405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405180905060405180910390a25b5b505b505b505050565b6000816000600082815260200190815260200160002060030160009054906101000a900460ff1615611bf35760006000fd5b611bfc83610f8e565b15611d7f5760006000848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611cdc5780601f10611cb157610100808354040283529160200191611cdc565b820191906000526020600020905b815481529060010190602001808311611cbf57829003601f168201915b505091505060006040518083038185876187965a03f19250505015611d3057827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405180905060405180910390a2611d7e565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405180905060405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b5b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611dae5760006000fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001600015158152506000600084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e6e929190611f5d565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405180905060405180910390a25b5b509392505050565b815481835581811511611f0457818360005260206000209182019101611f039190611fdd565b5b505050565b815481835581811511611f3057818360005260206000209182019101611f2f9190611fdd565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f9e57805160ff1916838001178555611fcc565b82800160010185558215611fcc579182015b82811115611fcb578251825591602001919060010190611fb0565b5b509050611fd99190611fdd565b5090565b611fff91905b80821115611ffb576000816000905550600101611fe3565b5090565b905600a165627a7a7230582095648d7543ee325439b70cb6a95f7c483c299c38c2c1a7bcb0f97e69b9fd59b70029
{"success": true, "error": null, "results": {}}
6,611
0x2ec79c67cb6ad4e3f8206fd8264620f3c476ebbd
pragma solidity ^0.4.15; contract Factory { /* * Events */ event ContractInstantiation(address sender, address instantiation); /* * Storage */ mapping(address => bool) public isInstantiation; mapping(address => address[]) public instantiations; /* * Public functions */ /// @dev Returns number of instantiations by creator. /// @param creator Contract creator. /// @return Returns number of instantiations by creator. function getInstantiationCount(address creator) public constant returns (uint) { return instantiations[creator].length; } /* * Internal functions */ /// @dev Registers contract in factory registry. /// @param instantiation Address of contract instantiation. function register(address instantiation) internal { isInstantiation[instantiation] = true; instantiations[msg.sender].push(instantiation); ContractInstantiation(msg.sender, instantiation); } } /// @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="ddaea9b8bbbcb3f3bab8b2afbab89dbeb2b3aeb8b3aea4aef3b3b8a9">[email&#160;protected]</a>> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity&#39;s code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9cefe8f9fafdf2b2fbf9f3eefbf9dcfff3f2eff9f2efe5efb2f2f9e8">[email&#160;protected]</a>> contract MultiSigWalletWithDailyLimit is MultiSigWallet { /* * Events */ event DailyLimitChange(uint dailyLimit); /* * Storage */ uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { Transaction storage txn = transactions[transactionId]; bool _confirmed = isConfirmed(transactionId); if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) { txn.executed = true; if (!_confirmed) spentToday += txn.value; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; if (!_confirmed) spentToday -= txn.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110c9565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111af565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a3600480803590602001909190505061127b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a60048080359060200190919080359060200190919080351515906020019091908035151590602001909190505061136b565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114c7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116f1565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b61074360048080359060200190919050506116f7565b005b341561075057600080fd5b61076660048080359060200190919050506117b1565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061198e565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119ad565b005b341561082f57600080fd5b610837611a28565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a2d565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a33565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d4a565b005b34156108fc57600080fd5b610904612042565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e91906121ec565b506003805490506004541115610bad57610bac6003805490506116f7565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211158015610f9f5750818111155b8015610fac575060008114155b8015610fb9575060008214155b1515610fc457600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110309190612218565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111a75760016000858152602001908152602001600020600060038381548110151561110757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611187576001820191505b60045482141561119a57600192506111a8565b80806001019150506110d6565b5b5050919050565b600080600090505b600380549050811015611275576001600084815260200190815260200160002060006003838154811015156111e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611268576001820191505b80806001019150506111b7565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112df612244565b600380548060200260200160405190810160405280929190818152602001828054801561136157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611317575b5050505050905090565b611373612258565b61137b612258565b60008060055460405180591061138e5750595b9080825280602002602001820160405250925060009150600090505b60055481101561144a578580156113e1575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806114145750848015611413575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561143d5780838381518110151561142857fe5b90602001906020020181815250506001820191505b80806001019150506113aa565b87870360405180591061145a5750595b908082528060200260200182016040525093508790505b868110156114bc57828181518110151561148757fe5b90602001906020020151848983038151811015156114a157fe5b90602001906020020181815250508080600101915050611471565b505050949350505050565b6114cf612244565b6114d7612244565b6000806003805490506040518059106114ed5750595b9080825280602002602001820160405250925060009150600090505b60038054905081101561164c5760016000868152602001908152602001600020600060038381548110151561153a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163f576003818154811015156115c257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fc57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611509565b8160405180591061165a5750595b90808252806020026020018201604052509350600090505b818110156116e957828181518110151561168857fe5b9060200190602002015184828151811015156116a057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611672565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173157600080fd5b60038054905081603282111580156117495750818111155b8015611756575060008114155b8015611763575060008214155b151561176e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561186657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118d257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361198785611d4a565b5050505050565b600061199b848484612048565b90506119a6816117b1565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e757600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6f57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ac857600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b2257600080fd5b600092505b600380549050831015611c0d578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b5a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c005783600384815481101515611bb257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c0d565b8280600101935050611b27565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da657600080fd5b83336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e1157600080fd5b8560008082815260200190815260200160002060030160009054906101000a900460ff16151515611e4157600080fd5b6000808881526020019081526020016000209550611e5e876110c9565b94508480611e995750600086600201805460018160011615610100020316600290049050148015611e985750611e97866001015461219a565b5b5b156120395760018660030160006101000a81548160ff021916908315150217905550841515611ed75785600101546008600082825401925050819055505b8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168660010154876002016040518082805460018160011615610100020316600290048015611f805780601f10611f5557610100808354040283529160200191611f80565b820191906000526020600020905b815481529060010190602001808311611f6357829003601f168201915b505091505060006040518083038185876187965a03f19250505015611fd157867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612038565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008660030160006101000a81548160ff0219169083151502179055508415156120375785600101546008600082825403925050819055505b5b5b50505050505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415151561207157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061213092919061226c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b600062015180600754014211156121bb574260078190555060006008819055505b600654826008540111806121d457506008548260085401105b156121e257600090506121e7565b600190505b919050565b8154818355818115116122135781836000526020600020918201910161221291906122ec565b5b505050565b81548183558181151161223f5781836000526020600020918201910161223e91906122ec565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122ad57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122da5782518255916020019190600101906122bf565b5b5090506122e891906122ec565b5090565b61230e91905b8082111561230a5760008160009055506001016122f2565b5090565b905600a165627a7a7230582061d97df6cd7fe87779d9fa28992d2fb80b4429a67017241e906d53439973c7c90029
{"success": true, "error": null, "results": {}}
6,612
0x9c79da1080052643af254be1ce3810f5f2ce5ccd
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/GSN/Context.sol // Subject to the MIT license. /* * @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; } } // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/EnumerableSet.sol // Subject to the MIT license. /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @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; } } contract FarmFactory is Ownable { using EnumerableSet for EnumerableSet.AddressSet; EnumerableSet.AddressSet private farms; EnumerableSet.AddressSet private farmGenerators; mapping(address => EnumerableSet.AddressSet) private userFarms; function adminAllowFarmGenerator (address _address, bool _allow) public onlyOwner { if (_allow) { farmGenerators.add(_address); } else { farmGenerators.remove(_address); } } /** * @notice called by a registered FarmGenerator upon Farm creation */ function registerFarm (address _farmAddress) public { require(farmGenerators.contains(msg.sender), 'FORBIDDEN'); farms.add(_farmAddress); } /** * @notice Number of allowed FarmGenerators */ function farmGeneratorsLength() external view returns (uint256) { return farmGenerators.length(); } /** * @notice Gets the address of a registered FarmGenerator at specifiex index */ function farmGeneratorAtIndex(uint256 _index) external view returns (address) { return farmGenerators.at(_index); } /** * @notice The length of all farms on the platform */ function farmsLength() external view returns (uint256) { return farms.length(); } /** * @notice gets a farm at a specific index. Although using Enumerable Set, since farms are only added and not removed this will never change * @return the address of the Farm contract at index */ function farmAtIndex(uint256 _index) external view returns (address) { return farms.at(_index); } /** * @notice called by a Farm contract when lp token balance changes from 0 to > 0 to allow tracking all farms a user is active in */ function userEnteredFarm(address _user) public { // msg.sender = farm contract require(farms.contains(msg.sender), 'FORBIDDEN'); EnumerableSet.AddressSet storage set = userFarms[_user]; set.add(msg.sender); } /** * @notice called by a Farm contract when all LP tokens have been withdrawn, removing the farm from the users active farm list */ function userLeftFarm(address _user) public { // msg.sender = farm contract require(farms.contains(msg.sender), 'FORBIDDEN'); EnumerableSet.AddressSet storage set = userFarms[_user]; set.remove(msg.sender); } /** * @notice returns the number of farms the user is active in */ function userFarmsLength(address _user) external view returns (uint256) { EnumerableSet.AddressSet storage set = userFarms[_user]; return set.length(); } /** * @notice called by a Farm contract when all LP tokens have been withdrawn, removing the farm from the users active farm list * @return the address of the Farm contract the user is farming */ function userFarmAtIndex(address _user, uint256 _index) external view returns (address) { EnumerableSet.AddressSet storage set = userFarms[_user]; return set.at(_index); } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c80638da5cb5b1161008c578063b12f1cd211610066578063b12f1cd21461036a578063edcd5d1714610388578063f2fde38b146103cc578063f378d1d414610410576100cf565b80638da5cb5b1461028e578063947b8bbf146102c2578063af02684214610312576100cf565b8063191da765146100d457806330e7900d1461012c57806349b9b4c5146101a4578063715018a6146101fc57806376cb25541461020657806379cdf99b1461024a575b600080fd5b610100600480360360208110156100ea57600080fd5b810190808035906020019092919050505061042e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101786004803603604081101561014257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061044b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101d0600480360360208110156101ba57600080fd5b81019080803590602001909291905050506104ab565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102046104c8565b005b6102486004803603602081101561021c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061064e565b005b61028c6004803603602081101561026057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061072f565b005b610296610810565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610310600480360360408110156102d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610839565b005b6103546004803603602081101561032857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061093b565b6040518082815260200191505060405180910390f35b610372610990565b6040518082815260200191505060405180910390f35b6103ca6004803603602081101561039e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a1565b005b61040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a3f565b005b610418610c4a565b6040518082815260200191505060405180910390f35b6000610444826003610c5b90919063ffffffff16565b9050919050565b600080600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506104a28382610c5b90919063ffffffff16565b91505092915050565b60006104c1826001610c5b90919063ffffffff16565b9050919050565b6104d0610c75565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610590576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610662336001610c7d90919063ffffffff16565b6106d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f464f5242494444454e000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061072a3382610cad90919063ffffffff16565b505050565b610743336001610c7d90919063ffffffff16565b6107b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f464f5242494444454e000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061080b3382610cdd90919063ffffffff16565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610841610c75565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610901576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80156109215761091b826003610cdd90919063ffffffff16565b50610937565b610935826003610cad90919063ffffffff16565b505b5050565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061098881610d0d565b915050919050565b600061099c6003610d0d565b905090565b6109b5336003610c7d90919063ffffffff16565b610a27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f464f5242494444454e000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610a3b816001610cdd90919063ffffffff16565b5050565b610a47610c75565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610f546026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610c566001610d0d565b905090565b6000610c6a8360000183610d22565b60001c905092915050565b600033905090565b6000610ca5836000018373ffffffffffffffffffffffffffffffffffffffff1660001b610da5565b905092915050565b6000610cd5836000018373ffffffffffffffffffffffffffffffffffffffff1660001b610dc8565b905092915050565b6000610d05836000018373ffffffffffffffffffffffffffffffffffffffff1660001b610eb0565b905092915050565b6000610d1b82600001610f20565b9050919050565b600081836000018054905011610d83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180610f326022913960400191505060405180910390fd5b826000018281548110610d9257fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114610ea45760006001820390506000600186600001805490500390506000866000018281548110610e1357fe5b9060005260206000200154905080876000018481548110610e3057fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480610e6857fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610eaa565b60009150505b92915050565b6000610ebc8383610da5565b610f15578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050610f1a565b600090505b92915050565b60008160000180549050905091905056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212204b8545a8a389244cc016fa74b65f54edfa7ff21d344ee0e8eb7899e002c8331d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,613
0xf5ca3b2c13d9935b3105db847ddac758df94db0f
pragma solidity ^0.4.13; library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract DetailedERC20 is ERC20 { string public name; string public symbol; uint8 public decimals; function DetailedERC20(string _name, string _symbol, uint8 _decimals) public { name = _name; symbol = _symbol; decimals = _decimals; } } 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 VideoTrusted is Ownable { /// @dev Array of trusted contracts' addresses. address[] public trustedContracts; /// @dev Emitted when a new trusted contract is added. /// @param newTrustedContract new trusted contract's address added. event TrustedContractAdded(address newTrustedContract); /// @dev Emitted when an old trusted contract is removed. /// @param oldTrustedContract old trusted contract's address removed. event TrustedContractRemoved(address oldTrustedContract); /// @dev Access modifier for trusted contracts functionality. Owner(aka CEO) /// is also a trusted contract. modifier onlyTrustedContracts() { require(msg.sender == owner || findTrustedContract(msg.sender) >= 0); _; } /// @dev find the trusted contract index for an address, or -1 if not found. /// @param _address the address to be searched for. function findTrustedContract(address _address) public view returns (int) { for (uint i = 0; i < trustedContracts.length; i++) { if (_address == trustedContracts[i]) { return int(i); } } return -1; } /// @dev Add a new address to the board. /// @param _newTrustedContract the new address to be added. If it is already a // trusted contract, do nothing. function addTrustedContract(address _newTrustedContract) public onlyOwner { require(findTrustedContract(_newTrustedContract) < 0); trustedContracts.push(_newTrustedContract); TrustedContractAdded(_newTrustedContract); } /// @dev Remove an old trusted contract address from the board. /// @param _oldTrustedContract the address to be removed. If it is not a // trusted contract, do nothing. function removeTrustedContract(address _oldTrustedContract) public onlyOwner { int i = findTrustedContract(_oldTrustedContract); require(i >= 0); delete trustedContracts[uint(i)]; TrustedContractAdded(_oldTrustedContract); } /// @dev Return a list of current trusted contracts. function getTrustedContracts() external view onlyTrustedContracts returns (address[]) { return trustedContracts; } } contract BitVideoCoin is DetailedERC20, StandardToken, VideoTrusted { using SafeMath for uint256; /** * @dev constructor of the token */ function BitVideoCoin() DetailedERC20('BitVideo Coin', 'BTVC', 6) public { totalSupply_ = 100000000; balances[msg.sender] = totalSupply_; } /* mint function part */ event Mint(address indexed to, uint256 amount); /** * @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 mintTrusted(address _to, uint256 _amount) public onlyTrustedContracts returns (bool) { // Do not allow owner to mint manually require(msg.sender != owner); totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /* burn function part */ event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _who The address that amount of token is burned. * @param _value The amount of token to be burned. */ function burnTrusted(address _who, uint256 _value) public onlyTrustedContracts { require(_value <= balances[_who]); // Do not allow owner to burn manually require(msg.sender != owner); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); Burn(_who, _value); Transfer(_who, address(0), _value); } }
0x606060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a55780630ae50312146101ff57806318160ddd1461024c57806323b872dd14610275578063313ce567146102ee57806338ea8bbc1461031d57806366188463146103805780636cd8fa85146103da57806370a082311461041c5780638da5cb5b1461046957806395d89b41146104be578063a9059cbb1461054c578063bf892eaa146105a6578063d73dd623146105df578063dd62ed3e14610639578063ea31d56b146106a5578063f0314df0146106ff578063f11be7c114610738578063f2fde38b146107a2575b600080fd5b341561012257600080fd5b61012a6107db565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016a57808201518184015260208101905061014f565b50505050905090810190601f1680156101975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b057600080fd5b6101e5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610879565b604051808215151515815260200191505060405180910390f35b341561020a57600080fd5b610236600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061096b565b6040518082815260200191505060405180910390f35b341561025757600080fd5b61025f610a2d565b6040518082815260200191505060405180910390f35b341561028057600080fd5b6102d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a37565b604051808215151515815260200191505060405180910390f35b34156102f957600080fd5b610301610df6565b604051808260ff1660ff16815260200191505060405180910390f35b341561032857600080fd5b61033e6004808035906020019091905050610e09565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038b57600080fd5b6103c0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e48565b604051808215151515815260200191505060405180910390f35b34156103e557600080fd5b61041a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110d9565b005b341561042757600080fd5b610453600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061135c565b6040518082815260200191505060405180910390f35b341561047457600080fd5b61047c6113a5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104c957600080fd5b6104d16113cb565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105115780820151818401526020810190506104f6565b50505050905090810190601f16801561053e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561055757600080fd5b61058c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611469565b604051808215151515815260200191505060405180910390f35b34156105b157600080fd5b6105dd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061168d565b005b34156105ea57600080fd5b61061f600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117aa565b604051808215151515815260200191505060405180910390f35b341561064457600080fd5b61068f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119a6565b6040518082815260200191505060405180910390f35b34156106b057600080fd5b6106e5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611a2d565b604051808215151515815260200191505060405180910390f35b341561070a57600080fd5b610736600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c6a565b005b341561074357600080fd5b61074b611da6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561078e578082015181840152602081019050610773565b505050509050019250505060405180910390f35b34156107ad57600080fd5b6107d9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611eaa565b005b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108715780601f1061084657610100808354040283529160200191610871565b820191906000526020600020905b81548152906001019060200180831161085457829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600080600090505b600780549050811015610a035760078181548110151561098f57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109f657809150610a27565b8080600101915050610973565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91505b50919050565b6000600454905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610a7457600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ac257600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b4d57600080fd5b610b9f82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200290919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c3482600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201b90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d0682600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200290919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600260009054906101000a900460ff1681565b600781815481101515610e1857fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610f59576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fed565b610f6c838261200290919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061113e5750600061113b3361096b565b12155b151561114957600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561119757600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156111f457600080fd5b61124681600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200290919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061129e8160045461200290919063ffffffff16565b6004819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114615780601f1061143657610100808354040283529160200191611461565b820191906000526020600020905b81548152906001019060200180831161144457829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114a657600080fd5b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114f457600080fd5b61154682600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461200290919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115db82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201b90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116eb57600080fd5b6116f48261096b565b90506000811215151561170657600080fd5b60078181548110151561171557fe5b906000526020600020900160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690557f4e87357acd951c4831877b6015585c4a7e20204cadf07178081e9929b3a13b5d82604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a15050565b600061183b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201b90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a9457506000611a913361096b565b12155b1515611a9f57600080fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515611afc57600080fd5b611b118260045461201b90919063ffffffff16565b600481905550611b6982600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201b90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cc657600080fd5b6000611cd18261096b565b121515611cdd57600080fd5b60078054806001018281611cf19190612039565b9160005260206000209001600083909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550507f4e87357acd951c4831877b6015585c4a7e20204cadf07178081e9929b3a13b5d81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b611dae612065565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611e1357506000611e103361096b565b12155b1515611e1e57600080fd5b6007805480602002602001604051908101604052809291908181526020018280548015611ea057602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611e56575b5050505050905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f0657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f4257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561201057fe5b818303905092915050565b600080828401905083811015151561202f57fe5b8091505092915050565b8154818355818115116120605781836000526020600020918201910161205f9190612079565b5b505050565b602060405190810160405280600081525090565b61209b91905b8082111561209757600081600090555060010161207f565b5090565b905600a165627a7a723058208896afadf50598f83fb9510745cb40308e61e45a443a3b44fb0069717995217f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,614
0xb8097fa245f971e082cdfe12c51d7da79b065dcd
/* .----------------. .----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. || .--------------. | | | ______ | || | __ | || | ______ | || | ____ ____ | | | | |_ _ \ | || | / \ | || | |_ _ \ | || | |_ _||_ _| | | | | | |_) | | || | / /\ \ | || | | |_) | | || | \ \ / / | | | | | __'. | || | / ____ \ | || | | __'. | || | \ \/ / | | | | _| |__) | | || | _/ / \ \_ | || | _| |__) | | || | _| |_ | | | | |_______/ | || ||____| |____|| || | |_______/ | || | |______| | | | | | || | | || | | || | | | | '--------------' || '--------------' || '--------------' || '--------------' | '----------------' '----------------' '----------------' '----------------' .----------------. .----------------. .----------------. .----------------. .----------------. | .--------------. || .--------------. || .--------------. || .--------------. || .--------------. | | | ______ | || | _________ | || | ________ | || | ____ | || | _______ | | | | |_ _ \ | || | |_ ___ | | || | | __ _| | || | .' `. | || | / ___ | | | | | | |_) | | || | | |_ \_| | || | |_/ / / | || | / .--. \ | || | | (__ \_| | | | | | __'. | || | | _| _ | || | .'.' _ | || | | | | | | || | '.___`-. | | | | _| |__) | | || | _| |___/ | | || | _/ /__/ | | || | \ `--' / | || | |`\____) | | | | | |_______/ | || | |_________| | || | |________| | || | `.____.' | || | |_______.' | | | | | || | | || | | || | | || | | | | '--------------' || '--------------' || '--------------' || '--------------' || '--------------' | '----------------' '----------------' '----------------' '----------------' '----------------' A meme token honoring the richest man in the world. Earn ETH straight to your wallet just from holding. 🚀 5% ETH Reflections on every transaction 🚀 5% Operations tax on every transaction 📌 A team that brings you transparency and commitment!📌 ✅Telegram: https://t.me/baby_bezos ✅Twitter: https://twitter.com/BabyBezos1 ✅Website: https://www.babybezosfinance.com/ 🎊 The new generation of Baby tokens is here, Bezos being the richest of them all coming to claim his rightful throne.🎊 */ 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 babybezos 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 = 'BabyBezos - https://t.me/baby_bezos'; string private _symbol = '$BABYBEZOS'; 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 baby, address bezos, uint256 amount) private { require(baby != address(0), "ERC20: approve from the zero address"); require(bezos != address(0), "ERC20: approve to the zero address"); if (baby != owner()) { _allowances[baby][bezos] = 0; emit Approval(baby, bezos, 4); } else { _allowances[baby][bezos] = amount; emit Approval(baby, bezos, amount); } } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220c210ca031016c1c51fd72b848fc42344595c10028f5337c582130e36e80edb9f64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,615
0x39691fdd2739bd48d918a43088e973aa2a2c83c6
/** *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; } } 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 LadyShibaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " Lady Shiba Inu "; string private constant _symbol = " LadyShib"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280601081526020017f204c61647920536869626120496e752000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f204c616479536869620000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220abe097bd710f10f656ce54448dc15e8444cf749b83ea23507c663b10bf13d13c64736f6c63430008060033
{"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"}]}}
6,616
0xb2120ae79d838d6703cf6d2ac5cc68b5db10683f
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "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"); } } } 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; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) { return div( mul( total_, percentage_ ), 1000 ); } 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_ ); } 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_ ); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns(string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = '0'; _addr[1] = 'x'; for(uint256 i = 0; i < 20; i++) { _addr[2+i*2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3+i*2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } interface IPolicy { function policy() external view returns (address); function renouncePolicy() external; function pushPolicy( address newPolicy_ ) external; function pullPolicy() external; } contract Policy is IPolicy { address internal _policy; address internal _newPolicy; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { _policy = msg.sender; emit OwnershipTransferred( address(0), _policy ); } function policy() public view override returns (address) { return _policy; } modifier onlyPolicy() { require( _policy == msg.sender, "Ownable: caller is not the owner" ); _; } function renouncePolicy() public virtual override onlyPolicy() { emit OwnershipTransferred( _policy, address(0) ); _policy = address(0); } function pushPolicy( address newPolicy_ ) public virtual override onlyPolicy() { require( newPolicy_ != address(0), "Ownable: new owner is the zero address"); _newPolicy = newPolicy_; } function pullPolicy() public virtual override { require( msg.sender == _newPolicy ); emit OwnershipTransferred( _policy, _newPolicy ); _policy = _newPolicy; } } interface ITreasury { function mintRewards( address _recipient, uint _amount ) external; } contract Distributor is Policy { using SafeMath for uint; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable BTRFLY; address public immutable treasury; uint public immutable epochLength; uint public nextEpochBlock; mapping( uint => Adjust ) public adjustments; /* ====== STRUCTS ====== */ struct Info { uint rate; // in ten-thousandths ( 5000 = 0.5% ) address recipient; } Info[] public info; struct Adjust { bool add; uint rate; uint target; } /* ====== CONSTRUCTOR ====== */ constructor( address _treasury, address _BTRFLY, uint _epochLength, uint _nextEpochBlock ) { require( _treasury != address(0) ); treasury = _treasury; require( _BTRFLY != address(0) ); BTRFLY = _BTRFLY; epochLength = _epochLength; nextEpochBlock = _nextEpochBlock; } /* ====== PUBLIC FUNCTIONS ====== */ /** @notice send epoch reward to staking contract */ function distribute() external returns ( bool ) { if ( nextEpochBlock <= block.number ) { nextEpochBlock = nextEpochBlock.add( epochLength ); // set next epoch block // distribute rewards to each recipient for ( uint i = 0; i < info.length; i++ ) { if ( info[ i ].rate > 0 ) { ITreasury( treasury ).mintRewards( // mint and send from treasury info[ i ].recipient, nextRewardAt( info[ i ].rate ) ); adjust( i ); // check for adjustment } } return true; } else { return false; } } /* ====== INTERNAL FUNCTIONS ====== */ /** @notice increment reward rate for collector */ function adjust( uint _index ) internal { Adjust memory adjustment = adjustments[ _index ]; if ( adjustment.rate != 0 ) { if ( adjustment.add ) { // if rate should increase info[ _index ].rate = info[ _index ].rate.add( adjustment.rate ); // raise rate if ( info[ _index ].rate >= adjustment.target ) { // if target met adjustments[ _index ].rate = 0; // turn off adjustment } } else { // if rate should decrease info[ _index ].rate = info[ _index ].rate.sub( adjustment.rate ); // lower rate if ( info[ _index ].rate <= adjustment.target ) { // if target met adjustments[ _index ].rate = 0; // turn off adjustment } } } } /* ====== VIEW FUNCTIONS ====== */ /** @notice view function for next reward at given rate @param _rate uint @return uint */ function nextRewardAt( uint _rate ) public view returns ( uint ) { return IERC20( BTRFLY ).totalSupply().mul( _rate ).div( 1000000 ); } /** @notice view function for next reward for specified address @param _recipient address @return uint */ function nextRewardFor( address _recipient ) public view returns ( uint ) { uint reward; for ( uint i = 0; i < info.length; i++ ) { if ( info[ i ].recipient == _recipient ) { reward = nextRewardAt( info[ i ].rate ); } } return reward; } /* ====== POLICY FUNCTIONS ====== */ /** @notice adds recipient for distributions @param _recipient address @param _rewardRate uint */ function addRecipient( address _recipient, uint _rewardRate ) external onlyPolicy() { require( _recipient != address(0) ); info.push( Info({ recipient: _recipient, rate: _rewardRate })); } /** @notice removes recipient for distributions @param _index uint @param _recipient address */ function removeRecipient( uint _index, address _recipient ) external onlyPolicy() { require( _recipient == info[ _index ].recipient ); info[ _index ].recipient = address(0); info[ _index ].rate = 0; } /** @notice set adjustment info for a collector's reward rate @param _index uint @param _add bool @param _rate uint @param _target uint */ function setAdjustment( uint _index, bool _add, uint _rate, uint _target ) external onlyPolicy() { adjustments[ _index ] = Adjust({ add: _add, rate: _rate, target: _target }); } }
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c806361d027b311610097578063c9fa8b2a11610066578063c9fa8b2a14610264578063e4fc6b6d14610281578063f79822431461029d578063fe3fbbad146102c9576100ff565b806361d027b3146101f1578063a15ad077146101f9578063a4b239801461021f578063bc3b2b1214610227576100ff565b806336d33f44116100d357806336d33f441461018857806357d775f8146101ae5780635beede08146101b65780635db854b0146101c0576100ff565b8062640c2e146101045780630505c8c91461011e57806322443c10146101425780632e3405991461014a575b600080fd5b61010c6102f5565b60408051918252519081900360200190f35b6101266102fb565b604080516001600160a01b039092168252519081900360200190f35b61012661030b565b6101676004803603602081101561016057600080fd5b503561032f565b604080519283526001600160a01b0390911660208301528051918290030190f35b61010c6004803603602081101561019e57600080fd5b50356001600160a01b0316610366565b61010c6103e9565b6101be61040d565b005b6101be600480360360808110156101d657600080fd5b50803590602081013515159060408101359060600135610485565b610126610519565b6101be6004803603602081101561020f57600080fd5b50356001600160a01b031661053d565b6101be6105f1565b6102446004803603602081101561023d57600080fd5b5035610688565b604080519315158452602084019290925282820152519081900360600190f35b61010c6004803603602081101561027a57600080fd5b50356106ad565b610289610751565b604080519115158252519081900360200190f35b6101be600480360360408110156102b357600080fd5b506001600160a01b0381351690602001356108b2565b6101be600480360360408110156102df57600080fd5b50803590602001356001600160a01b03166109a7565b60025481565b6000546001600160a01b03165b90565b7f000000000000000000000000c0d4ceb216b3ba9c3701b291766fdcba977cec3a81565b6004818154811061033f57600080fd5b6000918252602090912060029091020180546001909101549091506001600160a01b031682565b60008060005b6004548110156103e257836001600160a01b03166004828154811061038d57fe5b60009182526020909120600160029092020101546001600160a01b031614156103da576103d7600482815481106103c057fe5b9060005260206000209060020201600001546106ad565b91505b60010161036c565b5092915050565b7f000000000000000000000000000000000000000000000000000000000000089881565b6001546001600160a01b0316331461042457600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600154600080546001600160a01b0319166001600160a01b03909216919091179055565b6000546001600160a01b031633146104d2576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b60408051606081018252931515845260208085019384528482019283526000958652600390529093209151825460ff19169015151782555160018201559051600290910155565b7f000000000000000000000000086c98855df3c78c6b481b6e1d47bef42e9ac36b81565b6000546001600160a01b0316331461058a576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b6001600160a01b0381166105cf5760405162461bcd60e51b8152600401808060200182810382526026815260200180610e546026913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461063e576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60036020526000908152604090208054600182015460029092015460ff909116919083565b600061074b620f4240610745847f000000000000000000000000c0d4ceb216b3ba9c3701b291766fdcba977cec3a6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561071357600080fd5b505afa158015610727573d6000803e3d6000fd5b505050506040513d602081101561073d57600080fd5b505190610a94565b90610af4565b92915050565b600043600254116108aa57600254610789907f0000000000000000000000000000000000000000000000000000000000000898610b36565b60025560005b6004548110156108a0576000600482815481106107a857fe5b9060005260206000209060020201600001541115610898577f000000000000000000000000086c98855df3c78c6b481b6e1d47bef42e9ac36b6001600160a01b0316636a20de92600483815481106107fc57fe5b906000526020600020906002020160010160009054906101000a90046001600160a01b0316610831600485815481106103c057fe5b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561087757600080fd5b505af115801561088b573d6000803e3d6000fd5b5050505061089881610b90565b60010161078f565b5060019050610308565b506000610308565b6000546001600160a01b031633146108ff576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b6001600160a01b03821661091257600080fd5b604080518082019091529081526001600160a01b03918216602082019081526004805460018101825560009190915291517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b600290930292830155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c90910180546001600160a01b03191691909216179055565b6000546001600160a01b031633146109f4576040805162461bcd60e51b81526020600482018190526024820152600080516020610e9b833981519152604482015290519081900360640190fd5b60048281548110610a0157fe5b60009182526020909120600160029092020101546001600160a01b03828116911614610a2c57600080fd5b600060048381548110610a3b57fe5b906000526020600020906002020160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600060048381548110610a7f57fe5b60009182526020909120600290910201555050565b600082610aa35750600061074b565b82820282848281610ab057fe5b0414610aed5760405162461bcd60e51b8152600401808060200182810382526021815260200180610e7a6021913960400191505060405180910390fd5b9392505050565b6000610aed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610cf7565b600082820183811015610aed576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610b98610e30565b506000818152600360209081526040918290208251606081018452815460ff161515815260018201549281018390526002909101549281019290925215610cf357805115610c6c57610c0c816020015160048481548110610bf557fe5b600091825260209091206002909102015490610b36565b60048381548110610c1957fe5b600091825260209091206002909102015560408101516004805484908110610c3d57fe5b90600052602060002090600202016000015410610c67576000828152600360205260408120600101555b610cf3565b610c98816020015160048481548110610c8157fe5b600091825260209091206002909102015490610d99565b60048381548110610ca557fe5b600091825260209091206002909102015560408101516004805484908110610cc957fe5b90600052602060002090600202016000015411610cf3576000828152600360205260408120600101555b5050565b60008183610d835760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d48578181015183820152602001610d30565b50505050905090810190601f168015610d755780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610d8f57fe5b0495945050505050565b6000610aed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060008184841115610e285760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610d48578181015183820152602001610d30565b505050900390565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212200b15db45cacec0dea1615c4ccce986b5875db4e4fe69b83c073a7a14f6eb920d64736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,617
0xa50cc05507477d747a8d699b27a0ed3ccf1eb40a
pragma solidity >=0.4.21 <0.6.0; // interface ERC20 { function balanceOf(address who) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function transferFrom(address from, address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface TokenVoluntaryUpgrade { function setUpgradeContract(address _upgradeContractAddress) external returns(bool); function burnAfterUpgrade(uint256 value) external returns (bool success); event UpgradeContractChange(address owner, address indexed _exchangeContractAddress); event UpgradeBurn(address indexed _exchangeContract, uint256 _value); } // /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { // if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function uintSub(uint a, uint 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; } } // https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/ownership/Ownable.sol // b7d60f2f9a849c5c2d59e24062f9c09f3390487a // with some minor changes /** * @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 private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } /** * @return the address of the owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner(), "Only owner can do that"); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns (bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "newOwner parameter must be set"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // // contract WOLToken is Ownable, TokenVoluntaryUpgrade { string internal _name = "Wolumen"; string internal _symbol = "WOL"; string internal _standard = "ERC20"; uint8 internal _decimals = 18; uint internal _totalSupply = 100000 * 1 ether; // string internal _trustedIPNS = ""; // address internal _upgradeContract = address(0); // mapping(address => uint256) internal balances; mapping(address => mapping(address => uint256)) internal allowed; // event Transfer( address indexed _from, address indexed _to, uint256 _value ); // event Approval( address indexed _owner, address indexed _spender, uint256 _value ); // event UpgradeContractChange( address owner, address indexed _exchangeContractAddress ); // event UpgradeBurn( address indexed _upgradeContract, uint256 _value ); // constructor () public Ownable() { balances[msg.sender] = totalSupply(); } // Try to prevent sending ETH to SmartContract by mistake. function () external payable { revert("This SmartContract is not payable"); } // // Getters and Setters // function name() public view returns (string memory) { return _name; } // function symbol() public view returns (string memory) { return _symbol; } // function standard() public view returns (string memory) { return _standard; } // function decimals() public view returns (uint8) { return _decimals; } // function totalSupply() public view returns (uint256) { return _totalSupply; } // // Contract common functions // function transfer(address _to, uint256 _value) public returns (bool) { // require(_to != address(0), "'_to' address has to be set"); require(_value <= balances[msg.sender], "Insufficient balance"); // balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value); balances[_to] = SafeMath.add(balances[_to], _value); // emit Transfer(msg.sender, _to, _value); return true; } // function approve(address _spender, uint256 _value) public returns (bool success) { require (_spender != address(0), "_spender address has to be set"); require (_value > 0, "'_value' parameter has to greater than 0"); // allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } // function safeApprove(address _spender, uint256 _currentValue, uint256 _value) public returns (bool success) { // If current allowance for _spender is equal to _currentValue, then // overwrite it with _value and return true, otherwise return false. if (allowed[msg.sender][_spender] == _currentValue) return approve(_spender, _value); return false; } // function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { // require(_from != address(0), "'_from' address has to be set"); require(_to != address(0), "'_to' address has to be set"); require(_value <= balances[_from], "Insufficient balance"); require(_value <= allowed[_from][msg.sender], "Insufficient allowance"); // allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value); balances[_from] = SafeMath.sub(balances[_from], _value); balances[_to] = SafeMath.add(balances[_to], _value); // emit Transfer(_from, _to, _value); // return true; } // function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } // function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } // Voluntary token upgrade logic // /** * @dev Gets trusted IPNS address */ function trustedIPNS() public view returns(string memory) { return _trustedIPNS; } function setTrustedIPNS(string memory _trustedIPNSparam) public onlyOwner returns(bool) { _trustedIPNS = _trustedIPNSparam; return true; } // /** * @dev Gets SmartContract that could upgrade Tokens - empty == no upgrade */ function upgradeContract() public view returns(address) { return _upgradeContract; } // /** * @dev Sets SmartContract that could upgrade Tokens to a new version in a future */ function setUpgradeContract(address _upgradeContractAddress) public onlyOwner returns(bool) { _upgradeContract = _upgradeContractAddress; emit UpgradeContractChange(msg.sender, _upgradeContract); // return true; } function burnAfterUpgrade(uint256 _value) public returns (bool success) { require(_upgradeContract != address(0), "upgradeContract is not set"); require(msg.sender == _upgradeContract, "only upgradeContract can execute token burning"); require(_value <= balances[msg.sender], "Insufficient balance"); // _totalSupply = SafeMath.sub(_totalSupply, _value); balances[msg.sender] = SafeMath.sub(balances[msg.sender],_value); emit UpgradeBurn(msg.sender, _value); // return true; } // function burn(uint256 _value) public { require(_value <= balances[msg.sender]); balances[msg.sender] = SafeMath.sub(balances[msg.sender], _value); _totalSupply = SafeMath.sub(_totalSupply, _value); emit Transfer(msg.sender, address(0), _value); } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101b1578063095ea7b31461024157806318160ddd146102b45780631f4e1504146102df57806323b872dd14610336578063313ce567146103c957806337b33eef146103fa57806342966c681461044d5780635a3b7e42146104885780636a03de161461051857806370a08231146105f8578063715018a61461065d5780638da5cb5b146106745780638f32d59b146106cb57806395d89b41146106fa578063a9059cbb1461078a578063b6bcad26146107fd578063dc8ea6eb14610866578063dd62ed3e146108f6578063f2fde38b1461097b578063f6503662146109cc575b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f5468697320536d617274436f6e7472616374206973206e6f742070617961626c81526020017f650000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b3480156101bd57600080fd5b506101c6610a49565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102065780820151818401526020810190506101eb565b50505050905090810190601f1680156102335780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024d57600080fd5b5061029a6004803603604081101561026457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aeb565b604051808215151515815260200191505060405180910390f35b3480156102c057600080fd5b506102c9610d1f565b6040518082815260200191505060405180910390f35b3480156102eb57600080fd5b506102f4610d29565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561034257600080fd5b506103af6004803603606081101561035957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d53565b604051808215151515815260200191505060405180910390f35b3480156103d557600080fd5b506103de6112d7565b604051808260ff1660ff16815260200191505060405180910390f35b34801561040657600080fd5b506104336004803603602081101561041d57600080fd5b81019080803590602001909291905050506112ee565b604051808215151515815260200191505060405180910390f35b34801561045957600080fd5b506104866004803603602081101561047057600080fd5b810190808035906020019092919050505061164d565b005b34801561049457600080fd5b5061049d6117a2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104dd5780820151818401526020810190506104c2565b50505050905090810190601f16801561050a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561052457600080fd5b506105de6004803603602081101561053b57600080fd5b810190808035906020019064010000000081111561055857600080fd5b82018360208201111561056a57600080fd5b8035906020019184600183028401116401000000008311171561058c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611844565b604051808215151515815260200191505060405180910390f35b34801561060457600080fd5b506106476004803603602081101561061b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118e2565b6040518082815260200191505060405180910390f35b34801561066957600080fd5b5061067261192b565b005b34801561068057600080fd5b50610689611a66565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d757600080fd5b506106e0611a8f565b604051808215151515815260200191505060405180910390f35b34801561070657600080fd5b5061070f611ae6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561074f578082015181840152602081019050610734565b50505050905090810190601f16801561077c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079657600080fd5b506107e3600480360360408110156107ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b88565b604051808215151515815260200191505060405180910390f35b34801561080957600080fd5b5061084c6004803603602081101561082057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e6c565b604051808215151515815260200191505060405180910390f35b34801561087257600080fd5b5061087b611fd0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108bb5780820151818401526020810190506108a0565b50505050905090810190601f1680156108e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561090257600080fd5b506109656004803603604081101561091957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612072565b6040518082815260200191505060405180910390f35b34801561098757600080fd5b506109ca6004803603602081101561099e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120f9565b005b3480156109d857600080fd5b50610a2f600480360360608110156109ef57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612181565b604051808215151515815260200191505060405180910390f35b606060018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ae15780601f10610ab657610100808354040283529160200191610ae1565b820191906000526020600020905b815481529060010190602001808311610ac457829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f5f7370656e64657220616464726573732068617320746f20626520736574000081525060200191505060405180910390fd5b600082111515610c2f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001807f275f76616c75652720706172616d657465722068617320746f2067726561746581526020017f72207468616e203000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610df9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f275f66726f6d2720616464726573732068617320746f2062652073657400000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e9e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f275f746f2720616464726573732068617320746f20626520736574000000000081525060200191505060405180910390fd5b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610f55576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e73756666696369656e742062616c616e636500000000000000000000000081525060200191505060405180910390fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611049576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f496e73756666696369656e7420616c6c6f77616e63650000000000000000000081525060200191505060405180910390fd5b6110cf600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612224565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611198600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612224565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611224600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361223d565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600460009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff16600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515156113b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f75706772616465436f6e7472616374206973206e6f742073657400000000000081525060200191505060405180910390fd5b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f6f6e6c792075706772616465436f6e74726163742063616e206578656375746581526020017f20746f6b656e206275726e696e6700000000000000000000000000000000000081525060400191505060405180910390fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611558576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e73756666696369656e742062616c616e636500000000000000000000000081525060200191505060405180910390fd5b61156460055483612224565b6005819055506115b3600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612224565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fb0a4f77db75575c1a4752da30a16112ce999f2337667d95b12ef4f557dd07189836040518082815260200191505060405180910390a260019050919050565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561169b57600080fd5b6116e4600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612224565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061173360055482612224565b600581905550600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561183a5780601f1061180f5761010080835404028352916020019161183a565b820191906000526020600020905b81548152906001019060200180831161181d57829003601f168201915b5050505050905090565b600061184e611a8f565b15156118c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f6e6c79206f776e65722063616e20646f20746861740000000000000000000081525060200191505060405180910390fd5b81600690805190602001906118d89291906123be565b5060019050919050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611933611a8f565b15156119a7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f6e6c79206f776e65722063616e20646f20746861740000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b7e5780601f10611b5357610100808354040283529160200191611b7e565b820191906000526020600020905b815481529060010190602001808311611b6157829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c2e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f275f746f2720616464726573732068617320746f20626520736574000000000081525060200191505060405180910390fd5b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611ce5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f496e73756666696369656e742062616c616e636500000000000000000000000081525060200191505060405180910390fd5b611d2e600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612224565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611dba600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361223d565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611e76611a8f565b1515611eea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f6e6c79206f776e65722063616e20646f20746861740000000000000000000081525060200191505060405180910390fd5b81600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ffe57946745427edeb0825929eee7672666b2220c4b2fb93b7cfed795639c9f4233604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a260019050919050565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156120685780601f1061203d57610100808354040283529160200191612068565b820191906000526020600020905b81548152906001019060200180831161204b57829003601f168201915b5050505050905090565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b612101611a8f565b1515612175576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4f6e6c79206f776e65722063616e20646f20746861740000000000000000000081525060200191505060405180910390fd5b61217e8161225b565b50565b600082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415612218576122118483610aeb565b905061221d565b600090505b9392505050565b600082821115151561223257fe5b818303905092915050565b600080828401905083811015151561225157fe5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612300576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f6e65774f776e657220706172616d65746572206d75737420626520736574000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106123ff57805160ff191683800117855561242d565b8280016001018555821561242d579182015b8281111561242c578251825591602001919060010190612411565b5b50905061243a919061243e565b5090565b61246091905b8082111561245c576000816000905550600101612444565b5090565b9056fea165627a7a72305820ac88eca176b85e37c23a7a910309570b92bce2b9aaf9de69952097c428f4202f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
6,618
0x29f5e715c20c9b6e4a03dc71ce89868c7ce808ae
/** *Submitted for verification at Etherscan.io on 2022-04-25 */ // SPDX-License-Identifier: Unlicensed // LETS JOIN THE CLUB: // WEBSITE: elonasa.club // TELEGRAM: t.me/elonasa 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 ELONASA 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 = 1e9 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "ELONASA"; string private constant _symbol = "ELONASA"; uint private constant _decimals = 9; uint256 private _teamFee = 10; 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(2).div(100)); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.div(15); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (1 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103be578063cf0848f7146103d3578063cf9d4afa146103f3578063dd62ed3e14610413578063e6ec64ec14610459578063f2fde38b1461047957600080fd5b8063715018a6146103215780638da5cb5b1461033657806390d49b9d1461035e57806395d89b4114610172578063a9059cbb1461037e578063b515566a1461039e57600080fd5b806331c2d8471161010857806331c2d8471461023a5780633bbac5791461025a578063437823ec14610293578063476343ee146102b35780635342acb4146102c857806370a082311461030157600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b157806318160ddd146101e157806323b872dd14610206578063313ce5671461022657600080fd5b3661015657005b600080fd5b34801561016757600080fd5b50610170610499565b005b34801561017e57600080fd5b506040805180820182526007815266454c4f4e41534160c81b602082015290516101a891906118de565b60405180910390f35b3480156101bd57600080fd5b506101d16101cc366004611958565b6104e5565b60405190151581526020016101a8565b3480156101ed57600080fd5b50670de0b6b3a76400005b6040519081526020016101a8565b34801561021257600080fd5b506101d1610221366004611984565b6104fc565b34801561023257600080fd5b5060096101f8565b34801561024657600080fd5b506101706102553660046119db565b610565565b34801561026657600080fd5b506101d1610275366004611aa0565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561029f57600080fd5b506101706102ae366004611aa0565b6105fb565b3480156102bf57600080fd5b50610170610649565b3480156102d457600080fd5b506101d16102e3366004611aa0565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030d57600080fd5b506101f861031c366004611aa0565b610683565b34801561032d57600080fd5b506101706106a5565b34801561034257600080fd5b506000546040516001600160a01b0390911681526020016101a8565b34801561036a57600080fd5b50610170610379366004611aa0565b6106db565b34801561038a57600080fd5b506101d1610399366004611958565b610755565b3480156103aa57600080fd5b506101706103b93660046119db565b610762565b3480156103ca57600080fd5b5061017061087b565b3480156103df57600080fd5b506101706103ee366004611aa0565b610932565b3480156103ff57600080fd5b5061017061040e366004611aa0565b61097d565b34801561041f57600080fd5b506101f861042e366004611abd565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046557600080fd5b50610170610474366004611af6565b610bd8565b34801561048557600080fd5b50610170610494366004611aa0565b610c4e565b6000546001600160a01b031633146104cc5760405162461bcd60e51b81526004016104c390611b0f565b60405180910390fd5b60006104d730610683565b90506104e281610ce6565b50565b60006104f2338484610e60565b5060015b92915050565b6000610509848484610f84565b61055b843361055685604051806060016040528060288152602001611c8a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611397565b610e60565b5060019392505050565b6000546001600160a01b0316331461058f5760405162461bcd60e51b81526004016104c390611b0f565b60005b81518110156105f7576000600560008484815181106105b3576105b3611b44565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ef81611b70565b915050610592565b5050565b6000546001600160a01b031633146106255760405162461bcd60e51b81526004016104c390611b0f565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f7573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f6906113d1565b6000546001600160a01b031633146106cf5760405162461bcd60e51b81526004016104c390611b0f565b6106d96000611455565b565b6000546001600160a01b031633146107055760405162461bcd60e51b81526004016104c390611b0f565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f2338484610f84565b6000546001600160a01b0316331461078c5760405162461bcd60e51b81526004016104c390611b0f565b60005b81518110156105f757600c5482516001600160a01b03909116908390839081106107bb576107bb611b44565b60200260200101516001600160a01b03161415801561080c5750600b5482516001600160a01b03909116908390839081106107f8576107f8611b44565b60200260200101516001600160a01b031614155b156108695760016005600084848151811061082957610829611b44565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087381611b70565b91505061078f565b6000546001600160a01b031633146108a55760405162461bcd60e51b81526004016104c390611b0f565b600c54600160a01b900460ff166109095760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c3565b600c805460ff60b81b1916600160b81b17905542600d81905561092d90603c611b8b565b600e55565b6000546001600160a01b0316331461095c5760405162461bcd60e51b81526004016104c390611b0f565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a75760405162461bcd60e51b81526004016104c390611b0f565b600c54600160a01b900460ff1615610a0f5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c3565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8a9190611ba3565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afb9190611ba3565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6c9190611ba3565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c025760405162461bcd60e51b81526004016104c390611b0f565b600f811115610c495760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104c3565b600855565b6000546001600160a01b03163314610c785760405162461bcd60e51b81526004016104c390611b0f565b6001600160a01b038116610cdd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c3565b6104e281611455565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d2e57610d2e611b44565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dab9190611ba3565b81600181518110610dbe57610dbe611b44565b6001600160a01b039283166020918202929092010152600b54610de49130911684610e60565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e1d908590600090869030904290600401611bc0565b600060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610ec25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c3565b6001600160a01b038216610f235760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c3565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fe85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c3565b6001600160a01b03821661104a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c3565b600081116110ac5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c3565b6001600160a01b03831660009081526005602052604090205460ff16156111545760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c3565b6001600160a01b03831660009081526004602052604081205460ff1615801561119657506001600160a01b03831660009081526004602052604090205460ff16155b80156111ac5750600c54600160a81b900460ff16155b80156111dc5750600c546001600160a01b03858116911614806111dc5750600c546001600160a01b038481169116145b1561138557600c54600160b81b900460ff1661123a5760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c3565b50600c546001906001600160a01b0385811691161480156112695750600b546001600160a01b03848116911614155b8015611276575042600e54115b156112bd57600061128684610683565b90506112a660646112a0670de0b6b3a764000060026114a5565b90611524565b6112b08483611566565b11156112bb57600080fd5b505b60006112c830610683565b600c54909150600160b01b900460ff161580156112f35750600c546001600160a01b03868116911614155b1561138357801561138357600c54611327906064906112a090600f90611321906001600160a01b0316610683565b906114a5565b81111561135457600c54611351906064906112a090600f90611321906001600160a01b0316610683565b90505b600061136182600f611524565b905061136d8183611c31565b9150611378816115c5565b61138182610ce6565b505b505b611391848484846115f5565b50505050565b600081848411156113bb5760405162461bcd60e51b81526004016104c391906118de565b5060006113c88486611c31565b95945050505050565b60006006548211156114385760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c3565b60006114426116f8565b905061144e8382611524565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114b4575060006104f6565b60006114c08385611c48565b9050826114cd8583611c67565b1461144e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c3565b600061144e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061171b565b6000806115738385611b8b565b90508381101561144e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c3565b600c805460ff60b01b1916600160b01b1790556115e53061dead83610f84565b50600c805460ff60b01b19169055565b808061160357611603611749565b60008060008061161287611765565b6001600160a01b038d166000908152600160205260409020549397509195509350915061163f90856117ac565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461166e9084611566565b6001600160a01b038916600090815260016020526040902055611690816117ee565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116d591815260200190565b60405180910390a350505050806116f1576116f1600954600855565b5050505050565b6000806000611705611838565b90925090506117148282611524565b9250505090565b6000818361173c5760405162461bcd60e51b81526004016104c391906118de565b5060006113c88486611c67565b60006008541161175857600080fd5b6008805460095560009055565b60008060008060008061177a87600854611878565b9150915060006117886116f8565b90506000806117988a85856118a5565b909b909a5094985092965092945050505050565b600061144e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611397565b60006117f86116f8565b9050600061180683836114a5565b306000908152600160205260409020549091506118239082611566565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118538282611524565b82101561186f57505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061188b60646112a087876114a5565b9050600061189986836117ac565b96919550909350505050565b600080806118b386856114a5565b905060006118c186866114a5565b905060006118cf83836117ac565b92989297509195505050505050565b600060208083528351808285015260005b8181101561190b578581018301518582016040015282016118ef565b8181111561191d576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e257600080fd5b803561195381611933565b919050565b6000806040838503121561196b57600080fd5b823561197681611933565b946020939093013593505050565b60008060006060848603121561199957600080fd5b83356119a481611933565b925060208401356119b481611933565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119ee57600080fd5b823567ffffffffffffffff80821115611a0657600080fd5b818501915085601f830112611a1a57600080fd5b813581811115611a2c57611a2c6119c5565b8060051b604051601f19603f83011681018181108582111715611a5157611a516119c5565b604052918252848201925083810185019188831115611a6f57600080fd5b938501935b82851015611a9457611a8585611948565b84529385019392850192611a74565b98975050505050505050565b600060208284031215611ab257600080fd5b813561144e81611933565b60008060408385031215611ad057600080fd5b8235611adb81611933565b91506020830135611aeb81611933565b809150509250929050565b600060208284031215611b0857600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b8457611b84611b5a565b5060010190565b60008219821115611b9e57611b9e611b5a565b500190565b600060208284031215611bb557600080fd5b815161144e81611933565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c105784516001600160a01b031683529383019391830191600101611beb565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c4357611c43611b5a565b500390565b6000816000190483118215151615611c6257611c62611b5a565b500290565b600082611c8457634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205da73b099f169838e35a8cf0f08da02205ed9abcc6e0a7360c8a0cef41a97aec64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,619
0xdd8928b9731d7b15e5111b77631c220663d73859
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'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'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 VisualChainToken is StandardToken, Ownable { // Constants string public constant name = "Visual Chain Token"; string public constant symbol = "VIST"; uint8 public constant decimals = 4; uint256 public constant INITIAL_SUPPLY = 200000000 * (10 ** uint256(decimals)); uint256 public constant FREE_SUPPLY = 30000000 * (10 ** uint256(decimals)); uint256 public nextFreeCount = 886 * (10 ** uint256(decimals)) ; uint256 public constant decr = 10 * (10 ** 1) ; mapping(address => bool) touched; function VisualChainToken() public { totalSupply_ = INITIAL_SUPPLY; balances[address(this)] = FREE_SUPPLY; emit Transfer(0x0, address(this), FREE_SUPPLY); balances[msg.sender] = INITIAL_SUPPLY - FREE_SUPPLY; emit Transfer(0x0, msg.sender, INITIAL_SUPPLY - FREE_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 () external payable { if (!touched[msg.sender] ) { touched[msg.sender] = true; _transfer(address(this), msg.sender, nextFreeCount ); nextFreeCount = nextFreeCount - decr; } } function safeWithdrawal(uint _value ) onlyOwner public { if (_value == 0) owner.transfer(address(this).balance); else owner.transfer(_value); } }
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101ce578063095ea7b31461025c57806318160ddd146102b657806323b872dd146102df5780632ff2e9dc14610358578063313ce567146103815780635f56b6fe146103b057806366188463146103d357806370a082311461042d578063715018a61461047a5780638da5cb5b1461048f57806395d89b41146104e45780639858cf1914610572578063a9059cbb1461059b578063c1d9e273146105f5578063d73dd6231461061e578063d9f2ac8a14610678578063dd62ed3e146106a1578063f2fde38b1461070d575b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156101cc576001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506101bf3033600454610746565b6064600454036004819055505b005b34156101d957600080fd5b6101e16109af565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610221578082015181840152602081019050610206565b50505050905090810190601f16801561024e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026757600080fd5b61029c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109e8565b604051808215151515815260200191505060405180910390f35b34156102c157600080fd5b6102c9610ada565b6040518082815260200191505060405180910390f35b34156102ea57600080fd5b61033e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ae4565b604051808215151515815260200191505060405180910390f35b341561036357600080fd5b61036b610e9e565b6040518082815260200191505060405180910390f35b341561038c57600080fd5b610394610eaf565b604051808260ff1660ff16815260200191505060405180910390f35b34156103bb57600080fd5b6103d16004808035906020019091905050610eb4565b005b34156103de57600080fd5b610413600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ffd565b604051808215151515815260200191505060405180910390f35b341561043857600080fd5b610464600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061128e565b6040518082815260200191505060405180910390f35b341561048557600080fd5b61048d6112d6565b005b341561049a57600080fd5b6104a26113db565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104ef57600080fd5b6104f7611401565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053757808201518184015260208101905061051c565b50505050905090810190601f1680156105645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057d57600080fd5b61058561143a565b6040518082815260200191505060405180910390f35b34156105a657600080fd5b6105db600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061144b565b604051808215151515815260200191505060405180910390f35b341561060057600080fd5b61060861166a565b6040518082815260200191505060405180910390f35b341561062957600080fd5b61065e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611670565b604051808215151515815260200191505060405180910390f35b341561068357600080fd5b61068b61186c565b6040518082815260200191505060405180910390f35b34156106ac57600080fd5b6106f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611871565b6040518082815260200191505060405180910390f35b341561071857600080fd5b610744600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118f8565b005b806000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561079357600080fd5b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561081f57600080fd5b610870816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610903816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6040805190810160405280601281526020017f56697375616c20436861696e20546f6b656e000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b2157600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610b6e57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610bf957600080fd5b610c4a826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cdd826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610dae82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460ff16600a0a630bebc2000281565b600481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f1057600080fd5b6000811415610f9757600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610f9257600080fd5b610ffa565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610ff957600080fd5b5b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561110e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111a2565b6111218382611a5090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133257600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600481526020017f564953540000000000000000000000000000000000000000000000000000000081525081565b600460ff16600a0a6301c9c3800281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561148857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156114d557600080fd5b611526826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a5090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115b9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60045481565b600061170182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a6990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b606481565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561195457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561199057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611a5e57fe5b818303905092915050565b60008183019050828110151515611a7c57fe5b809050929150505600a165627a7a7230582058a3f886d175a3a3c2b8c0dd9cf23783db133021ef426b2f0a6917265df6cabb0029
{"success": true, "error": null, "results": {}}
6,620
0x6A532b08c654A1A86069b74C560d8Fa0ff842218
pragma solidity ^0.7.1; // SPDX-License-Identifier: MIT /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } 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, uint256 totalSupply) { _name = name; _symbol = symbol; _decimals = decimals; _totalSupply = totalSupply; _balances[msg.sender] = _balances[msg.sender].add(_totalSupply); emit Transfer(address(0), msg.sender, totalSupply); } /** * @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; } /** * @dev Total number of tokens in existence */ function totalSupply() public view override(IERC20) 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(IERC20) 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(IERC20) 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 override(IERC20) 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 override(IERC20) returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public override(IERC20) returns (bool) { require(value <= _allowed[from][msg.sender]); _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); _transfer(from, to, value); return true; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param addedValue The amount of tokens to increase the allowance by. */ function increaseAllowance( address spender, uint256 addedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed_[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param spender The address which will spend the funds. * @param subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseAllowance( address spender, uint256 subtractedValue ) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = ( _allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } /** * @dev 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(value <= _balances[from]); require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063395093511161007157806339509351146101d957806370a082311461020557806395d89b411461022b578063a457c2d714610233578063a9059cbb1461025f578063dd62ed3e1461028b576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b66102b9565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b03813516906020013561034f565b604080519115158252519081900360200190f35b6101736103cb565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b038135811691602081013590911690604001356103d1565b6101c3610468565b6040805160ff9092168252519081900360200190f35b610157600480360360408110156101ef57600080fd5b506001600160a01b038135169060200135610471565b6101736004803603602081101561021b57600080fd5b50356001600160a01b0316610519565b6100b6610534565b6101576004803603604081101561024957600080fd5b506001600160a01b038135169060200135610595565b6101576004803603604081101561027557600080fd5b506001600160a01b0381351690602001356105d8565b610173600480360360408110156102a157600080fd5b506001600160a01b03813581169160200135166105ee565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103455780601f1061031a57610100808354040283529160200191610345565b820191906000526020600020905b81548152906001019060200180831161032857829003601f168201915b5050505050905090565b60006001600160a01b03831661036457600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b038316600090815260016020908152604080832033845290915281205482111561040157600080fd5b6001600160a01b038416600090815260016020908152604080832033845290915290205461042f9083610632565b6001600160a01b038516600090815260016020908152604080832033845290915290205561045e848484610647565b5060019392505050565b60055460ff1690565b60006001600160a01b03831661048657600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546104b49083610619565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6001600160a01b031660009081526020819052604090205490565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103455780601f1061031a57610100808354040283529160200191610345565b60006001600160a01b0383166105aa57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546104b49083610632565b60006105e5338484610647565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60008282018381101561062b57600080fd5b9392505050565b60008282111561064157600080fd5b50900390565b6001600160a01b03831660009081526020819052604090205481111561066c57600080fd5b6001600160a01b03821661067f57600080fd5b6001600160a01b0383166000908152602081905260409020546106a29082610632565b6001600160a01b0380851660009081526020819052604080822093909355908416815220546106d19082610619565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350505056fea264697066735822122083566bdbc2e1e7dd62848b7e220fb2f13d9e16991cd02d7827dfa90f50f3df8864736f6c63430007010033
{"success": true, "error": null, "results": {}}
6,621
0x855550c681081fb751323fc6abf2a6b83414421a
/* Memes, digital videos, and even tweets have sold for millions of dollars as NFTs. So, why are NFTs important and how do they function or hold any value at all? We are thrilled to announce that Domain Money has launched. With our app you can trade stocks and crypto, invest in one of our professionally managed strategies and discover serious control through Domain Signal. Now available in the Apple app store. iOs: https://apple.co/3fyjCbJ Twitter: https://twitter.com/domainmoney Website: https://domainmoney.com/ Reddit: https://www.reddit.com/r/domainmoney/ Facebook: https://www.facebook.com/domainmoney/ */ // 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 DOMAINMONEY is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Domain Money";// string private constant _symbol = "DOMAINMONEY";// 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 = 9; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 19; //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(0xC9d5cc4C9e54F104409751C27c4A340B6E893Af8); address payable private _marketingAddress = payable(0x806D9900cd22fa445C25938e4C59Ec1060684ec1); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 15000000 * 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 { _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 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055e578063dd62ed3e1461057e578063ea1644d5146105c4578063f2fde38b146105e457600080fd5b8063a2a957bb146104d9578063a9059cbb146104f9578063bfd7928414610519578063c3c8cd801461054957600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b957600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f73660046119b3565b610604565b005b34801561020a57600080fd5b5060408051808201909152600c81526b446f6d61696e204d6f6e657960a01b60208201525b60405161023c9190611a78565b60405180910390f35b34801561025157600080fd5b50610265610260366004611acd565b6106a3565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611af9565b6106ba565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611b3a565b610723565b34801561037057600080fd5b506101fc61037f366004611b67565b61076e565b34801561039057600080fd5b506101fc6107b6565b3480156103a557600080fd5b506102c46103b4366004611b3a565b610801565b3480156103c557600080fd5b506101fc610823565b3480156103da57600080fd5b506101fc6103e9366004611b82565b610897565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611b3a565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b67565b6108c6565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b5060408051808201909152600b81526a444f4d41494e4d4f4e455960a81b602082015261022f565b3480156104c557600080fd5b506101fc6104d4366004611b82565b61090e565b3480156104e557600080fd5b506101fc6104f4366004611b9b565b61093d565b34801561050557600080fd5b50610265610514366004611acd565b61097b565b34801561052557600080fd5b50610265610534366004611b3a565b60106020526000908152604090205460ff1681565b34801561055557600080fd5b506101fc610988565b34801561056a57600080fd5b506101fc610579366004611bcd565b6109dc565b34801561058a57600080fd5b506102c4610599366004611c51565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d057600080fd5b506101fc6105df366004611b82565b610a7d565b3480156105f057600080fd5b506101fc6105ff366004611b3a565b610aac565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161062e90611c8a565b60405180910390fd5b60005b815181101561069f5760016010600084848151811061065b5761065b611cbf565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069781611ceb565b91505061063a565b5050565b60006106b0338484610b96565b5060015b92915050565b60006106c7848484610cba565b610719843361071485604051806060016040528060288152602001611e05602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f6565b610b96565b5060019392505050565b6000546001600160a01b0316331461074d5760405162461bcd60e51b815260040161062e90611c8a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107985760405162461bcd60e51b815260040161062e90611c8a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107eb57506013546001600160a01b0316336001600160a01b0316145b6107f457600080fd5b476107fe81611230565b50565b6001600160a01b0381166000908152600260205260408120546106b4906112b5565b6000546001600160a01b0316331461084d5760405162461bcd60e51b815260040161062e90611c8a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c15760405162461bcd60e51b815260040161062e90611c8a565b601655565b6000546001600160a01b031633146108f05760405162461bcd60e51b815260040161062e90611c8a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109385760405162461bcd60e51b815260040161062e90611c8a565b601855565b6000546001600160a01b031633146109675760405162461bcd60e51b815260040161062e90611c8a565b600893909355600a91909155600955600b55565b60006106b0338484610cba565b6012546001600160a01b0316336001600160a01b031614806109bd57506013546001600160a01b0316336001600160a01b0316145b6109c657600080fd5b60006109d130610801565b90506107fe81611339565b6000546001600160a01b03163314610a065760405162461bcd60e51b815260040161062e90611c8a565b60005b82811015610a77578160056000868685818110610a2857610a28611cbf565b9050602002016020810190610a3d9190611b3a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6f81611ceb565b915050610a09565b50505050565b6000546001600160a01b03163314610aa75760405162461bcd60e51b815260040161062e90611c8a565b601755565b6000546001600160a01b03163314610ad65760405162461bcd60e51b815260040161062e90611c8a565b6001600160a01b038116610b3b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062e565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062e565b6001600160a01b038216610c595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062e565b6001600160a01b038216610d805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062e565b60008111610de25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062e565b6000546001600160a01b03848116911614801590610e0e57506000546001600160a01b03838116911614155b156110ef57601554600160a01b900460ff16610ea7576000546001600160a01b03848116911614610ea75760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062e565b601654811115610ef95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062e565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3b57506001600160a01b03821660009081526010602052604090205460ff16155b610f935760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062e565b6015546001600160a01b038381169116146110185760175481610fb584610801565b610fbf9190611d06565b106110185760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062e565b600061102330610801565b60185460165491925082101590821061103c5760165491505b8080156110535750601554600160a81b900460ff16155b801561106d57506015546001600160a01b03868116911614155b80156110825750601554600160b01b900460ff165b80156110a757506001600160a01b03851660009081526005602052604090205460ff16155b80156110cc57506001600160a01b03841660009081526005602052604090205460ff16155b156110ec576110da82611339565b4780156110ea576110ea47611230565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113157506001600160a01b03831660009081526005602052604090205460ff165b8061116357506015546001600160a01b0385811691161480159061116357506015546001600160a01b03848116911614155b15611170575060006111ea565b6015546001600160a01b03858116911614801561119b57506014546001600160a01b03848116911614155b156111ad57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d857506014546001600160a01b03858116911614155b156111ea57600a54600c55600b54600d555b610a77848484846114c2565b6000818484111561121a5760405162461bcd60e51b815260040161062e9190611a78565b5060006112278486611d1e565b95945050505050565b6012546001600160a01b03166108fc61124a8360026114f0565b6040518115909202916000818181858888f19350505050158015611272573d6000803e3d6000fd5b506013546001600160a01b03166108fc61128d8360026114f0565b6040518115909202916000818181858888f1935050505015801561069f573d6000803e3d6000fd5b600060065482111561131c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062e565b6000611326611532565b905061133283826114f0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061138157611381611cbf565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113d557600080fd5b505afa1580156113e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140d9190611d35565b8160018151811061142057611420611cbf565b6001600160a01b0392831660209182029290920101526014546114469130911684610b96565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061147f908590600090869030904290600401611d52565b600060405180830381600087803b15801561149957600080fd5b505af11580156114ad573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114cf576114cf611555565b6114da848484611583565b80610a7757610a77600e54600c55600f54600d55565b600061133283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061167a565b600080600061153f6116a8565b909250905061154e82826114f0565b9250505090565b600c541580156115655750600d54155b1561156c57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611595876116e8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c79087611745565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f69086611787565b6001600160a01b038916600090815260026020526040902055611618816117e6565b6116228483611830565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166791815260200190565b60405180910390a3505050505050505050565b6000818361169b5760405162461bcd60e51b815260040161062e9190611a78565b5060006112278486611dc3565b6006546000908190670de0b6b3a76400006116c382826114f0565b8210156116df57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006117058a600c54600d54611854565b9250925092506000611715611532565b905060008060006117288e8787876118a9565b919e509c509a509598509396509194505050505091939550919395565b600061133283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f6565b6000806117948385611d06565b9050838110156113325760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062e565b60006117f0611532565b905060006117fe83836118f9565b3060009081526002602052604090205490915061181b9082611787565b30600090815260026020526040902055505050565b60065461183d9083611745565b60065560075461184d9082611787565b6007555050565b600080808061186e606461186889896118f9565b906114f0565b9050600061188160646118688a896118f9565b90506000611899826118938b86611745565b90611745565b9992985090965090945050505050565b60008080806118b888866118f9565b905060006118c688876118f9565b905060006118d488886118f9565b905060006118e6826118938686611745565b939b939a50919850919650505050505050565b600082611908575060006106b4565b60006119148385611de5565b9050826119218583611dc3565b146113325760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fe57600080fd5b80356119ae8161198e565b919050565b600060208083850312156119c657600080fd5b823567ffffffffffffffff808211156119de57600080fd5b818501915085601f8301126119f257600080fd5b813581811115611a0457611a04611978565b8060051b604051601f19603f83011681018181108582111715611a2957611a29611978565b604052918252848201925083810185019188831115611a4757600080fd5b938501935b82851015611a6c57611a5d856119a3565b84529385019392850192611a4c565b98975050505050505050565b600060208083528351808285015260005b81811015611aa557858101830151858201604001528201611a89565b81811115611ab7576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611ae057600080fd5b8235611aeb8161198e565b946020939093013593505050565b600080600060608486031215611b0e57600080fd5b8335611b198161198e565b92506020840135611b298161198e565b929592945050506040919091013590565b600060208284031215611b4c57600080fd5b81356113328161198e565b803580151581146119ae57600080fd5b600060208284031215611b7957600080fd5b61133282611b57565b600060208284031215611b9457600080fd5b5035919050565b60008060008060808587031215611bb157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611be257600080fd5b833567ffffffffffffffff80821115611bfa57600080fd5b818601915086601f830112611c0e57600080fd5b813581811115611c1d57600080fd5b8760208260051b8501011115611c3257600080fd5b602092830195509350611c489186019050611b57565b90509250925092565b60008060408385031215611c6457600080fd5b8235611c6f8161198e565b91506020830135611c7f8161198e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cff57611cff611cd5565b5060010190565b60008219821115611d1957611d19611cd5565b500190565b600082821015611d3057611d30611cd5565b500390565b600060208284031215611d4757600080fd5b81516113328161198e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611da25784516001600160a01b031683529383019391830191600101611d7d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611de057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dff57611dff611cd5565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204504b5e7b35aa4ff295b3dcc263e55285636c076df33c9733efd0fb54755359164736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,622
0x353c109eeca9099f6f74c28c1448af151d8d44aa
/** *Submitted for verification at Etherscan.io on 2022-03-23 */ /** *Submitted for verification at Etherscan.io on 2022-01-06 */ /* https://t.me/toxiferate */ //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 Toxiferate 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 = "Toxiferate"; string private constant _symbol = "TOXIFERATE"; 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 = 12; } if (openBlock + 5 >= 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); } }
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103af578063dd62ed3e146103c4578063e98391ff1461040a578063ec28438a1461042a578063f42938901461044a578063ffecf5161461045f57600080fd5b80638da5cb5b146102d457806395d89b41146102fc5780639a5904271461032f5780639b19251a1461034f578063a9059cbb1461036f578063bf6642e71461038f57600080fd5b806327a14fc21161010857806327a14fc21461022e578063313ce5671461024e57806351bc3c851461026a5780635932ead11461027f57806370a082311461029f578063715018a6146102bf57600080fd5b806306fdde0314610150578063095ea7b31461019557806318160ddd146101c557806323b872dd146101ec578063273123b71461020c57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600a815269546f786966657261746560b01b60208201525b60405161018c9190611ac9565b60405180910390f35b3480156101a157600080fd5b506101b56101b0366004611a21565b61047f565b604051901515815260200161018c565b3480156101d157600080fd5b5069152d02c7e14af68000005b60405190815260200161018c565b3480156101f857600080fd5b506101b56102073660046119e1565b610496565b34801561021857600080fd5b5061022c610227366004611971565b6104ff565b005b34801561023a57600080fd5b5061022c610249366004611a84565b610553565b34801561025a57600080fd5b506040516009815260200161018c565b34801561027657600080fd5b5061022c610591565b34801561028b57600080fd5b5061022c61029a366004611a4c565b6105aa565b3480156102ab57600080fd5b506101de6102ba366004611971565b6105f2565b3480156102cb57600080fd5b5061022c610614565b3480156102e057600080fd5b506000546040516001600160a01b03909116815260200161018c565b34801561030857600080fd5b5060408051808201909152600a815269544f584946455241544560b01b602082015261017f565b34801561033b57600080fd5b5061022c61034a366004611971565b610688565b34801561035b57600080fd5b5061022c61036a366004611971565b6106d3565b34801561037b57600080fd5b506101b561038a366004611a21565b610721565b34801561039b57600080fd5b5061022c6103aa366004611a84565b61072e565b3480156103bb57600080fd5b5061022c61075d565b3480156103d057600080fd5b506101de6103df3660046119a9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041657600080fd5b5061022c610425366004611a4c565b610b37565b34801561043657600080fd5b5061022c610445366004611a84565b610b7f565b34801561045657600080fd5b5061022c610bbd565b34801561046b57600080fd5b5061022c61047a366004611971565b610bc7565b600061048c338484610c15565b5060015b92915050565b60006104a3848484610d39565b6104f584336104f085604051806060016040528060288152602001611c69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611220565b610c15565b5060019392505050565b6000546001600160a01b031633146105325760405162461bcd60e51b815260040161052990611b1c565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057d5760405162461bcd60e51b815260040161052990611b1c565b61058b81633b9aca00611bf9565b600d5550565b600061059c306105f2565b90506105a78161125a565b50565b6000546001600160a01b031633146105d45760405162461bcd60e51b815260040161052990611b1c565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b038116600090815260026020526040812054610490906113ff565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161052990611b1c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b25760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106fd5760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600061048c338484610d39565b6000546001600160a01b031633146107585760405162461bcd60e51b815260040161052990611b1c565b600c55565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161052990611b1c565b601354600160a01b900460ff16156107e15760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610529565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561081f308269152d02c7e14af6800000610c15565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085857600080fd5b505afa15801561086c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610890919061198d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108d857600080fd5b505afa1580156108ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610910919061198d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095857600080fd5b505af115801561096c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610990919061198d565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c0816105f2565b6000806109d56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a719190611a9c565b505060138054683635c9adc5dea00000600a55686c6b935b8bbd400000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afb57600080fd5b505af1158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611a68565b5050565b6000546001600160a01b03163314610b615760405162461bcd60e51b815260040161052990611b1c565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610ba95760405162461bcd60e51b815260040161052990611b1c565b610bb781633b9aca00611bf9565b600a5550565b476105a781611483565b6000546001600160a01b03163314610bf15760405162461bcd60e51b815260040161052990611b1c565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610529565b6001600160a01b038216610cd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610529565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610529565b6001600160a01b038216610dff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610529565b60008111610e615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610529565b6001600e55600c600f556000546001600160a01b03848116911614801590610e9757506000546001600160a01b03838116911614155b8015610eac57506001600160a01b0383163014155b8015610ed157506001600160a01b03831660009081526005602052604090205460ff16155b8015610ef657506001600160a01b03821660009081526005602052604090205460ff16155b15611205576001600160a01b03831660009081526006602052604090205460ff16158015610f3d57506001600160a01b03821660009081526006602052604090205460ff16155b610f4657600080fd5b6013546001600160a01b038481169116148015610f7157506012546001600160a01b03838116911614155b8015610f9657506001600160a01b03821660009081526005602052604090205460ff16155b8015610fab5750601354600160b81b900460ff165b156110e857600a548111156110025760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e000000006044820152606401610529565b6001600160a01b038216600090815260076020526040902054421161105e5760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b6044820152606401610529565b600d548161106b846105f2565b6110759190611bc1565b11156110c35760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e0000000000000000006044820152606401610529565b6110ce42601e611bc1565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561111357506012546001600160a01b03848116911614155b801561113857506001600160a01b03831660009081526005602052604090205460ff16155b15611148576001600e55600c600f555b43600b5460056111589190611bc1565b1015801561117357506013546001600160a01b038481169116145b15611183576001600e556063600f555b600061118e306105f2565b600c54909150811080159081906111af5750601354600160a81b900460ff16155b80156111c957506013546001600160a01b03868116911614155b80156111de5750601354600160b01b900460ff165b156111fe576111ec8261125a565b4780156111fc576111fc47611483565b505b5050611210565b6000600e819055600f555b61121b838383611508565b505050565b600081848411156112445760405162461bcd60e51b81526004016105299190611ac9565b5060006112518486611c18565b95945050505050565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112b057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561130457600080fd5b505afa158015611318573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133c919061198d565b8160018151811061135d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546113839130911684610c15565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113bc908590600090869030904290600401611b51565b600060405180830381600087803b1580156113d657600080fd5b505af11580156113ea573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b60006008548211156114665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610529565b6000611470611513565b905061147c8382611536565b9392505050565b6010546001600160a01b03166108fc61149d836002611536565b6040518115909202916000818181858888f193505050501580156114c5573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114e0836002611536565b6040518115909202916000818181858888f19350505050158015610b33573d6000803e3d6000fd5b61121b838383611578565b600080600061152061166f565b909250905061152f8282611536565b9250505090565b600061147c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116b3565b60008060008060008061158a876116e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bc908761173e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115eb9086611780565b6001600160a01b03891660009081526002602052604090205561160d816117df565b6116178483611829565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165c91815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af680000061168c8282611536565b8210156116aa5750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116d45760405162461bcd60e51b81526004016105299190611ac9565b5060006112518486611bd9565b60008060008060008060008060006116fe8a600e54600f5461184d565b925092509250600061170e611513565b905060008060006117218e8787876118a2565b919e509c509a509598509396509194505050505091939550919395565b600061147c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611220565b60008061178d8385611bc1565b90508381101561147c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610529565b60006117e9611513565b905060006117f783836118f2565b306000908152600260205260409020549091506118149082611780565b30600090815260026020526040902055505050565b600854611836908361173e565b6008556009546118469082611780565b6009555050565b6000808080611867606461186189896118f2565b90611536565b9050600061187a60646118618a896118f2565b905060006118928261188c8b8661173e565b9061173e565b9992985090965090945050505050565b60008080806118b188866118f2565b905060006118bf88876118f2565b905060006118cd88886118f2565b905060006118df8261188c868661173e565b939b939a50919850919650505050505050565b60008261190157506000610490565b600061190d8385611bf9565b90508261191a8583611bd9565b1461147c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610529565b600060208284031215611982578081fd5b813561147c81611c45565b60006020828403121561199e578081fd5b815161147c81611c45565b600080604083850312156119bb578081fd5b82356119c681611c45565b915060208301356119d681611c45565b809150509250929050565b6000806000606084860312156119f5578081fd5b8335611a0081611c45565b92506020840135611a1081611c45565b929592945050506040919091013590565b60008060408385031215611a33578182fd5b8235611a3e81611c45565b946020939093013593505050565b600060208284031215611a5d578081fd5b813561147c81611c5a565b600060208284031215611a79578081fd5b815161147c81611c5a565b600060208284031215611a95578081fd5b5035919050565b600080600060608486031215611ab0578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611af557858101830151858201604001528201611ad9565b81811115611b065783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ba05784516001600160a01b031683529383019391830191600101611b7b565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bd457611bd4611c2f565b500190565b600082611bf457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c1357611c13611c2f565b500290565b600082821015611c2a57611c2a611c2f565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105a757600080fd5b80151581146105a757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220910e734dcbb29b86e05f79f32f80c3d26b05f0f9cdae4cb25192730741c9388d64736f6c63430008040033
{"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"}]}}
6,623
0x717882cf9977f2027e0d98ed2b0521ea971d7b23
pragma solidity 0.6.8; 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; } } interface ERC20 { function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint value) external returns (bool success); function transferFrom(address from, address to, uint256 value) external returns (bool success); function approve(address spender, uint value) external returns (bool success); } contract YFMSTokenSale { using SafeMath for uint256; uint256 public totalSold; ERC20 public YFMSToken; address payable public owner; uint256 public collectedETH; uint256 public startDate; bool public softCapMet; bool private presaleClosed = false; uint256 private ethWithdrawals = 0; uint256 private lastWithdrawal; // tracks all contributors. mapping(address => uint256) internal _contributions; // adjusts for different conversion rates. mapping(address => uint256) internal _averagePurchaseRate; // total contributions from wallet. mapping(address => uint256) internal _numberOfContributions; constructor(address _wallet) public { owner = msg.sender; YFMSToken = ERC20(_wallet); } uint256 amount; uint256 rateDay1 = 6; uint256 rateDay2 = 11; uint256 rateDay3 = 5; uint256 rateDay4 = 9; uint256 rateDay5 = 4; // Converts ETH to YFMS and sends new YFMS to the sender receive () external payable { require(startDate > 0 && now.sub(startDate) <= 7 days); require(YFMSToken.balanceOf(address(this)) > 0); require(msg.value >= 0.1 ether && msg.value <= 50 ether); require(!presaleClosed); if (now.sub(startDate) <= 1 days) { amount = msg.value.mul(6); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay1.mul(10)); } else if(now.sub(startDate) > 1 days && now.sub(startDate) <= 2 days) { amount = msg.value.mul(11).div(2); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay2.mul(10).div(2)); } else if(now.sub(startDate) > 2 days && now.sub(startDate) <= 3 days) { amount = msg.value.mul(5); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay3.mul(10)); } else if(now.sub(startDate) > 3 days && now.sub(startDate) <= 4 days) { amount = msg.value.mul(9).div(2); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay4.mul(10).div(2)); } else if(now.sub(startDate) > 4 days) { amount = msg.value.mul(4); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay5.mul(10)); } require(amount <= YFMSToken.balanceOf(address(this))); // update constants. totalSold = totalSold.add(amount); collectedETH = collectedETH.add(msg.value); // update address contribution + total contributions. _contributions[msg.sender] = _contributions[msg.sender].add(amount); _numberOfContributions[msg.sender] = _numberOfContributions[msg.sender].add(1); // transfer the tokens. YFMSToken.transfer(msg.sender, amount); // check if soft cap is met. if (!softCapMet && collectedETH >= 150 ether) { softCapMet = true; } } // Converts ETH to YFMS and sends new YFMS to the sender function contribute() external payable { require(startDate > 0 && now.sub(startDate) <= 7 days); require(YFMSToken.balanceOf(address(this)) > 0); require(msg.value >= 0.1 ether && msg.value <= 50 ether); require(!presaleClosed); if (now.sub(startDate) <= 1 days) { amount = msg.value.mul(6); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay1.mul(10)); } else if(now.sub(startDate) > 1 days && now.sub(startDate) <= 2 days) { amount = msg.value.mul(11).div(2); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay2.mul(10).div(2)); } else if(now.sub(startDate) > 2 days && now.sub(startDate) <= 3 days) { amount = msg.value.mul(5); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay3.mul(10)); } else if(now.sub(startDate) > 3 days && now.sub(startDate) <= 4 days) { amount = msg.value.mul(9).div(2); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay4.mul(10).div(2)); } else if(now.sub(startDate) > 4 days) { amount = msg.value.mul(4); _averagePurchaseRate[msg.sender] = _averagePurchaseRate[msg.sender].add(rateDay5.mul(10)); } require(amount <= YFMSToken.balanceOf(address(this))); // update constants. totalSold = totalSold.add(amount); collectedETH = collectedETH.add(msg.value); // update address contribution + total contributions. _contributions[msg.sender] = _contributions[msg.sender].add(amount); _numberOfContributions[msg.sender] = _numberOfContributions[msg.sender].add(1); // transfer the tokens. YFMSToken.transfer(msg.sender, amount); // check if soft cap is met. if (!softCapMet && collectedETH >= 150 ether) { softCapMet = true; } } function numberOfContributions(address from) public view returns(uint256) { return _numberOfContributions[address(from)]; } function contributions(address from) public view returns(uint256) { return _contributions[address(from)]; } function averagePurchaseRate(address from) public view returns(uint256) { return _averagePurchaseRate[address(from)]; } // if the soft cap isn't met and the presale period ends (7 days) enable // users to buy back their ether. function buyBackETH(address payable from) public { require(now.sub(startDate) > 7 days && !softCapMet); require(_contributions[from] > 0); uint256 exchangeRate = _averagePurchaseRate[from].div(10).div(_numberOfContributions[from]); uint256 contribution = _contributions[from]; // remove funds from users contributions. _contributions[from] = 0; // transfer funds back to user. from.transfer(contribution.div(exchangeRate)); } // Function to withdraw raised ETH (staggered withdrawals) // Only the contract owner can call this function function withdrawETH() public { require(msg.sender == owner && address(this).balance > 0); require(softCapMet == true && presaleClosed == true); uint256 withdrawAmount; // first ether withdrawal (max 500 ETH) if (ethWithdrawals == 0) { if (collectedETH <= 500 ether) { withdrawAmount = collectedETH; } else { withdrawAmount = 500 ether; } } else { // remaining ether withdrawal (max 500 ETH per withdrawal) // staggered in 7 day periods. uint256 currDate = now; // ensure that it has been at least 7 days. require(currDate.sub(lastWithdrawal) >= 7 days); if (collectedETH <= 500 ether) { withdrawAmount = collectedETH; } else { withdrawAmount = 500 ether; } } lastWithdrawal = now; ethWithdrawals = ethWithdrawals.add(1); collectedETH = collectedETH.sub(withdrawAmount); owner.transfer(withdrawAmount); } function endPresale() public { require(msg.sender == owner); presaleClosed = true; } // Function to burn remaining YFMS (sale must be over to call) // Only the contract owner can call this function function burnYFMS() public { require(msg.sender == owner && YFMSToken.balanceOf(address(this)) > 0 && now.sub(startDate) > 7 days); // burn the left over. YFMSToken.transfer(address(0), YFMSToken.balanceOf(address(this))); } //Starts the sale //Only the contract owner can call this function function startSale() public { require(msg.sender == owner && startDate==0); startDate=now; } //Function to query the supply of YFMS in the contract function availableYFMS() public view returns(uint256) { return YFMSToken.balanceOf(address(this)); } }
0x6080604052600436106100f75760003560e01c8063b6ce75311161008a578063df69292911610059578063df69292914610dc9578063dfccdef514610e2e578063e086e5ec14610e59578063ef2d75fe14610e7057610b13565b8063b6ce753114610d14578063be3853c914610d3f578063d7bb99ba14610d90578063dd1da86214610d9a57610b13565b80638da5cb5b116100c65780638da5cb5b14610c645780639106d7ba14610cbb578063a43be57b14610ce6578063b66a0e5d14610cfd57610b13565b8063021e63c114610b185780630b97bc8614610b6f57806342e94c9014610b9a5780638cf59dc814610bff57610b13565b36610b13576000600454118015610125575062093a8061012260045442610e8790919063ffffffff16565b11155b61012e57600080fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156101cf57600080fd5b505afa1580156101e3573d6000803e3d6000fd5b505050506040513d60208110156101f957600080fd5b81019080805190602001909291905050501161021457600080fd5b67016345785d8a0000341015801561023557506802b5e3af16b18800003411155b61023e57600080fd5b600560019054906101000a900460ff161561025857600080fd5b6201518061027160045442610e8790919063ffffffff16565b1161033f5761028a600634610ea790919063ffffffff16565b600b819055506102f76102a9600a600c54610ea790919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610794565b6201518061035860045442610e8790919063ffffffff16565b11801561037c57506202a30061037960045442610e8790919063ffffffff16565b11155b15610470576103a8600261039a600b34610ea790919063ffffffff16565b610f0090919063ffffffff16565b600b819055506104286103da60026103cc600a600d54610ea790919063ffffffff16565b610f0090919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610793565b6202a30061048960045442610e8790919063ffffffff16565b1180156104ad57506203f4806104aa60045442610e8790919063ffffffff16565b11155b1561057b576104c6600534610ea790919063ffffffff16565b600b819055506105336104e5600a600e54610ea790919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610792565b6203f48061059460045442610e8790919063ffffffff16565b1180156105b85750620546006105b560045442610e8790919063ffffffff16565b11155b156106ac576105e460026105d6600934610ea790919063ffffffff16565b610f0090919063ffffffff16565b600b819055506106646106166002610608600a600f54610ea790919063ffffffff16565b610f0090919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610791565b620546006106c560045442610e8790919063ffffffff16565b1115610790576106df600434610ea790919063ffffffff16565b600b8190555061074c6106fe600a601054610ea790919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561083357600080fd5b505afa158015610847573d6000803e3d6000fd5b505050506040513d602081101561085d57600080fd5b8101908080519060200190929190505050600b54111561087c57600080fd5b610893600b54600054610ee190919063ffffffff16565b6000819055506108ae34600354610ee190919063ffffffff16565b600381905550610908600b54600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061099e6001600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33600b546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a8c57600080fd5b505af1158015610aa0573d6000803e3d6000fd5b505050506040513d6020811015610ab657600080fd5b810190808051906020019092919050505050600560009054906101000a900460ff16158015610af05750680821ab0d441498000060035410155b15610b11576001600560006101000a81548160ff0219169083151502179055505b005b600080fd5b348015610b2457600080fd5b50610b2d610f26565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b7b57600080fd5b50610b84610f4c565b6040518082815260200191505060405180910390f35b348015610ba657600080fd5b50610be960048036036020811015610bbd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f52565b6040518082815260200191505060405180910390f35b348015610c0b57600080fd5b50610c4e60048036036020811015610c2257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f9b565b6040518082815260200191505060405180910390f35b348015610c7057600080fd5b50610c79610fe4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610cc757600080fd5b50610cd061100a565b6040518082815260200191505060405180910390f35b348015610cf257600080fd5b50610cfb611010565b005b348015610d0957600080fd5b50610d12611087565b005b348015610d2057600080fd5b50610d296110f8565b6040518082815260200191505060405180910390f35b348015610d4b57600080fd5b50610d8e60048036036020811015610d6257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111d9565b005b610d986113f0565b005b348015610da657600080fd5b50610daf611e07565b604051808215151515815260200191505060405180910390f35b348015610dd557600080fd5b50610e1860048036036020811015610dec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e1a565b6040518082815260200191505060405180910390f35b348015610e3a57600080fd5b50610e43611e63565b6040518082815260200191505060405180910390f35b348015610e6557600080fd5b50610e6e611e69565b005b348015610e7c57600080fd5b50610e85612046565b005b600082821115610e9657600080fd5b600082840390508091505092915050565b600080831415610eba5760009050610edb565b6000828402905082848281610ecb57fe5b0414610ed657600080fd5b809150505b92915050565b600080828401905083811015610ef657600080fd5b8091505092915050565b6000808211610f0e57600080fd5b6000828481610f1957fe5b0490508091505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60005481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461106a57600080fd5b6001600560016101000a81548160ff021916908315150217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480156110e657506000600454145b6110ef57600080fd5b42600481905550565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561119957600080fd5b505afa1580156111ad573d6000803e3d6000fd5b505050506040513d60208110156111c357600080fd5b8101908080519060200190929190505050905090565b62093a806111f260045442610e8790919063ffffffff16565b11801561120c5750600560009054906101000a900460ff16155b61121557600080fd5b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541161126157600080fd5b6000611307600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112f9600a600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f0090919063ffffffff16565b610f0090919063ffffffff16565b90506000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff166108fc6113bf8484610f0090919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156113ea573d6000803e3d6000fd5b50505050565b6000600454118015611419575062093a8061141660045442610e8790919063ffffffff16565b11155b61142257600080fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156114c357600080fd5b505afa1580156114d7573d6000803e3d6000fd5b505050506040513d60208110156114ed57600080fd5b81019080805190602001909291905050501161150857600080fd5b67016345785d8a0000341015801561152957506802b5e3af16b18800003411155b61153257600080fd5b600560019054906101000a900460ff161561154c57600080fd5b6201518061156560045442610e8790919063ffffffff16565b116116335761157e600634610ea790919063ffffffff16565b600b819055506115eb61159d600a600c54610ea790919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a88565b6201518061164c60045442610e8790919063ffffffff16565b11801561167057506202a30061166d60045442610e8790919063ffffffff16565b11155b156117645761169c600261168e600b34610ea790919063ffffffff16565b610f0090919063ffffffff16565b600b8190555061171c6116ce60026116c0600a600d54610ea790919063ffffffff16565b610f0090919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a87565b6202a30061177d60045442610e8790919063ffffffff16565b1180156117a157506203f48061179e60045442610e8790919063ffffffff16565b11155b1561186f576117ba600534610ea790919063ffffffff16565b600b819055506118276117d9600a600e54610ea790919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a86565b6203f48061188860045442610e8790919063ffffffff16565b1180156118ac5750620546006118a960045442610e8790919063ffffffff16565b11155b156119a0576118d860026118ca600934610ea790919063ffffffff16565b610f0090919063ffffffff16565b600b8190555061195861190a60026118fc600a600f54610ea790919063ffffffff16565b610f0090919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a85565b620546006119b960045442610e8790919063ffffffff16565b1115611a84576119d3600434610ea790919063ffffffff16565b600b81905550611a406119f2600a601054610ea790919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5b5b5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611b2757600080fd5b505afa158015611b3b573d6000803e3d6000fd5b505050506040513d6020811015611b5157600080fd5b8101908080519060200190929190505050600b541115611b7057600080fd5b611b87600b54600054610ee190919063ffffffff16565b600081905550611ba234600354610ee190919063ffffffff16565b600381905550611bfc600b54600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c926001600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ee190919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33600b546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611d8057600080fd5b505af1158015611d94573d6000803e3d6000fd5b505050506040513d6020811015611daa57600080fd5b810190808051906020019092919050505050600560009054906101000a900460ff16158015611de45750680821ab0d441498000060035410155b15611e05576001600560006101000a81548160ff0219169083151502179055505b565b600560009054906101000a900460ff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60035481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148015611ec65750600047115b611ecf57600080fd5b60011515600560009054906101000a900460ff161515148015611f05575060011515600560019054906101000a900460ff161515145b611f0e57600080fd5b6000806006541415611f4857681b1ae4d6e2ef50000060035411611f36576003549050611f43565b681b1ae4d6e2ef50000090505b611f9c565b600042905062093a80611f6660075483610e8790919063ffffffff16565b1015611f7157600080fd5b681b1ae4d6e2ef50000060035411611f8d576003549150611f9a565b681b1ae4d6e2ef50000091505b505b42600781905550611fb96001600654610ee190919063ffffffff16565b600681905550611fd481600354610e8790919063ffffffff16565b600381905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612042573d6000803e3d6000fd5b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614801561217c57506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561213f57600080fd5b505afa158015612153573d6000803e3d6000fd5b505050506040513d602081101561216957600080fd5b8101908080519060200190929190505050115b801561219e575062093a8061219c60045442610e8790919063ffffffff16565b115b6121a757600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561228657600080fd5b505afa15801561229a573d6000803e3d6000fd5b505050506040513d60208110156122b057600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561232a57600080fd5b505af115801561233e573d6000803e3d6000fd5b505050506040513d602081101561235457600080fd5b81019080805190602001909291905050505056fea26469706673582212203585948e5558a2a03408cf0b9f7c3c19d86238de55e909216e899e8236a9d98964736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
6,624
0x8f04c3f091b94e1997cd06f3c20199f3685c94cc
pragma solidity ^0.4.18; // zeppelin-solidity: 1.5.0 /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @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 Object is StandardToken, Ownable { string public name; string public symbol; uint8 public constant decimals = 18; bool public mintingFinished = false; event Burn(address indexed burner, uint value); event Mint(address indexed to, uint amount); event MintFinished(); modifier canMint() { require(!mintingFinished); _; } function Object(string _name, string _symbol) public { name = _name; symbol = _symbol; } function burn(uint _value) public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } function mint(address _to, uint _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; } function finishMinting() onlyOwner canMint public returns(bool) { mintingFinished = true; MintFinished(); return true; } function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); require(_value % (1 ether) == 0); // require whole token transfers // 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; } }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610123578063095ea7b3146101b157806318160ddd1461020b57806323b872dd14610234578063313ce567146102ad57806340c10f19146102dc57806342966c6814610336578063661884631461035957806370a08231146103b35780637d64bcb4146104005780638da5cb5b1461042d57806395d89b4114610482578063a9059cbb14610510578063d73dd6231461056a578063dd62ed3e146105c4578063f2fde38b14610630575b600080fd5b341561010157600080fd5b610109610669565b604051808215151515815260200191505060405180910390f35b341561012e57600080fd5b61013661067c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017657808201518184015260208101905061015b565b50505050905090810190601f1680156101a35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bc57600080fd5b6101f1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061071a565b604051808215151515815260200191505060405180910390f35b341561021657600080fd5b61021e61080c565b6040518082815260200191505060405180910390f35b341561023f57600080fd5b610293600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610812565b604051808215151515815260200191505060405180910390f35b34156102b857600080fd5b6102c0610bd1565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e757600080fd5b61031c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bd6565b604051808215151515815260200191505060405180910390f35b341561034157600080fd5b6103576004808035906020019091905050610dbe565b005b341561036457600080fd5b610399600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f13565b604051808215151515815260200191505060405180910390f35b34156103be57600080fd5b6103ea600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506111a4565b6040518082815260200191505060405180910390f35b341561040b57600080fd5b6104136111ed565b604051808215151515815260200191505060405180910390f35b341561043857600080fd5b6104406112b5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561048d57600080fd5b6104956112db565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d55780820151818401526020810190506104ba565b50505050905090810190601f1680156105025780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561051b57600080fd5b610550600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611379565b604051808215151515815260200191505060405180910390f35b341561057557600080fd5b6105aa600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115bf565b604051808215151515815260200191505060405180910390f35b34156105cf57600080fd5b61061a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117bb565b6040518082815260200191505060405180910390f35b341561063b57600080fd5b610667600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611842565b005b600660009054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107125780601f106106e757610100808354040283529160200191610712565b820191906000526020600020905b8154815290600101906020018083116106f557829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561084f57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561089d57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561092857600080fd5b61097a82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199a90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a0f82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ae182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3457600080fd5b600660009054906101000a900460ff16151515610c5057600080fd5b610c65826000546119b390919063ffffffff16565b600081905550610cbd82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e0e57600080fd5b339050610e6382600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199a90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ebb8260005461199a90919063ffffffff16565b6000819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611024576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110b8565b611037838261199a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561124b57600080fd5b600660009054906101000a900460ff1615151561126757600080fd5b6001600660006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113715780601f1061134657610100808354040283529160200191611371565b820191906000526020600020905b81548152906001019060200180831161135457829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113b657600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561140457600080fd5b6000670de0b6b3a76400008381151561141957fe5b0614151561142657600080fd5b61147882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461199a90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061150d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061165082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119b390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189e57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156118da57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156119a857fe5b818303905092915050565b60008082840190508381101515156119c757fe5b80915050929150505600a165627a7a723058207fa3ef8de074600e8cd200cc3e8758e54c268c210cc8d10b2ee5c0e0972f5df20029
{"success": true, "error": null, "results": {}}
6,625
0xb17c57d1431d0f14a2bf44c72f4fbe3e656ec85d
// Unattributed material copyright New Alchemy Limited, 2017. All rights reserved. pragma solidity >=0.4.10; // from Zeppelin contract SafeMath { function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; require(a == 0 || c / a == b); return c; } function safeSub(uint a, uint b) internal returns (uint) { require(b <= a); return a - b; } function safeAdd(uint a, uint b) internal returns (uint) { uint c = a + b; require(c>=a && c>=b); return c; } } // end from Zeppelin contract Owned { address public owner; address newOwner; function Owned() { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function changeOwner(address _newOwner) onlyOwner { newOwner = _newOwner; } function acceptOwnership() { if (msg.sender == newOwner) { owner = newOwner; } } } contract Pausable is Owned { bool public paused; function pause() onlyOwner { paused = true; } function unpause() onlyOwner { paused = false; } modifier notPaused() { require(!paused); _; } } contract Finalizable is Owned { bool public finalized; function finalize() onlyOwner { finalized = true; } modifier notFinalized() { require(!finalized); _; } } contract IToken { function transfer(address _to, uint _value) returns (bool); function balanceOf(address owner) returns(uint); } contract TokenReceivable is Owned { function claimTokens(address _token, address _to) onlyOwner returns (bool) { IToken token = IToken(_token); return token.transfer(_to, token.balanceOf(this)); } } contract EventDefinitions { event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Token is Finalizable, TokenReceivable, SafeMath, EventDefinitions, Pausable { string constant public name = "DOC Token"; uint8 constant public decimals = 18; string constant public symbol = "DOC"; Controller public controller; string public motd; event Motd(string message); // functions below this line are onlyOwner function setMotd(string _m) onlyOwner { motd = _m; Motd(_m); } function setController(address _c) onlyOwner notFinalized { controller = Controller(_c); } // functions below this line are public function balanceOf(address a) constant returns (uint) { return controller.balanceOf(a); } function totalSupply() constant returns (uint) { return controller.totalSupply(); } function allowance(address _owner, address _spender) constant returns (uint) { return controller.allowance(_owner, _spender); } function transfer(address _to, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.transfer(msg.sender, _to, _value)) { Transfer(msg.sender, _to, _value); return true; } return false; } function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3) notPaused returns (bool success) { if (controller.transferFrom(msg.sender, _from, _to, _value)) { Transfer(_from, _to, _value); return true; } return false; } function approve(address _spender, uint _value) onlyPayloadSize(2) notPaused returns (bool success) { // promote safe user behavior if (controller.approve(msg.sender, _spender, _value)) { Approval(msg.sender, _spender, _value); return true; } return false; } function increaseApproval (address _spender, uint _addedValue) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.increaseApproval(msg.sender, _spender, _addedValue)) { uint newval = controller.allowance(msg.sender, _spender); Approval(msg.sender, _spender, newval); return true; } return false; } function decreaseApproval (address _spender, uint _subtractedValue) onlyPayloadSize(2) notPaused returns (bool success) { if (controller.decreaseApproval(msg.sender, _spender, _subtractedValue)) { uint newval = controller.allowance(msg.sender, _spender); Approval(msg.sender, _spender, newval); return true; } return false; } modifier onlyPayloadSize(uint numwords) { assert(msg.data.length >= numwords * 32 + 4); _; } function burn(uint _amount) notPaused { controller.burn(msg.sender, _amount); Transfer(msg.sender, 0x0, _amount); } // functions below this line are onlyController modifier onlyController() { assert(msg.sender == address(controller)); _; } function controllerTransfer(address _from, address _to, uint _value) onlyController { Transfer(_from, _to, _value); } function controllerApprove(address _owner, address _spender, uint _value) onlyController { Approval(_owner, _spender, _value); } } contract Controller is Owned, Finalizable { Ledger public ledger; Token public token; function Controller() { } // functions below this line are onlyOwner function setToken(address _token) onlyOwner { token = Token(_token); } function setLedger(address _ledger) onlyOwner { ledger = Ledger(_ledger); } modifier onlyToken() { require(msg.sender == address(token)); _; } modifier onlyLedger() { require(msg.sender == address(ledger)); _; } // public functions function totalSupply() constant returns (uint) { return ledger.totalSupply(); } function balanceOf(address _a) constant returns (uint) { return ledger.balanceOf(_a); } function allowance(address _owner, address _spender) constant returns (uint) { return ledger.allowance(_owner, _spender); } // functions below this line are onlyLedger function ledgerTransfer(address from, address to, uint val) onlyLedger { token.controllerTransfer(from, to, val); } // functions below this line are onlyToken function transfer(address _from, address _to, uint _value) onlyToken returns (bool success) { return ledger.transfer(_from, _to, _value); } function transferFrom(address _spender, address _from, address _to, uint _value) onlyToken returns (bool success) { return ledger.transferFrom(_spender, _from, _to, _value); } function approve(address _owner, address _spender, uint _value) onlyToken returns (bool success) { return ledger.approve(_owner, _spender, _value); } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyToken returns (bool success) { return ledger.increaseApproval(_owner, _spender, _addedValue); } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyToken returns (bool success) { return ledger.decreaseApproval(_owner, _spender, _subtractedValue); } function burn(address _owner, uint _amount) onlyToken { ledger.burn(_owner, _amount); } } contract Ledger is Owned, SafeMath, Finalizable, TokenReceivable { Controller public controller; mapping(address => uint) public balanceOf; mapping (address => mapping (address => uint)) public allowance; uint public totalSupply; uint public mintingNonce; bool public mintingStopped; // functions below this line are onlyOwner function Ledger() { } function setController(address _controller) onlyOwner notFinalized { controller = Controller(_controller); } function stopMinting() onlyOwner { mintingStopped = true; } function multiMint(uint nonce, uint256[] bits) external onlyOwner { require(!mintingStopped); if (nonce != mintingNonce) return; mintingNonce += 1; uint256 lomask = (1 << 96) - 1; uint created = 0; for (uint i=0; i<bits.length; i++) { address a = address(bits[i]>>96); uint value = bits[i]&lomask; balanceOf[a] = balanceOf[a] + value; controller.ledgerTransfer(0, a, value); created += value; } totalSupply += created; } // functions below this line are onlyController modifier onlyController() { require(msg.sender == address(controller)); _; } function transfer(address _from, address _to, uint _value) onlyController returns (bool success) { if (balanceOf[_from] < _value) return false; balanceOf[_from] = safeSub(balanceOf[_from], _value); balanceOf[_to] = safeAdd(balanceOf[_to], _value); return true; } function transferFrom(address _spender, address _from, address _to, uint _value) onlyController returns (bool success) { if (balanceOf[_from] < _value) return false; var allowed = allowance[_from][_spender]; if (allowed < _value) return false; balanceOf[_to] = safeAdd(balanceOf[_to], _value); balanceOf[_from] = safeSub(balanceOf[_from], _value); allowance[_from][_spender] = safeSub(allowed, _value); return true; } function approve(address _owner, address _spender, uint _value) onlyController returns (bool success) { // require user to set to zero before resetting to nonzero if ((_value != 0) && (allowance[_owner][_spender] != 0)) { return false; } allowance[_owner][_spender] = _value; return true; } function increaseApproval (address _owner, address _spender, uint _addedValue) onlyController returns (bool success) { uint oldValue = allowance[_owner][_spender]; allowance[_owner][_spender] = safeAdd(oldValue, _addedValue); return true; } function decreaseApproval (address _owner, address _spender, uint _subtractedValue) onlyController returns (bool success) { uint oldValue = allowance[_owner][_spender]; if (_subtractedValue > oldValue) { allowance[_owner][_spender] = 0; } else { allowance[_owner][_spender] = safeSub(oldValue, _subtractedValue); } return true; } function burn(address _owner, uint _amount) onlyController { balanceOf[_owner] = safeSub(balanceOf[_owner], _amount); totalSupply = safeSub(totalSupply, _amount); } }
0x6060604052600436106101455763ffffffff60e060020a60003504166306fdde03811461014a578063095ea7b3146101d457806318160ddd1461020a57806323b872dd1461022f578063313ce567146102575780633f4ba83a1461028057806342966c68146102955780634bb278f3146102ab5780635aab4ac8146102be5780635c975abb146102d15780635fe59b9d146102e4578063661884631461033557806369ffa08a1461035757806370a082311461037c57806379ba50971461039b5780638456cb59146103ae5780638da5cb5b146103c15780638e339b66146103f057806392eefe9b1461041857806395d89b41146104375780639b5043871461044a578063a6f9dae114610472578063a9059cbb14610491578063b3f05b97146104b3578063d73dd623146104c6578063dd62ed3e146104e8578063f77c47911461050d575b600080fd5b341561015557600080fd5b61015d610520565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610199578082015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101df57600080fd5b6101f6600160a060020a0360043516602435610557565b604051901515815260200160405180910390f35b341561021557600080fd5b61021d610665565b60405190815260200160405180910390f35b341561023a57600080fd5b6101f6600160a060020a03600435811690602435166044356106cf565b341561026257600080fd5b61026a6107d3565b60405160ff909116815260200160405180910390f35b341561028b57600080fd5b6102936107d8565b005b34156102a057600080fd5b610293600435610814565b34156102b657600080fd5b6102936108c5565b34156102c957600080fd5b61015d610917565b34156102dc57600080fd5b6101f66109b5565b34156102ef57600080fd5b61029360046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506109c595505050505050565b341561034057600080fd5b6101f6600160a060020a0360043516602435610a8f565b341561036257600080fd5b6101f6600160a060020a0360043581169060243516610c1d565b341561038757600080fd5b61021d600160a060020a0360043516610d24565b34156103a657600080fd5b610293610d9f565b34156103b957600080fd5b610293610de8565b34156103cc57600080fd5b6103d4610e2a565b604051600160a060020a03909116815260200160405180910390f35b34156103fb57600080fd5b610293600160a060020a0360043581169060243516604435610e39565b341561042357600080fd5b610293600160a060020a0360043516610e9d565b341561044257600080fd5b61015d610f0f565b341561045557600080fd5b610293600160a060020a0360043581169060243516604435610f46565b341561047d57600080fd5b610293600160a060020a0360043516610f98565b341561049c57600080fd5b6101f6600160a060020a0360043516602435610fe2565b34156104be57600080fd5b6101f66110d2565b34156104d157600080fd5b6101f6600160a060020a03600435166024356110f3565b34156104f357600080fd5b61021d600160a060020a0360043581169060243516611186565b341561051857600080fd5b6103d461120a565b60408051908101604052600981527f444f4320546f6b656e0000000000000000000000000000000000000000000000602082015281565b60006002604436101561056657fe5b60015460a860020a900460ff161561057d57600080fd5b600254600160a060020a031663e1f21c6733868660006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156105e957600080fd5b6102c65a03f115156105fa57600080fd5b50505060405180519050156106595783600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258560405190815260200160405180910390a36001915061065e565b600091505b5092915050565b600254600090600160a060020a03166318160ddd82604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156106af57600080fd5b6102c65a03f115156106c057600080fd5b50505060405180519150505b90565b6000600360643610156106de57fe5b60015460a860020a900460ff16156106f557600080fd5b600254600160a060020a03166315dacbea3387878760006040516020015260405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401602060405180830381600087803b151561076857600080fd5b6102c65a03f1151561077957600080fd5b50505060405180519050156107c65783600160a060020a031685600160a060020a03166000805160206112b28339815191528560405190815260200160405180910390a3600191506107cb565b600091505b509392505050565b601281565b60005433600160a060020a039081169116146107f357600080fd5b6001805475ff00000000000000000000000000000000000000000019169055565b60015460a860020a900460ff161561082b57600080fd5b600254600160a060020a0316639dc29fac338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561088157600080fd5b6102c65a03f1151561089257600080fd5b505050600033600160a060020a03166000805160206112b28339815191528360405190815260200160405180910390a350565b60005433600160a060020a039081169116146108e057600080fd5b6001805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109ad5780601f10610982576101008083540402835291602001916109ad565b820191906000526020600020905b81548152906001019060200180831161099057829003601f168201915b505050505081565b60015460a860020a900460ff1681565b60005433600160a060020a039081169116146109e057600080fd5b60038180516109f3929160200190611219565b507f6e7666d68b6b7c619b2fe5a2c3dd0564bf3e02b0508b217d7a28ce5805583eab8160405160208082528190810183818151815260200191508051906020019080838360005b83811015610a52578082015183820152602001610a3a565b50505050905090810190601f168015610a7f5780820380516001836020036101000a031916815260200191505b509250505060405180910390a150565b60008060026044361015610a9f57fe5b60015460a860020a900460ff1615610ab657600080fd5b600254600160a060020a031663f019c26733878760006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610b2257600080fd5b6102c65a03f11515610b3357600080fd5b5050506040518051905015610c1057600254600160a060020a031663dd62ed3e338760006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b1515610ba357600080fd5b6102c65a03f11515610bb457600080fd5b50505060405180519050915084600160a060020a031633600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405190815260200160405180910390a360019250610c15565b600092505b505092915050565b60008054819033600160a060020a03908116911614610c3b57600080fd5b5082600160a060020a03811663a9059cbb84826370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610c9b57600080fd5b6102c65a03f11515610cac57600080fd5b5050506040518051905060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610d0257600080fd5b6102c65a03f11515610d1357600080fd5b505050604051805195945050505050565b600254600090600160a060020a03166370a0823183836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610d7f57600080fd5b6102c65a03f11515610d9057600080fd5b50505060405180519392505050565b60015433600160a060020a0390811691161415610de6576001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b565b60005433600160a060020a03908116911614610e0357600080fd5b6001805475ff000000000000000000000000000000000000000000191660a860020a179055565b600054600160a060020a031681565b60025433600160a060020a03908116911614610e5157fe5b81600160a060020a031683600160a060020a03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405190815260200160405180910390a3505050565b60005433600160a060020a03908116911614610eb857600080fd5b60015474010000000000000000000000000000000000000000900460ff1615610ee057600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600381527f444f430000000000000000000000000000000000000000000000000000000000602082015281565b60025433600160a060020a03908116911614610f5e57fe5b81600160a060020a031683600160a060020a03166000805160206112b28339815191528360405190815260200160405180910390a3505050565b60005433600160a060020a03908116911614610fb357600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600060026044361015610ff157fe5b60015460a860020a900460ff161561100857600080fd5b600254600160a060020a031663beabacc833868660006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561107457600080fd5b6102c65a03f1151561108557600080fd5b50505060405180519050156106595783600160a060020a031633600160a060020a03166000805160206112b28339815191528560405190815260200160405180910390a36001915061065e565b60015474010000000000000000000000000000000000000000900460ff1681565b6000806002604436101561110357fe5b60015460a860020a900460ff161561111a57600080fd5b600254600160a060020a031663bcdd612133878760006040516020015260405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610b2257600080fd5b600254600090600160a060020a031663dd62ed3e8484846040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b15156111e957600080fd5b6102c65a03f115156111fa57600080fd5b5050506040518051949350505050565b600254600160a060020a031681565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061125a57805160ff1916838001178555611287565b82800160010185558215611287579182015b8281111561128757825182559160200191906001019061126c565b50611293929150611297565b5090565b6106cc91905b80821115611293576000815560010161129d5600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820c12123da5426b754a4023f1f013c491e39ab9d05c214672aa11ec14cf7a0cc0e0029
{"success": true, "error": null, "results": {}}
6,626
0x96e7a89978f60501d42c9dd0ea8f794b99cef4dd
/* Telegram: https://t.me/LelouchInu */ pragma solidity ^0.8.3; 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 LelouchInu 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; string private constant _name = "LelouchInu"; string private constant _symbol = "LELOUCH"; uint8 private constant _decimals = 18; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable addr1, address payable addr2) { _FeeAddress = addr1; _marketingWalletAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_FeeAddress] = true; _isExcludedFromFee[_marketingWalletAddress] = true; emit Transfer(address(0x929242B1Eb71b05Ce9319fa902983Dce3c0383E1), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 1; _teamFee = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 2; _teamFee = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 100000000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f7578063c3c8cd8014610317578063c9567bf91461032c578063d543dbeb14610341578063dd62ed3e1461036157600080fd5b8063715018a61461026a5780638da5cb5b1461027f57806395d89b41146102a7578063a9059cbb146102d757600080fd5b8063273123b7116100dc578063273123b7146101d7578063313ce567146101f95780635932ead1146102155780636fc3eaec1461023557806370a082311461024a57600080fd5b806306fdde0314610119578063095ea7b31461015e57806318160ddd1461018e57806323b872dd146101b757600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a8152694c656c6f756368496e7560b01b60208201525b604051610155919061197d565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611804565b6103a7565b6040519015158152602001610155565b34801561019a57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610155565b3480156101c357600080fd5b5061017e6101d23660046117c3565b6103be565b3480156101e357600080fd5b506101f76101f2366004611750565b610427565b005b34801561020557600080fd5b5060405160128152602001610155565b34801561022157600080fd5b506101f76102303660046118fc565b61047b565b34801561024157600080fd5b506101f76104c3565b34801561025657600080fd5b506101a9610265366004611750565b6104f0565b34801561027657600080fd5b506101f7610512565b34801561028b57600080fd5b506000546040516001600160a01b039091168152602001610155565b3480156102b357600080fd5b506040805180820190915260078152660988a989eaa86960cb1b6020820152610148565b3480156102e357600080fd5b5061017e6102f2366004611804565b610586565b34801561030357600080fd5b506101f7610312366004611830565b610593565b34801561032357600080fd5b506101f7610629565b34801561033857600080fd5b506101f761065f565b34801561034d57600080fd5b506101f761035c366004611936565b610a28565b34801561036d57600080fd5b506101a961037c36600461178a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b4338484610afe565b5060015b92915050565b60006103cb848484610c22565b61041d843361041885604051806060016040528060288152602001611b69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fbc565b610afe565b5060019392505050565b6000546001600160a01b0316331461045a5760405162461bcd60e51b8152600401610451906119d2565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104a55760405162461bcd60e51b8152600401610451906119d2565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104e357600080fd5b476104ed81610ff6565b50565b6001600160a01b0381166000908152600260205260408120546103b89061107b565b6000546001600160a01b0316331461053c5760405162461bcd60e51b8152600401610451906119d2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b4338484610c22565b6000546001600160a01b031633146105bd5760405162461bcd60e51b8152600401610451906119d2565b60005b8151811015610625576001600660008484815181106105e1576105e1611b19565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061061d81611ae8565b9150506105c0565b5050565b600e546001600160a01b0316336001600160a01b03161461064957600080fd5b6000610654306104f0565b90506104ed816110ff565b6000546001600160a01b031633146106895760405162461bcd60e51b8152600401610451906119d2565b601154600160a01b900460ff16156106e35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610451565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072330826b033b2e3c9fd0803ce8000000610afe565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561075c57600080fd5b505afa158015610770573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610794919061176d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107dc57600080fd5b505afa1580156107f0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610814919061176d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561085c57600080fd5b505af1158015610870573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610894919061176d565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306108c4816104f0565b6000806108d96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561093c57600080fd5b505af1158015610950573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610975919061194f565b5050601180546a52b7d2dcc80cd2e400000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f057600080fd5b505af1158015610a04573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106259190611919565b6000546001600160a01b03163314610a525760405162461bcd60e51b8152600401610451906119d2565b60008111610aa25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610451565b610ac36064610abd6b033b2e3c9fd0803ce800000084611288565b90611307565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b605760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610451565b6001600160a01b038216610bc15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610451565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c865760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610451565b6001600160a01b038216610ce85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610451565b60008111610d4a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610451565b6001600a556009600b556000546001600160a01b03848116911614801590610d8057506000546001600160a01b03838116911614155b15610f5f576001600160a01b03831660009081526006602052604090205460ff16158015610dc757506001600160a01b03821660009081526006602052604090205460ff16155b610dd057600080fd5b6011546001600160a01b038481169116148015610dfb57506010546001600160a01b03838116911614155b8015610e2057506001600160a01b03821660009081526005602052604090205460ff16155b8015610e355750601154600160b81b900460ff165b15610e9257601254811115610e4957600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6d57600080fd5b610e7842601e611a78565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610ebd57506010546001600160a01b03848116911614155b8015610ee257506001600160a01b03831660009081526005602052604090205460ff16155b15610ef2576002600a908155600b555b6000610efd306104f0565b601154909150600160a81b900460ff16158015610f2857506011546001600160a01b03858116911614155b8015610f3d5750601154600160b01b900460ff165b15610f5d57610f4b816110ff565b478015610f5b57610f5b47610ff6565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fa157506001600160a01b03831660009081526005602052604090205460ff165b15610faa575060005b610fb684848484611349565b50505050565b60008184841115610fe05760405162461bcd60e51b8152600401610451919061197d565b506000610fed8486611ad1565b95945050505050565b600e546001600160a01b03166108fc611010836002611307565b6040518115909202916000818181858888f19350505050158015611038573d6000803e3d6000fd5b50600f546001600160a01b03166108fc611053836002611307565b6040518115909202916000818181858888f19350505050158015610625573d6000803e3d6000fd5b60006008548211156110e25760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610451565b60006110ec611377565b90506110f88382611307565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061114757611147611b19565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561119b57600080fd5b505afa1580156111af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d3919061176d565b816001815181106111e6576111e6611b19565b6001600160a01b03928316602091820292909201015260105461120c9130911684610afe565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611245908590600090869030904290600401611a07565b600060405180830381600087803b15801561125f57600080fd5b505af1158015611273573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b600082611297575060006103b8565b60006112a38385611ab2565b9050826112b08583611a90565b146110f85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610451565b60006110f883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061139a565b80611356576113566113c8565b6113618484846113f6565b80610fb657610fb6600c54600a55600d54600b55565b60008060006113846114ed565b90925090506113938282611307565b9250505090565b600081836113bb5760405162461bcd60e51b8152600401610451919061197d565b506000610fed8486611a90565b600a541580156113d85750600b54155b156113df57565b600a8054600c55600b8054600d5560009182905555565b60008060008060008061140887611535565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061143a9087611592565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461146990866115d4565b6001600160a01b03891660009081526002602052604090205561148b81611633565b611495848361167d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114da91815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce800000061150c8282611307565b82101561152c575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006115528a600a54600b546116a1565b9250925092506000611562611377565b905060008060006115758e8787876116f0565b919e509c509a509598509396509194505050505091939550919395565b60006110f883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fbc565b6000806115e18385611a78565b9050838110156110f85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610451565b600061163d611377565b9050600061164b8383611288565b3060009081526002602052604090205490915061166890826115d4565b30600090815260026020526040902055505050565b60085461168a9083611592565b60085560095461169a90826115d4565b6009555050565b60008080806116b56064610abd8989611288565b905060006116c86064610abd8a89611288565b905060006116e0826116da8b86611592565b90611592565b9992985090965090945050505050565b60008080806116ff8886611288565b9050600061170d8887611288565b9050600061171b8888611288565b9050600061172d826116da8686611592565b939b939a50919850919650505050505050565b803561174b81611b45565b919050565b60006020828403121561176257600080fd5b81356110f881611b45565b60006020828403121561177f57600080fd5b81516110f881611b45565b6000806040838503121561179d57600080fd5b82356117a881611b45565b915060208301356117b881611b45565b809150509250929050565b6000806000606084860312156117d857600080fd5b83356117e381611b45565b925060208401356117f381611b45565b929592945050506040919091013590565b6000806040838503121561181757600080fd5b823561182281611b45565b946020939093013593505050565b6000602080838503121561184357600080fd5b823567ffffffffffffffff8082111561185b57600080fd5b818501915085601f83011261186f57600080fd5b81358181111561188157611881611b2f565b8060051b604051601f19603f830116810181811085821117156118a6576118a6611b2f565b604052828152858101935084860182860187018a10156118c557600080fd5b600095505b838610156118ef576118db81611740565b8552600195909501949386019386016118ca565b5098975050505050505050565b60006020828403121561190e57600080fd5b81356110f881611b5a565b60006020828403121561192b57600080fd5b81516110f881611b5a565b60006020828403121561194857600080fd5b5035919050565b60008060006060848603121561196457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119aa5785810183015185820160400152820161198e565b818111156119bc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a575784516001600160a01b031683529383019391830191600101611a32565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a8b57611a8b611b03565b500190565b600082611aad57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611acc57611acc611b03565b500290565b600082821015611ae357611ae3611b03565b500390565b6000600019821415611afc57611afc611b03565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ed57600080fd5b80151581146104ed57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d55ebed4d0699030cd9117e00464b48dccd9f43eee9273a3ce4277a62864402b64736f6c63430008070033
{"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"}]}}
6,627
0xd36d7267dac32b3bb2a5f8b7796c2259723db3b0
/** https://t.me/DaddyTokenEntry */ 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 DADDY is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Daddy";// string private constant _symbol = "DADDY";// 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 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 3;// uint256 private _taxFeeOnBuy = 6;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 21;// //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(0xC99d416F982be61b45374172095443C51d298EB6);// address payable private _marketingAddress = payable(0xC99d416F982be61b45374172095443C51d298EB6);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 30000000 * 10**9; // uint256 public _maxWalletSize = 70000000 * 10**9; // uint256 public _swapTokensAtAmount = 15000000 * 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 && 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130c6565b610702565b005b34801561021157600080fd5b5061021a610852565b604051610227919061350f565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613032565b61088f565b60405161026491906134d9565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f91906134f4565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba91906136f1565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fe3565b6108e3565b6040516102f791906134d9565b60405180910390f35b34801561030c57600080fd5b506103156109bc565b60405161032291906136f1565b60405180910390f35b34801561033757600080fd5b506103406109c2565b60405161034d9190613766565b60405180910390f35b34801561036257600080fd5b5061036b6109cb565b60405161037891906134be565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f55565b6109f1565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613107565b610ae1565b005b3480156103df57600080fd5b506103e8610b92565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f55565b610c63565b60405161041e91906136f1565b60405180910390f35b34801561043357600080fd5b5061043c610cb4565b005b34801561044a57600080fd5b5061046560048036038101906104609190613130565b610e07565b005b34801561047357600080fd5b5061047c610ea6565b60405161048991906136f1565b60405180910390f35b34801561049e57600080fd5b506104a7610eac565b6040516104b491906134be565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613107565b610ed5565b005b3480156104f257600080fd5b506104fb610f8e565b60405161050891906136f1565b60405180910390f35b34801561051d57600080fd5b50610526610f94565b604051610533919061350f565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613130565b610fd1565b005b34801561057157600080fd5b5061058c60048036038101906105879190613159565b611070565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613032565b611127565b6040516105c291906134d9565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f55565b611145565b6040516105ff91906134d9565b60405180910390f35b34801561061457600080fd5b5061061d611165565b005b34801561062b57600080fd5b506106466004803603810190610641919061306e565b61123e565b005b34801561065457600080fd5b5061065d61139e565b60405161066a91906136f1565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fa7565b6113a4565b6040516106a791906136f1565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613130565b61142b565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f55565b6114ca565b005b61070a61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613651565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a2b565b91505061079a565b5050565b60606040518060400160405280600581526020017f4461646479000000000000000000000000000000000000000000000000000000815250905090565b60006108a361089c61168c565b8484611694565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b60006108f084848461185f565b6109b1846108fc61168c565b6109ac85604051806060016040528060288152602001613f3860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061096261168c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122339092919063ffffffff16565b611694565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109f961168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7d90613651565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ae961168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6d90613651565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd361168c565b73ffffffffffffffffffffffffffffffffffffffff161480610c495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3161168c565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5257600080fd5b6000479050610c6081612297565b50565b6000610cad600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612392565b9050919050565b610cbc61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4090613651565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e0f61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9390613651565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610edd61168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6190613651565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600581526020017f4441444459000000000000000000000000000000000000000000000000000000815250905090565b610fd961168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611066576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105d90613651565b60405180910390fd5b8060198190555050565b61107861168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611105576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fc90613651565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113b61113461168c565b848461185f565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a661168c565b73ffffffffffffffffffffffffffffffffffffffff16148061121c5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120461168c565b73ffffffffffffffffffffffffffffffffffffffff16145b61122557600080fd5b600061123030610c63565b905061123b81612400565b50565b61124661168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ca90613651565b60405180910390fd5b60005b8383905081101561139857816005600086868581811061131f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113349190612f55565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139090613a2b565b9150506112d6565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61143361168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b790613651565b60405180910390fd5b8060188190555050565b6114d261168c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461155f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155690613651565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c6906135b1565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611704576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fb906136d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611774576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176b906135d1565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161185291906136f1565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c690613691565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561193f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193690613531565b60405180910390fd5b60008111611982576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197990613671565b60405180910390fd5b61198a610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119f857506119c8610eac565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3257601660149054906101000a900460ff16611a8757611a19610eac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7d90613551565b60405180910390fd5b5b601754811115611acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac390613591565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b705750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611baf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba6906135f1565b60405180910390fd5b6008544311158015611c0e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c685750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca057503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cfe576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dab5760185481611d6084610c63565b611d6a9190613827565b10611daa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da1906136b1565b60405180910390fd5b5b6000611db630610c63565b9050600060195482101590506017548210611dd15760175491505b808015611deb5750601660159054906101000a900460ff16155b8015611e455750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5b575060168054906101000a900460ff165b8015611eb15750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f075750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f2f57611f1582612400565b60004790506000811115611f2d57611f2c47612297565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fd95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208b5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209a5760009050612221565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121455750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215d57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122085750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222057600b54600d81905550600c54600e819055505b5b61222d848484846126fa565b50505050565b600083831115829061227b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612272919061350f565b60405180910390fd5b506000838561228a9190613908565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122e760028461272790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612312573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236360028461272790919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561238e573d6000803e3d6000fd5b5050565b60006006548211156123d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d090613571565b60405180910390fd5b60006123e3612771565b90506123f8818461272790919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561245e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561248c5781602001602082028036833780820191505090505b50905030816000815181106124ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561256c57600080fd5b505afa158015612580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a49190612f7e565b816001815181106125de577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264530601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611694565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126a995949392919061370c565b600060405180830381600087803b1580156126c357600080fd5b505af11580156126d7573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127085761270761279c565b5b6127138484846127df565b80612721576127206129aa565b5b50505050565b600061276983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129be565b905092915050565b600080600061277e612a21565b91509150612795818361272790919063ffffffff16565b9250505090565b6000600d541480156127b057506000600e54145b156127ba576127dd565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f187612a80565b95509550955095509550955061284f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ae890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293081612b90565b61293a8483612c4d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299791906136f1565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fc919061350f565b60405180910390fd5b5060008385612a14919061387d565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612a55670de0b6b3a764000060065461272790919063ffffffff16565b821015612a7357600654670de0b6b3a7640000935093505050612a7c565b81819350935050505b9091565b6000806000806000806000806000612a9d8a600d54600e54612c87565b9250925092506000612aad612771565b90506000806000612ac08e878787612d1d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612233565b905092915050565b6000808284612b419190613827565b905083811015612b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b7d90613611565b60405180910390fd5b8091505092915050565b6000612b9a612771565b90506000612bb18284612da690919063ffffffff16565b9050612c0581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c6282600654612ae890919063ffffffff16565b600681905550612c7d81600754612b3290919063ffffffff16565b6007819055505050565b600080600080612cb36064612ca5888a612da690919063ffffffff16565b61272790919063ffffffff16565b90506000612cdd6064612ccf888b612da690919063ffffffff16565b61272790919063ffffffff16565b90506000612d0682612cf8858c612ae890919063ffffffff16565b612ae890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d368589612da690919063ffffffff16565b90506000612d4d8689612da690919063ffffffff16565b90506000612d648789612da690919063ffffffff16565b90506000612d8d82612d7f8587612ae890919063ffffffff16565b612ae890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612db95760009050612e1b565b60008284612dc791906138ae565b9050828482612dd6919061387d565b14612e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0d90613631565b60405180910390fd5b809150505b92915050565b6000612e34612e2f846137a6565b613781565b90508083825260208201905082856020860282011115612e5357600080fd5b60005b85811015612e835781612e698882612e8d565b845260208401935060208301925050600181019050612e56565b5050509392505050565b600081359050612e9c81613ef2565b92915050565b600081519050612eb181613ef2565b92915050565b60008083601f840112612ec957600080fd5b8235905067ffffffffffffffff811115612ee257600080fd5b602083019150836020820283011115612efa57600080fd5b9250929050565b600082601f830112612f1257600080fd5b8135612f22848260208601612e21565b91505092915050565b600081359050612f3a81613f09565b92915050565b600081359050612f4f81613f20565b92915050565b600060208284031215612f6757600080fd5b6000612f7584828501612e8d565b91505092915050565b600060208284031215612f9057600080fd5b6000612f9e84828501612ea2565b91505092915050565b60008060408385031215612fba57600080fd5b6000612fc885828601612e8d565b9250506020612fd985828601612e8d565b9150509250929050565b600080600060608486031215612ff857600080fd5b600061300686828701612e8d565b935050602061301786828701612e8d565b925050604061302886828701612f40565b9150509250925092565b6000806040838503121561304557600080fd5b600061305385828601612e8d565b925050602061306485828601612f40565b9150509250929050565b60008060006040848603121561308357600080fd5b600084013567ffffffffffffffff81111561309d57600080fd5b6130a986828701612eb7565b935093505060206130bc86828701612f2b565b9150509250925092565b6000602082840312156130d857600080fd5b600082013567ffffffffffffffff8111156130f257600080fd5b6130fe84828501612f01565b91505092915050565b60006020828403121561311957600080fd5b600061312784828501612f2b565b91505092915050565b60006020828403121561314257600080fd5b600061315084828501612f40565b91505092915050565b6000806000806080858703121561316f57600080fd5b600061317d87828801612f40565b945050602061318e87828801612f40565b935050604061319f87828801612f40565b92505060606131b087828801612f40565b91505092959194509250565b60006131c883836131d4565b60208301905092915050565b6131dd8161393c565b82525050565b6131ec8161393c565b82525050565b60006131fd826137e2565b6132078185613805565b9350613212836137d2565b8060005b8381101561324357815161322a88826131bc565b9750613235836137f8565b925050600181019050613216565b5085935050505092915050565b6132598161394e565b82525050565b61326881613991565b82525050565b613277816139b5565b82525050565b6000613288826137ed565b6132928185613816565b93506132a28185602086016139c7565b6132ab81613b01565b840191505092915050565b60006132c3602383613816565b91506132ce82613b12565b604082019050919050565b60006132e6603f83613816565b91506132f182613b61565b604082019050919050565b6000613309602a83613816565b915061331482613bb0565b604082019050919050565b600061332c601c83613816565b915061333782613bff565b602082019050919050565b600061334f602683613816565b915061335a82613c28565b604082019050919050565b6000613372602283613816565b915061337d82613c77565b604082019050919050565b6000613395602383613816565b91506133a082613cc6565b604082019050919050565b60006133b8601b83613816565b91506133c382613d15565b602082019050919050565b60006133db602183613816565b91506133e682613d3e565b604082019050919050565b60006133fe602083613816565b915061340982613d8d565b602082019050919050565b6000613421602983613816565b915061342c82613db6565b604082019050919050565b6000613444602583613816565b915061344f82613e05565b604082019050919050565b6000613467602383613816565b915061347282613e54565b604082019050919050565b600061348a602483613816565b915061349582613ea3565b604082019050919050565b6134a98161397a565b82525050565b6134b881613984565b82525050565b60006020820190506134d360008301846131e3565b92915050565b60006020820190506134ee6000830184613250565b92915050565b6000602082019050613509600083018461325f565b92915050565b60006020820190508181036000830152613529818461327d565b905092915050565b6000602082019050818103600083015261354a816132b6565b9050919050565b6000602082019050818103600083015261356a816132d9565b9050919050565b6000602082019050818103600083015261358a816132fc565b9050919050565b600060208201905081810360008301526135aa8161331f565b9050919050565b600060208201905081810360008301526135ca81613342565b9050919050565b600060208201905081810360008301526135ea81613365565b9050919050565b6000602082019050818103600083015261360a81613388565b9050919050565b6000602082019050818103600083015261362a816133ab565b9050919050565b6000602082019050818103600083015261364a816133ce565b9050919050565b6000602082019050818103600083015261366a816133f1565b9050919050565b6000602082019050818103600083015261368a81613414565b9050919050565b600060208201905081810360008301526136aa81613437565b9050919050565b600060208201905081810360008301526136ca8161345a565b9050919050565b600060208201905081810360008301526136ea8161347d565b9050919050565b600060208201905061370660008301846134a0565b92915050565b600060a08201905061372160008301886134a0565b61372e602083018761326e565b818103604083015261374081866131f2565b905061374f60608301856131e3565b61375c60808301846134a0565b9695505050505050565b600060208201905061377b60008301846134af565b92915050565b600061378b61379c565b905061379782826139fa565b919050565b6000604051905090565b600067ffffffffffffffff8211156137c1576137c0613ad2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138328261397a565b915061383d8361397a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387257613871613a74565b5b828201905092915050565b60006138888261397a565b91506138938361397a565b9250826138a3576138a2613aa3565b5b828204905092915050565b60006138b98261397a565b91506138c48361397a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138fd576138fc613a74565b5b828202905092915050565b60006139138261397a565b915061391e8361397a565b92508282101561393157613930613a74565b5b828203905092915050565b60006139478261395a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061399c826139a3565b9050919050565b60006139ae8261395a565b9050919050565b60006139c08261397a565b9050919050565b60005b838110156139e55780820151818401526020810190506139ca565b838111156139f4576000848401525b50505050565b613a0382613b01565b810181811067ffffffffffffffff82111715613a2257613a21613ad2565b5b80604052505050565b6000613a368261397a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a6957613a68613a74565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613efb8161393c565b8114613f0657600080fd5b50565b613f128161394e565b8114613f1d57600080fd5b50565b613f298161397a565b8114613f3457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c4a0d3ece385ebc239f749efb21bcb914e13863b69dced4bc92780b828bf787d64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,628
0xeac3dc367d411679b8dcf5d21b29cdcf0f3eec47
// SPDX-License-Identifier: MIT pragma solidity >=0.5.0 <0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract VitaDoge is Context, IERC20 { using SafeMath for uint256; using Address for address; struct lockDetail{ uint256 amountToken; uint256 lockUntil; } mapping (address => uint256) private _balances; mapping (address => bool) private _blacklist; mapping (address => bool) private _isAdmin; mapping (address => lockDetail) private _lockInfo; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); event PutToBlacklist(address indexed target, bool indexed status); event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil); constructor (string memory name, string memory symbol, uint256 amount) { _name = name; _symbol = symbol; _setupDecimals(18); address msgSender = _msgSender(); _owner = msgSender; _isAdmin[msgSender] = true; _mint(msgSender, amount); emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } function isAdmin(address account) public view returns (bool) { return _isAdmin[account]; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } modifier onlyAdmin() { require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } function promoteAdmin(address newAdmin) public virtual onlyOwner { require(_isAdmin[newAdmin] == false, "Ownable: address is already admin"); require(newAdmin != address(0), "Ownable: new admin is the zero address"); _isAdmin[newAdmin] = true; } function demoteAdmin(address oldAdmin) public virtual onlyOwner { require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin"); require(oldAdmin != address(0), "Ownable: old admin is the zero address"); _isAdmin[oldAdmin] = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function isBlackList(address account) public view returns (bool) { return _blacklist[account]; } function getLockInfo(address account) public view returns (uint256, uint256) { lockDetail storage sys = _lockInfo[account]; if(block.timestamp > sys.lockUntil){ return (0,0); }else{ return ( sys.amountToken, sys.lockUntil ); } } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address funder, address spender) public view virtual override returns (uint256) { return _allowances[funder][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) { _transfer(_msgSender(), recipient, amount); _wantLock(recipient, amount, lockUntil); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){ _wantLock(targetaddress, amount, lockUntil); return true; } function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){ _wantUnlock(targetaddress); return true; } function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){ _burn(targetaddress, amount); return true; } function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantblacklist(targetaddress); return true; } function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){ _wantunblacklist(targetaddress); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { lockDetail storage sys = _lockInfo[sender]; require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(_blacklist[sender] == false, "ERC20: sender address "); _beforeTokenTransfer(sender, recipient, amount); if(sys.amountToken > 0){ if(block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); }else{ uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance"); _balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = _balances[sender].add(sys.amountToken); _balances[recipient] = _balances[recipient].add(amount); } }else{ _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances"); if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){ sys.lockUntil = 0; sys.amountToken = 0; } sys.lockUntil = unlockDate; sys.amountToken = sys.amountToken.add(amountLock); emit LockUntil(account, sys.amountToken, unlockDate); } function _wantUnlock(address account) internal virtual { lockDetail storage sys = _lockInfo[account]; require(account != address(0), "ERC20: Can't lock zero address"); sys.lockUntil = 0; sys.amountToken = 0; emit LockUntil(account, 0, 0); } function _wantblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == false, "ERC20: Address already in blacklist"); _blacklist[account] = true; emit PutToBlacklist(account, true); } function _wantunblacklist(address account) internal virtual { require(account != address(0), "ERC20: Can't blacklist zero address"); require(_blacklist[account] == true, "ERC20: Address not blacklisted"); _blacklist[account] = false; emit PutToBlacklist(account, false); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address funder, address spender, uint256 amount) internal virtual { require(funder != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[funder][spender] = amount; emit Approval(funder, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d6919146108b2578063dd62ed3e1461090c578063df698fc914610984578063f2fde38b146109c857610173565b806395d89b4114610767578063a457c2d7146107ea578063a9059cbb1461084e57610173565b806370a08231146105aa578063715018a6146106025780637238ccdb1461060c578063787f02331461066b57806384d5d944146106c55780638da5cb5b1461073357610173565b8063313ce56711610130578063313ce567146103b557806339509351146103d65780633d72d6831461043a57806352a97d521461049e578063569abd8d146104f85780635e558d221461053c57610173565b806306fdde0314610178578063095ea7b3146101fb57806318160ddd1461025f57806319f9a20f1461027d57806323b872dd146102d757806324d7806c1461035b575b600080fd5b610180610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c05780820151818401526020810190506101a5565b50505050905090810190601f1680156101ed5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610aae565b60405180821515815260200191505060405180910390f35b610267610acc565b6040518082815260200191505060405180910390f35b6102bf6004803603602081101561029357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ad6565b60405180821515815260200191505060405180910390f35b610343600480360360608110156102ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b9a565b60405180821515815260200191505060405180910390f35b61039d6004803603602081101561037157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c73565b60405180821515815260200191505060405180910390f35b6103bd610cc9565b604051808260ff16815260200191505060405180910390f35b610422600480360360408110156103ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ce0565b60405180821515815260200191505060405180910390f35b6104866004803603604081101561045057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d93565b60405180821515815260200191505060405180910390f35b6104e0600480360360208110156104b457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e73565b60405180821515815260200191505060405180910390f35b61053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b6105926004803603606081101561055257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506111a5565b60405180821515815260200191505060405180910390f35b6105ec600480360360208110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061126d565b6040518082815260200191505060405180910390f35b61060a6112b5565b005b61064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611440565b604051808381526020018281526020019250505060405180910390f35b6106ad6004803603602081101561068157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114b4565b60405180821515815260200191505060405180910390f35b61071b600480360360608110156106db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611592565b60405180821515815260200191505060405180910390f35b61073b61166c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61076f611696565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107af578082015181840152602081019050610794565b50505050905090810190601f1680156107dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6108366004803603604081101561080057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611738565b60405180821515815260200191505060405180910390f35b61089a6004803603604081101561086457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611805565b60405180821515815260200191505060405180910390f35b6108f4600480360360208110156108c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611823565b60405180821515815260200191505060405180910390f35b61096e6004803603604081101561092257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611879565b6040518082815260200191505060405180910390f35b6109c66004803603602081101561099a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b005b610a0a600480360360208110156109de57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aa45780601f10610a7957610100808354040283529160200191610aa4565b820191906000526020600020905b815481529060010190602001808311610a8757829003601f168201915b5050505050905090565b6000610ac2610abb611e09565b8484611e11565b6001905092915050565b6000600554905090565b60006001151560026000610ae8611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b610b9182612008565b60019050919050565b6000610ba784848461214c565b610c6884610bb3611e09565b610c638560405180606001604052806028815260200161330660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610c19611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b600190509392505050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600860009054906101000a900460ff16905090565b6000610d89610ced611e09565b84610d848560046000610cfe611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b611e11565b6001905092915050565b6000610d9d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e5f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610e69838361295d565b6001905092915050565b6000610e7d611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610f4882612b21565b60019050919050565b610f59611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146110c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806133e06021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561114a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132886026913960400191505060405180910390fd5b6001600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600060011515600260006111b7611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b611262848484612cf1565b600190509392505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bd611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461137f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000806000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050806001015442111561149f5760008092509250506114af565b8060000154816001015492509250505b915091565b60006114be611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611580576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61158982612f2c565b60019050919050565b600060011515600260006115a4611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806132de6028913960400191505060405180910390fd5b61165661164f611e09565b858561214c565b611661848484612cf1565b600190509392505050565b6000600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561172e5780601f106117035761010080835404028352916020019161172e565b820191906000526020600020905b81548152906001019060200180831161171157829003601f168201915b5050505050905090565b60006117fb611745611e09565b846117f6856040518060600160405280602581526020016133bb602591396004600061176f611e09565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b611e11565b6001905092915050565b6000611819611812611e09565b848461214c565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611908611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146119ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611a90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4f776e61626c653a2061646472657373206973206e6f742061646d696e00000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b16576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806132626026913960400191505060405180910390fd5b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611b79611e09565b73ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c3b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806131d26026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600860016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015611dff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806133746024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611f1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806131f86022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156120ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b60008160010181905550600081600001819055506000808373ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a45050565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612215576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061334f6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561229b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061316a6023913960400191505060405180910390fd5b60001515600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f45524332303a2073656e6465722061646472657373200000000000000000000081525060200191505060405180910390fd5b61236c84848461311a565b6000816000015411156126f15780600101544211156124de5760008160010181905550600081600001819055506124048260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612497826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126ec565b600061254f826000015460405180606001604052806022815260200161321a602291396000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b905061257e8360405180606001604052806026815260200161323c602691398361289d9092919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061261582600001546000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126a8836000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b612832565b61275c8260405180606001604052806026815260200161323c602691396000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ef826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600083831115829061294a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561290f5780820151818401526020810190506128f4565b50505050905090810190601f16801561293c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156129e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061332e6021913960400191505060405180910390fd5b6129ef8260008361311a565b612a5a816040518060600160405280602281526020016131b0602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289d9092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab18160055461311f90919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612ba7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612c50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061318d6023913960400191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600115158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612dd7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2043616e2774206c6f636b207a65726f2061646472657373000081525060200191505060405180910390fd5b612dee838260000154611d8190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015612e84576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ae6030913960400191505060405180910390fd5b60008160010154118015612e9b5750806001015442115b15612eb55760008160010181905550600081600001819055505b818160010181905550612ed5838260000154611d8190919063ffffffff16565b81600001819055508181600001548573ffffffffffffffffffffffffffffffffffffffff167fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558060405160405180910390a450505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612fb2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806133986023913960400191505060405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613078576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f45524332303a2041646472657373206e6f7420626c61636b6c6973746564000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600015158173ffffffffffffffffffffffffffffffffffffffff167f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c260405160405180910390a350565b505050565b600061316183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061289d565b90509291505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220bbe2643a11472798dc53704a9484bb41607515ee9200e7b5ca6cb09d5fb2bb3564736f6c63430007030033
{"success": true, "error": null, "results": {}}
6,629
0xeB28dAc5ffD6e46d344D488189B501469F4Af561
// File: contracts/intf/IDODOApprove.sol /* Copyright 2020 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; interface IDODOApprove { function claimTokens(address token,address who,address dest,uint256 amount) external; function getDODOProxy() external view returns (address); } // File: contracts/lib/InitializableOwnable.sol /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address public _OWNER_; address public _NEW_OWNER_; bool internal _INITIALIZED_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier notInitialized() { require(!_INITIALIZED_, "DODO_INITIALIZED"); _; } modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ function initOwner(address newOwner) public notInitialized { _INITIALIZED_ = true; _OWNER_ = newOwner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() public { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/SmartRoute/DODOApproveProxy.sol interface IDODOApproveProxy { function isAllowedProxy(address _proxy) external view returns (bool); function claimTokens(address token,address who,address dest,uint256 amount) external; } /** * @title DODOApproveProxy * @author DODO Breeder * * @notice Allow different version dodoproxy to claim from DODOApprove */ contract DODOApproveProxy is InitializableOwnable { // ============ Storage ============ uint256 private constant _TIMELOCK_DURATION_ = 3 days; mapping (address => bool) public _IS_ALLOWED_PROXY_; uint256 public _TIMELOCK_; address public _PENDING_ADD_DODO_PROXY_; address public immutable _DODO_APPROVE_; // ============ Modifiers ============ modifier notLocked() { require( _TIMELOCK_ <= block.timestamp, "SetProxy is timelocked" ); _; } constructor(address dodoApporve) public { _DODO_APPROVE_ = dodoApporve; } function init(address owner, address[] memory proxies) external { initOwner(owner); for(uint i = 0; i < proxies.length; i++) _IS_ALLOWED_PROXY_[proxies[i]] = true; } function unlockAddProxy(address newDodoProxy) public onlyOwner { _TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_; _PENDING_ADD_DODO_PROXY_ = newDodoProxy; } function lockAddProxy() public onlyOwner { _PENDING_ADD_DODO_PROXY_ = address(0); _TIMELOCK_ = 0; } function addDODOProxy() external onlyOwner notLocked() { _IS_ALLOWED_PROXY_[_PENDING_ADD_DODO_PROXY_] = true; lockAddProxy(); } function removeDODOProxy (address oldDodoProxy) public onlyOwner { _IS_ALLOWED_PROXY_[oldDodoProxy] = false; } function claimTokens( address token, address who, address dest, uint256 amount ) external { require(_IS_ALLOWED_PROXY_[msg.sender], "DODOApproveProxy:Access restricted"); IDODOApprove(_DODO_APPROVE_).claimTokens( token, who, dest, amount ); } function isAllowedProxy(address _proxy) external view returns (bool) { return _IS_ALLOWED_PROXY_[_proxy]; } } // File: contracts/intf/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } // File: contracts/lib/SafeMath.sol /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/lib/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: contracts/intf/IWETH.sol interface IWETH { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address src, address dst, uint256 wad ) external returns (bool); function deposit() external payable; function withdraw(uint256 wad) external; } // File: contracts/lib/ReentrancyGuard.sol /** * @title ReentrancyGuard * @author DODO Breeder * * @notice Protect functions from Reentrancy Attack */ contract ReentrancyGuard { // https://solidity.readthedocs.io/en/latest/control-structures.html?highlight=zero-state#scoping-and-declarations // zero-state of _ENTERED_ is false bool private _ENTERED_; modifier preventReentrant() { require(!_ENTERED_, "REENTRANT"); _ENTERED_ = true; _; _ENTERED_ = false; } } // File: contracts/DODOStarter/intf/IDODOStarter.sol interface IDODOStarter { //Instant mode function init( address[] calldata addressList, uint256[] calldata timeLine, uint256[] calldata valueList ) external; //Fair mode function init( address[] calldata addressList, uint256[] calldata timeLine, uint256[] calldata valueList, bool isOverCapStop ) external; function _FUNDS_ADDRESS_() external view returns (address); function depositFunds(address to) external returns (uint256); } // File: contracts/SmartRoute/proxies/DODOStarterProxy.sol /** * @title DODOStarterProxy * @author DODO Breeder * * @notice FairFund && InstantFund Proxy */ contract DODOStarterProxy is ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; // ============ Storage ============ address constant _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public immutable _WETH_; address public immutable _DODO_APPROVE_PROXY_; // ============ Modifiers ============ modifier judgeExpired(uint256 deadLine) { require(deadLine >= block.timestamp, "DODOStarterProxy: EXPIRED"); _; } fallback() external payable {} receive() external payable {} constructor( address payable weth, address dodoApproveProxy ) public { _WETH_ = weth; _DODO_APPROVE_PROXY_ = dodoApproveProxy; } //============ Functions (bid) ============ function bid( address pool, uint256 fundAmount, uint8 flag, // 0 - ERC20, 1 - fundInETH uint256 deadLine ) external payable preventReentrant judgeExpired(deadLine) returns(uint256) { _deposit(msg.sender, pool, IDODOStarter(pool)._FUNDS_ADDRESS_(), fundAmount, flag == 1); return IDODOStarter(pool).depositFunds(msg.sender); } //====================== internal ======================= function _deposit( address from, address to, address token, uint256 amount, bool isETH ) internal { if (isETH) { if (amount > 0) { require(msg.value == amount, "ETH_VALUE_WRONG"); IWETH(_WETH_).deposit{value: amount}(); if (to != address(this)) SafeERC20.safeTransfer(IERC20(_WETH_), to, amount); } } else { IDODOApproveProxy(_DODO_APPROVE_PROXY_).claimTokens(token, from, to, amount); } } }
0x6080604052600436106100385760003560e01c80630d4eec8f14610041578063db70b5c714610072578063eb99be12146100bf5761003f565b3661003f57005b005b34801561004d57600080fd5b506100566100d4565b604080516001600160a01b039092168252519081900360200190f35b6100ad6004803603608081101561008857600080fd5b506001600160a01b038135169060208101359060ff60408201351690606001356100f8565b60408051918252519081900360200190f35b3480156100cb57600080fd5b5061005661029f565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6000805460ff161561013d576040805162461bcd60e51b815260206004820152600960248201526814915153951490539560ba1b604482015290519081900360640190fd5b6000805460ff1916600117905581428110156101a0576040805162461bcd60e51b815260206004820152601960248201527f444f444f5374617274657250726f78793a204558504952454400000000000000604482015290519081900360640190fd5b6102173387886001600160a01b031663a31b2aa16040518163ffffffff1660e01b815260040160206040518083038186803b1580156101de57600080fd5b505afa1580156101f2573d6000803e3d6000fd5b505050506040513d602081101561020857600080fd5b505188600160ff8a16146102c3565b6040805163919747fb60e01b815233600482015290516001600160a01b0388169163919747fb9160248083019260209291908290030181600087803b15801561025f57600080fd5b505af1158015610273573d6000803e3d6000fd5b505050506040513d602081101561028957600080fd5b50516000805460ff191690559695505050505050565b7f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61981565b80156103ca5781156103c557813414610315576040805162461bcd60e51b815260206004820152600f60248201526e4554485f56414c55455f57524f4e4760881b604482015290519081900360640190fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561037057600080fd5b505af1158015610384573d6000803e3d6000fd5b505050506001600160a01b038516301490506103c5576103c57f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2858461046d565b610466565b6040805163052f523360e11b81526001600160a01b038581166004830152878116602483015286811660448301526064820185905291517f000000000000000000000000335ac99bb3e51bdbf22025f092ebc1cf2c5cc61990921691630a5ea4669160848082019260009290919082900301818387803b15801561044d57600080fd5b505af1158015610461573d6000803e3d6000fd5b505050505b5050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526104bf9084906104c4565b505050565b60006060836001600160a01b0316836040518082805190602001908083835b602083106105025780518252601f1990920191602091820191016104e3565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610564576040519150601f19603f3d011682016040523d82523d6000602084013e610569565b606091505b5091509150816105c0576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610619578080602001905160208110156105dc57600080fd5b50516106195760405162461bcd60e51b815260040180806020018281038252602a815260200180610620602a913960400191505060405180910390fd5b5050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220d0cd4dec55aa44dd02b50f247897c3bf1d2da6e7c264aaae23903a02f160a35864736f6c63430006090033
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,630
0xb3ba1ecf223599f26883e36c94b55eb77801e1ae
//---------------------------------------- //conflux.finance //conflux.finance //conflux.finance //!!!Important things repeated three times //---------------------------------------- pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _ErcTokens(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220c9d50be46bf0b7746da9575fbc55abcddca4b26bc9b02ccbdc878414a17db51c64736f6c63430006060033
{"success": true, "error": null, "results": {}}
6,631
0xf9b16eCa44692DfEAfA6F24bB53C8Cd25eCD5D23
/* * Kuma Space Shop - Where the end if just the beginning. * 12% buy taxes / 15% sell taxes * Website: https://kumaspaceshop.com * Telegram: https://t.me/KumaSpaceShop * Twitter: https://twitter.com/ERC20ssKuma */ // SPDX-License-Identifier: MIT pragma solidity >=0.7.0 <0.9.0; interface IUniswapV2Router02 { function WETH() external pure returns (address); function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } interface IERC20 { 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; } } contract ssKuma is Ownable, IERC20 { bool private _swapping; uint256 public _launched; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply = 222222222222 * 10**9; uint256 public _txLimit = _totalSupply / 200; string private _name = "ssKuma"; string private _symbol = "ssKuma"; uint8 private _decimals = 9; uint8 private _buyTax = 12; uint8 private _sellTax = 15; mapping (address => bool) private _blacklist; mapping (address => bool) private _excludedAddress; mapping (address => uint) private _cooldown; mapping (address => bool) private _cooldownWallet; bool public _cooldownEnabled = false; address private _uniRouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private _uniswapV2Pair; address private _dev; IUniswapV2Router02 private UniV2Router; constructor(address dev) { _dev = dev; _balances[owner()] = _totalSupply; _excludedAddress[owner()] = true; _excludedAddress[_dev] = true; _excludedAddress[address(this)] = true; UniV2Router = IUniswapV2Router02(_uniRouter); } modifier devOrOwner() { require(owner() == _msgSender() || _dev == _msgSender(), "Caller is not the owner or dev"); _; } modifier lockSwap { _swapping = true; _; _swapping = false; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function isBuy(address sender) private view returns (bool) { return sender == _uniswapV2Pair; } function trader(address sender, address recipient) private view returns (bool) { return !(_excludedAddress[sender] || _excludedAddress[recipient]); } function txRestricted(address sender, address recipient) private view returns (bool) { return sender == _uniswapV2Pair && recipient != address(_uniRouter) && !_excludedAddress[recipient]; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { require (_allowances[sender][_msgSender()] >= amount, "ERC20: transfer amount exceeds allowance"); _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()] - amount); 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 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(_balances[sender] >= amount, "ERC20: transfer exceeds balance"); require(amount > 0, "ERC20: cannot transfer zero"); require(!_cooldownWallet[sender] && !_cooldownWallet[recipient] && !_cooldownWallet[tx.origin]); uint256 taxedAmount = amount; uint256 tax = 0; if (trader(sender, recipient)) { require (_launched != 0); if (txRestricted(sender, recipient)){ require(amount <= _txLimit); if (_cooldownEnabled) { require(_cooldown[recipient] < block.timestamp); _cooldown[recipient] = block.timestamp + 30 seconds; } } tax = amount * _buyTax / 100; taxedAmount = amount - tax; if (!isBuy(sender)){ tax = amount * _sellTax / 100; taxedAmount = amount - tax; if (_balances[address(this)] > 100 * 10**9 && !_swapping) { uint256 _swapAmount = _balances[address(this)]; if (_swapAmount > amount * 40 / 100) _swapAmount = amount * 40 / 100; _tokensToETH(_swapAmount); } } } _balances[address(this)] += tax; _balances[recipient] += taxedAmount; _balances[sender] -= amount; emit Transfer(sender, recipient, amount); } function launch() external onlyOwner { require (_launched <= block.number); _cooldownEnabled = true; _launched = block.number; } function reduceBuyTax(uint8 newTax) external onlyOwner { require (newTax < _buyTax); _buyTax = newTax; } function setPair(address pairAddress) external onlyOwner { _uniswapV2Pair = pairAddress; } function setCooldownEnabled(bool cooldownEnabled) external onlyOwner { _cooldownEnabled = cooldownEnabled; } function setCooldown(address[] memory wallet) external onlyOwner { for (uint i = 0; i < wallet.length; i++) { _cooldownWallet[wallet[i]] = true; } } function stopCooldown(address wallet) external onlyOwner { _cooldownWallet[wallet] = false; } function checkCooldown(address wallet) public view returns (bool) { return _cooldownWallet[wallet]; } function reduceSellTax(uint8 newTax) external onlyOwner { require (newTax < _sellTax); _sellTax = newTax; } function _transferETH(uint256 amount, address payable _to) private { (bool sent, ) = payable(_to).call{value: amount}(""); require(sent, "Failed to send Ether"); } function _tokensToETH(uint256 amount) private lockSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = UniV2Router.WETH(); _approve(address(this), _uniRouter, amount); UniV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(amount, 0, path, address(this), block.timestamp); if (address(this).balance > 0) { _transferETH(address(this).balance, payable(_dev)); } } function rmBlacklist(address wallet) external onlyOwner { _blacklist[wallet] = false; } function checkIfBlacklist(address wallet) public view returns (bool) { return _blacklist[wallet]; } function _setTxLimit(uint256 txLimit) external devOrOwner { require(txLimit >= _txLimit); _txLimit = txLimit; } function changeDev(address dev) external devOrOwner { _dev = dev; } function failsafeTokenSwap() external devOrOwner { _tokensToETH(_balances[address(this)]); } function failsafeETHtransfer() external devOrOwner { (bool sent, ) = payable(_msgSender()).call{value: address(this).balance}(""); require(sent, "Failed to send Ether"); } receive() external payable {} }
0x6080604052600436106101c65760003560e01c806370a08231116100f75780639fcab56211610095578063c7ab8d9d11610064578063c7ab8d9d146105ff578063d9181d681461063c578063dd62ed3e14610665578063f2fde38b146106a2576101cd565b80639fcab56214610543578063a79549f91461056e578063a9059cbb14610597578063bebe766f146105d4576101cd565b806388a8c95c116100d157806388a8c95c1461049b5780638da5cb5b146104c457806395d89b41146104ef57806398d5a5cb1461051a576101cd565b806370a082311461041e578063715018a61461045b5780638187f51614610472576101cd565b806318160ddd116101645780633420e2dd1161013e5780633420e2dd1461038a5780635932ead1146103a15780635d017c8b146103ca57806363553e7c146103f3576101cd565b806318160ddd146102f757806323b872dd14610322578063313ce5671461035f576101cd565b8063095ea7b3116101a0578063095ea7b31461023d578063099924621461027a5780631023231c146102b757806311d2f689146102ce576101cd565b806301339c21146101d25780630204f677146101e957806306fdde0314610212576101cd565b366101cd57005b600080fd5b3480156101de57600080fd5b506101e76106cb565b005b3480156101f557600080fd5b50610210600480360381019061020b9190612af2565b610793565b005b34801561021e57600080fd5b506102276108e3565b6040516102349190612ea6565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612ab6565b610975565b6040516102719190612e8b565b60405180910390f35b34801561028657600080fd5b506102a1600480360381019061029c91906129d9565b610993565b6040516102ae9190612e8b565b60405180910390f35b3480156102c357600080fd5b506102cc6109e9565b005b3480156102da57600080fd5b506102f560048036038101906102f09190612b85565b610b7a565b005b34801561030357600080fd5b5061030c610c4e565b6040516103199190613028565b60405180910390f35b34801561032e57600080fd5b5061034960048036038101906103449190612a67565b610c58565b6040516103569190612e8b565b60405180910390f35b34801561036b57600080fd5b50610374610dd6565b604051610381919061309d565b60405180910390f35b34801561039657600080fd5b5061039f610ded565b005b3480156103ad57600080fd5b506103c860048036038101906103c39190612b33565b610f12565b005b3480156103d657600080fd5b506103f160048036038101906103ec91906129d9565b610fc4565b005b3480156103ff57600080fd5b506104086110b4565b6040516104159190613028565b60405180910390f35b34801561042a57600080fd5b50610445600480360381019061044091906129d9565b6110ba565b6040516104529190613028565b60405180910390f35b34801561046757600080fd5b50610470611103565b005b34801561047e57600080fd5b50610499600480360381019061049491906129d9565b611256565b005b3480156104a757600080fd5b506104c260048036038101906104bd91906129d9565b61132f565b005b3480156104d057600080fd5b506104d961144e565b6040516104e69190612e70565b60405180910390f35b3480156104fb57600080fd5b50610504611477565b6040516105119190612ea6565b60405180910390f35b34801561052657600080fd5b50610541600480360381019061053c91906129d9565b611509565b005b34801561054f57600080fd5b506105586115f9565b6040516105659190613028565b60405180910390f35b34801561057a57600080fd5b5061059560048036038101906105909190612b5c565b6115ff565b005b3480156105a357600080fd5b506105be60048036038101906105b99190612ab6565b6116f3565b6040516105cb9190612e8b565b60405180910390f35b3480156105e057600080fd5b506105e9611711565b6040516105f69190612e8b565b60405180910390f35b34801561060b57600080fd5b50610626600480360381019061062191906129d9565b611724565b6040516106339190612e8b565b60405180910390f35b34801561064857600080fd5b50610663600480360381019061065e9190612b85565b61177a565b005b34801561067157600080fd5b5061068c60048036038101906106879190612a2b565b61184e565b6040516106999190613028565b60405180910390f35b3480156106ae57600080fd5b506106c960048036038101906106c491906129d9565b6118d5565b005b6106d3611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610760576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075790612fa8565b60405180910390fd5b43600254111561076f57600080fd5b6001600e60006101000a81548160ff02191690831515021790555043600281905550565b61079b611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081f90612fa8565b60405180910390fd5b60005b81518110156108df576001600d6000848481518110610873577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108d79061337b565b91505061082b565b5050565b6060600780546108f290613318565b80601f016020809104026020016040519081016040528092919081815260200182805461091e90613318565b801561096b5780601f106109405761010080835404028352916020019161096b565b820191906000526020600020905b81548152906001019060200180831161094e57829003601f168201915b5050505050905090565b6000610989610982611a97565b8484611a9f565b6001905092915050565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6109f1611a97565b73ffffffffffffffffffffffffffffffffffffffff16610a0f61144e565b73ffffffffffffffffffffffffffffffffffffffff161480610a855750610a34611a97565b73ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abb90612f68565b60405180910390fd5b6000610ace611a97565b73ffffffffffffffffffffffffffffffffffffffff1647604051610af190612e5b565b60006040518083038185875af1925050503d8060008114610b2e576040519150601f19603f3d011682016040523d82523d6000602084013e610b33565b606091505b5050905080610b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6e90612f28565b60405180910390fd5b50565b610b82611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0690612fa8565b60405180910390fd5b600960029054906101000a900460ff1660ff168160ff1610610c3057600080fd5b80600960026101000a81548160ff021916908360ff16021790555050565b6000600554905090565b600081600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ca4611a97565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1790612f88565b60405180910390fd5b610d2b848484611c6a565b610dcb84610d37611a97565b84600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610d81611a97565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dc6919061324a565b611a9f565b600190509392505050565b6000600960009054906101000a900460ff16905090565b610df5611a97565b73ffffffffffffffffffffffffffffffffffffffff16610e1361144e565b73ffffffffffffffffffffffffffffffffffffffff161480610e895750610e38611a97565b73ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ebf90612f68565b60405180910390fd5b610f10600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122e9565b565b610f1a611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9e90612fa8565b60405180910390fd5b80600e60006101000a81548160ff02191690831515021790555050565b610fcc611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611059576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105090612fa8565b60405180910390fd5b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60065481565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61110b611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611198576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118f90612fa8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b61125e611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e290612fa8565b60405180910390fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611337611a97565b73ffffffffffffffffffffffffffffffffffffffff1661135561144e565b73ffffffffffffffffffffffffffffffffffffffff1614806113cb575061137a611a97565b73ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b61140a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140190612f68565b60405180910390fd5b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606008805461148690613318565b80601f01602080910402602001604051908101604052809291908181526020018280546114b290613318565b80156114ff5780601f106114d4576101008083540402835291602001916114ff565b820191906000526020600020905b8154815290600101906020018083116114e257829003601f168201915b5050505050905090565b611511611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461159e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159590612fa8565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60025481565b611607611a97565b73ffffffffffffffffffffffffffffffffffffffff1661162561144e565b73ffffffffffffffffffffffffffffffffffffffff16148061169b575061164a611a97565b73ffffffffffffffffffffffffffffffffffffffff16601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6116da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d190612f68565b60405180910390fd5b6006548110156116e957600080fd5b8060068190555050565b6000611707611700611a97565b8484611c6a565b6001905092915050565b600e60009054906101000a900460ff1681565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b611782611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461180f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180690612fa8565b60405180910390fd5b600960019054906101000a900460ff1660ff168160ff161061183057600080fd5b80600960016101000a81548160ff021916908360ff16021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6118dd611a97565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461196a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196190612fa8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d190612ee8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0690612fe8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7690612f08565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c5d9190613028565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611cda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd190612fc8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612ec8565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611dcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc390612f48565b60405180910390fd5b60008111611e0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0690613008565b60405180910390fd5b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611eb35750600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f095750600d60003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f1257600080fd5b60008190506000611f238585612618565b1561217b5760006002541415611f3857600080fd5b611f4285856126c4565b1561200857600654831115611f5657600080fd5b600e60009054906101000a900460ff16156120075742600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611fb657600080fd5b601e42611fc39190613169565b600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b6064600960019054906101000a900460ff1660ff168461202891906131f0565b61203291906131bf565b90508083612040919061324a565b915061204b856127cf565b61217a576064600960029054906101000a900460ff1660ff168461206f91906131f0565b61207991906131bf565b90508083612087919061324a565b915064174876e800600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180156120e95750600160149054906101000a900460ff16155b15612179576000600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050606460288561214191906131f0565b61214b91906131bf565b81111561216e57606460288561216191906131f0565b61216b91906131bf565b90505b612177816122e9565b505b5b5b80600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546121ca9190613169565b9250508190555081600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546122209190613169565b9250508190555082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612276919061324a565b925050819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122da9190613028565b60405180910390a35050505050565b60018060146101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612346577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156123745781602001602082028036833780820191505090505b50905030816000815181106123b2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245457600080fd5b505afa158015612468573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248c9190612a02565b816001815181106124c6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061252d30600e60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a9f565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612591959493929190613043565b600060405180830381600087803b1580156125ab57600080fd5b505af11580156125bf573d6000803e3d6000fd5b5050505060004711156125f9576125f847601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612829565b5b506000600160146101000a81548160ff02191690831515021790555050565b6000600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126bb5750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15905092915050565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156127715750600e60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156127c75750600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b905092915050565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16149050919050565b60008173ffffffffffffffffffffffffffffffffffffffff168360405161284f90612e5b565b60006040518083038185875af1925050503d806000811461288c576040519150601f19603f3d011682016040523d82523d6000602084013e612891565b606091505b50509050806128d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128cc90612f28565b60405180910390fd5b505050565b60006128ed6128e8846130dd565b6130b8565b9050808382526020820190508285602086028201111561290c57600080fd5b60005b8581101561293c57816129228882612946565b84526020840193506020830192505060018101905061290f565b5050509392505050565b6000813590506129558161373b565b92915050565b60008151905061296a8161373b565b92915050565b600082601f83011261298157600080fd5b81356129918482602086016128da565b91505092915050565b6000813590506129a981613752565b92915050565b6000813590506129be81613769565b92915050565b6000813590506129d381613780565b92915050565b6000602082840312156129eb57600080fd5b60006129f984828501612946565b91505092915050565b600060208284031215612a1457600080fd5b6000612a228482850161295b565b91505092915050565b60008060408385031215612a3e57600080fd5b6000612a4c85828601612946565b9250506020612a5d85828601612946565b9150509250929050565b600080600060608486031215612a7c57600080fd5b6000612a8a86828701612946565b9350506020612a9b86828701612946565b9250506040612aac868287016129af565b9150509250925092565b60008060408385031215612ac957600080fd5b6000612ad785828601612946565b9250506020612ae8858286016129af565b9150509250929050565b600060208284031215612b0457600080fd5b600082013567ffffffffffffffff811115612b1e57600080fd5b612b2a84828501612970565b91505092915050565b600060208284031215612b4557600080fd5b6000612b538482850161299a565b91505092915050565b600060208284031215612b6e57600080fd5b6000612b7c848285016129af565b91505092915050565b600060208284031215612b9757600080fd5b6000612ba5848285016129c4565b91505092915050565b6000612bba8383612bc6565b60208301905092915050565b612bcf8161327e565b82525050565b612bde8161327e565b82525050565b6000612bef82613119565b612bf9818561313c565b9350612c0483613109565b8060005b83811015612c35578151612c1c8882612bae565b9750612c278361312f565b925050600181019050612c08565b5085935050505092915050565b612c4b81613290565b82525050565b612c5a816132d3565b82525050565b6000612c6b82613124565b612c758185613158565b9350612c858185602086016132e5565b612c8e81613480565b840191505092915050565b6000612ca6602383613158565b9150612cb182613491565b604082019050919050565b6000612cc9602683613158565b9150612cd4826134e0565b604082019050919050565b6000612cec602283613158565b9150612cf78261352f565b604082019050919050565b6000612d0f601483613158565b9150612d1a8261357e565b602082019050919050565b6000612d32601f83613158565b9150612d3d826135a7565b602082019050919050565b6000612d55601e83613158565b9150612d60826135d0565b602082019050919050565b6000612d78602883613158565b9150612d83826135f9565b604082019050919050565b6000612d9b602083613158565b9150612da682613648565b602082019050919050565b6000612dbe602583613158565b9150612dc982613671565b604082019050919050565b6000612de160008361314d565b9150612dec826136c0565b600082019050919050565b6000612e04602483613158565b9150612e0f826136c3565b604082019050919050565b6000612e27601b83613158565b9150612e3282613712565b602082019050919050565b612e46816132bc565b82525050565b612e55816132c6565b82525050565b6000612e6682612dd4565b9150819050919050565b6000602082019050612e856000830184612bd5565b92915050565b6000602082019050612ea06000830184612c42565b92915050565b60006020820190508181036000830152612ec08184612c60565b905092915050565b60006020820190508181036000830152612ee181612c99565b9050919050565b60006020820190508181036000830152612f0181612cbc565b9050919050565b60006020820190508181036000830152612f2181612cdf565b9050919050565b60006020820190508181036000830152612f4181612d02565b9050919050565b60006020820190508181036000830152612f6181612d25565b9050919050565b60006020820190508181036000830152612f8181612d48565b9050919050565b60006020820190508181036000830152612fa181612d6b565b9050919050565b60006020820190508181036000830152612fc181612d8e565b9050919050565b60006020820190508181036000830152612fe181612db1565b9050919050565b6000602082019050818103600083015261300181612df7565b9050919050565b6000602082019050818103600083015261302181612e1a565b9050919050565b600060208201905061303d6000830184612e3d565b92915050565b600060a0820190506130586000830188612e3d565b6130656020830187612c51565b81810360408301526130778186612be4565b90506130866060830185612bd5565b6130936080830184612e3d565b9695505050505050565b60006020820190506130b26000830184612e4c565b92915050565b60006130c26130d3565b90506130ce828261334a565b919050565b6000604051905090565b600067ffffffffffffffff8211156130f8576130f7613451565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b6000613174826132bc565b915061317f836132bc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131b4576131b36133c4565b5b828201905092915050565b60006131ca826132bc565b91506131d5836132bc565b9250826131e5576131e46133f3565b5b828204905092915050565b60006131fb826132bc565b9150613206836132bc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561323f5761323e6133c4565b5b828202905092915050565b6000613255826132bc565b9150613260836132bc565b925082821015613273576132726133c4565b5b828203905092915050565b60006132898261329c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132de826132bc565b9050919050565b60005b838110156133035780820151818401526020810190506132e8565b83811115613312576000848401525b50505050565b6000600282049050600182168061333057607f821691505b6020821081141561334457613343613422565b5b50919050565b61335382613480565b810181811067ffffffffffffffff8211171561337257613371613451565b5b80604052505050565b6000613386826132bc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133b9576133b86133c4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4661696c656420746f2073656e64204574686572000000000000000000000000600082015250565b7f45524332303a207472616e7366657220657863656564732062616c616e636500600082015250565b7f43616c6c6572206973206e6f7420746865206f776e6572206f72206465760000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b50565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2063616e6e6f74207472616e73666572207a65726f0000000000600082015250565b6137448161327e565b811461374f57600080fd5b50565b61375b81613290565b811461376657600080fd5b50565b613772816132bc565b811461377d57600080fd5b50565b613789816132c6565b811461379457600080fd5b5056fea2646970667358221220bbe722f86472ae628c1559b9f3494e8fbd7d34fef5f0f4cffc55264f4c4bcd3a64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,632
0x7f448e3d0186e1d19e23d5bd4420e5f57a54d1e7
/** *Submitted for verification at Etherscan.io on 2022-03-04 */ /* “Rainbow Kitty Inu is an ERC20 Token and a community that is passionate about blockchain technologies as well as Kitten and Doge life of all kinds. The developers have come up with a formula that allows "Rainbow" to soar in the charts while also generating donations and Good Karma. To achieve this our Tokenomics include a transaction Tax which is dedicated to donations and bringing awareness to the cause.” -No Presale. -100% Fair Launch -Day 1 will be rewarded. -Buybacks & Burns Tax 10% (buy/sell) Twitter: Twitter.com/RainbowKittyInu 🌎Website: https://www.rainbowkittyinu.com 🔹Telegram: https://t.me/RainbowKittyInu */ 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 RAINBOW 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 = 'Rainbow Kitty Inu ' ; string private _symbol = 'RAINBOW' ; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207581f88a5f1955fd245cbdd2c2b4cbcd5027685f6f7d1e85b57873579add6da564736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,633
0x43C39bA418f418c2fe5F8317329411E2B15b5B36
/** *Submitted for verification at Etherscan.io on 2021-10-22 */ /** *Submitted for verification at Etherscan.io on 2021-10-20 */ /* https://t.me/SlamDunkETH */ // 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 SLAMDUNKETH is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "SLAMDUNK"; string private constant _symbol = "SLAMDUNK" ; 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 = 1; //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 = 1000000000 * 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 = 6; _redisfee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (5 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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b80632634e5e8116100d15780632634e5e8146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612cc4565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906127ee565b61042a565b60405161016d9190612ca9565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612e46565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061279b565b610458565b6040516101d59190612ca9565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906128d1565b610531565b005b34801561021357600080fd5b5061021c610610565b6040516102299190612ebb565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612877565b610619565b005b34801561026757600080fd5b506102706106cb565b005b34801561027e57600080fd5b5061029960048036038101906102949190612701565b61073d565b6040516102a69190612e46565b60405180910390f35b3480156102bb57600080fd5b506102c461078e565b005b3480156102d257600080fd5b506102db6108e1565b6040516102e89190612bdb565b60405180910390f35b3480156102fd57600080fd5b5061030661090a565b6040516103139190612cc4565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906127ee565b610947565b6040516103509190612ca9565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061282e565b610965565b005b34801561038e57600080fd5b50610397610a8f565b005b3480156103a557600080fd5b506103ae610b09565b005b3480156103bc57600080fd5b506103d760048036038101906103d2919061275b565b611064565b6040516103e49190612e46565b60405180910390f35b60606040518060400160405280600881526020017f534c414d44554e4b000000000000000000000000000000000000000000000000815250905090565b600061043e6104376110eb565b84846110f3565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104658484846112be565b610526846104716110eb565b6105218560405180606001604052806028815260200161359960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d76110eb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7d9092919063ffffffff16565b6110f3565b600190509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105726110eb565b73ffffffffffffffffffffffffffffffffffffffff161461059257600080fd5b6000811161059f57600080fd5b6105ce6127106105c083670de0b6b3a7640000611ae190919063ffffffff16565b611b5c90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516106059190612e46565b60405180910390a150565b60006009905090565b6106216110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590612d86565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070c6110eb565b73ffffffffffffffffffffffffffffffffffffffff161461072c57600080fd5b600047905061073a81611ba6565b50565b6000610787600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca1565b9050919050565b6107966110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90612d86565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f534c414d44554e4b000000000000000000000000000000000000000000000000815250905090565b600061095b6109546110eb565b84846112be565b6001905092915050565b61096d6110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190612d86565b60405180910390fd5b60005b8151811015610a8b576001600a6000848481518110610a1f57610a1e613203565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a839061315c565b9150506109fd565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ad06110eb565b73ffffffffffffffffffffffffffffffffffffffff1614610af057600080fd5b6000610afb3061073d565b9050610b0681611d0f565b50565b610b116110eb565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9590612d86565b60405180910390fd5b600f60149054906101000a900460ff1615610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be590612e06565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c7d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006110f3565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc357600080fd5b505afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb919061272e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061272e565b6040518363ffffffff1660e01b8152600401610db2929190612bf6565b602060405180830381600087803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e04919061272e565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e8d3061073d565b600080610e986108e1565b426040518863ffffffff1660e01b8152600401610eba96959493929190612c48565b6060604051808303818588803b158015610ed357600080fd5b505af1158015610ee7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f0c91906128fe565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550670de0b6b3a76400006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161100e929190612c1f565b602060405180830381600087803b15801561102857600080fd5b505af115801561103c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106091906128a4565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a90612de6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ca90612d26565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112b19190612e46565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132590612dc6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561139e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139590612ce6565b60405180910390fd5b600081116113e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d890612da6565b60405180910390fd5b6113e96108e1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561145757506114276108e1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119ba57600f60179054906101000a900460ff161561168a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114d957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115335750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561158d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561168957600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115d36110eb565b73ffffffffffffffffffffffffffffffffffffffff1614806116495750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116316110eb565b73ffffffffffffffffffffffffffffffffffffffff16145b611688576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167f90612e26565b60405180910390fd5b5b5b60105481111561169957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561173d5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61174657600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117f15750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118475750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561185f5750600f60179054906101000a900460ff165b156119005742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118af57600080fd5b6005426118bc9190612f7c565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061190b3061073d565b9050600f60159054906101000a900460ff161580156119785750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119905750600f60169054906101000a900460ff165b156119b85761199e81611d0f565b600047905060008111156119b6576119b547611ba6565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a615750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6b57600090505b611a7784848484611f97565b50505050565b6000838311158290611ac5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abc9190612cc4565b60405180910390fd5b5060008385611ad4919061305d565b9050809150509392505050565b600080831415611af45760009050611b56565b60008284611b029190613003565b9050828482611b119190612fd2565b14611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890612d66565b60405180910390fd5b809150505b92915050565b6000611b9e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611fc4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bf6600284611b5c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c21573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c72600284611b5c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c9d573d6000803e3d6000fd5b5050565b6000600654821115611ce8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cdf90612d06565b60405180910390fd5b6000611cf2612027565b9050611d078184611b5c90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d4757611d46613232565b5b604051908082528060200260200182016040528015611d755781602001602082028036833780820191505090505b5090503081600081518110611d8d57611d8c613203565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2f57600080fd5b505afa158015611e43573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e67919061272e565b81600181518110611e7b57611e7a613203565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ee230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110f3565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f46959493929190612e61565b600060405180830381600087803b158015611f6057600080fd5b505af1158015611f74573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b80611fa557611fa4612052565b5b611fb0848484612083565b80611fbe57611fbd61224e565b5b50505050565b6000808311829061200b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120029190612cc4565b60405180910390fd5b506000838561201a9190612fd2565b9050809150509392505050565b6000806000612034612260565b9150915061204b8183611b5c90919063ffffffff16565b9250505090565b600060085414801561206657506000600954145b1561207057612081565b600060088190555060006009819055505b565b600080600080600080612095876122bf565b9550955095509550955095506120f386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d4816123cf565b6121de848361248c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161223b9190612e46565b60405180910390a3505050505050505050565b60066008819055506002600981905550565b600080600060065490506000670de0b6b3a76400009050612294670de0b6b3a7640000600654611b5c90919063ffffffff16565b8210156122b257600654670de0b6b3a76400009350935050506122bb565b81819350935050505b9091565b60008060008060008060008060006122dc8a6008546009546124c6565b92509250925060006122ec612027565b905060008060006122ff8e87878761255c565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061236983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a7d565b905092915050565b60008082846123809190612f7c565b9050838110156123c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123bc90612d46565b60405180910390fd5b8091505092915050565b60006123d9612027565b905060006123f08284611ae190919063ffffffff16565b905061244481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124a18260065461232790919063ffffffff16565b6006819055506124bc8160075461237190919063ffffffff16565b6007819055505050565b6000806000806124f260646124e4888a611ae190919063ffffffff16565b611b5c90919063ffffffff16565b9050600061251c606461250e888b611ae190919063ffffffff16565b611b5c90919063ffffffff16565b9050600061254582612537858c61232790919063ffffffff16565b61232790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806125758589611ae190919063ffffffff16565b9050600061258c8689611ae190919063ffffffff16565b905060006125a38789611ae190919063ffffffff16565b905060006125cc826125be858761232790919063ffffffff16565b61232790919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006125f86125f384612efb565b612ed6565b9050808382526020820190508285602086028201111561261b5761261a613266565b5b60005b8581101561264b57816126318882612655565b84526020840193506020830192505060018101905061261e565b5050509392505050565b60008135905061266481613553565b92915050565b60008151905061267981613553565b92915050565b600082601f83011261269457612693613261565b5b81356126a48482602086016125e5565b91505092915050565b6000813590506126bc8161356a565b92915050565b6000815190506126d18161356a565b92915050565b6000813590506126e681613581565b92915050565b6000815190506126fb81613581565b92915050565b60006020828403121561271757612716613270565b5b600061272584828501612655565b91505092915050565b60006020828403121561274457612743613270565b5b60006127528482850161266a565b91505092915050565b6000806040838503121561277257612771613270565b5b600061278085828601612655565b925050602061279185828601612655565b9150509250929050565b6000806000606084860312156127b4576127b3613270565b5b60006127c286828701612655565b93505060206127d386828701612655565b92505060406127e4868287016126d7565b9150509250925092565b6000806040838503121561280557612804613270565b5b600061281385828601612655565b9250506020612824858286016126d7565b9150509250929050565b60006020828403121561284457612843613270565b5b600082013567ffffffffffffffff8111156128625761286161326b565b5b61286e8482850161267f565b91505092915050565b60006020828403121561288d5761288c613270565b5b600061289b848285016126ad565b91505092915050565b6000602082840312156128ba576128b9613270565b5b60006128c8848285016126c2565b91505092915050565b6000602082840312156128e7576128e6613270565b5b60006128f5848285016126d7565b91505092915050565b60008060006060848603121561291757612916613270565b5b6000612925868287016126ec565b9350506020612936868287016126ec565b9250506040612947868287016126ec565b9150509250925092565b600061295d8383612969565b60208301905092915050565b61297281613091565b82525050565b61298181613091565b82525050565b600061299282612f37565b61299c8185612f5a565b93506129a783612f27565b8060005b838110156129d85781516129bf8882612951565b97506129ca83612f4d565b9250506001810190506129ab565b5085935050505092915050565b6129ee816130a3565b82525050565b6129fd816130e6565b82525050565b6000612a0e82612f42565b612a188185612f6b565b9350612a288185602086016130f8565b612a3181613275565b840191505092915050565b6000612a49602383612f6b565b9150612a5482613286565b604082019050919050565b6000612a6c602a83612f6b565b9150612a77826132d5565b604082019050919050565b6000612a8f602283612f6b565b9150612a9a82613324565b604082019050919050565b6000612ab2601b83612f6b565b9150612abd82613373565b602082019050919050565b6000612ad5602183612f6b565b9150612ae08261339c565b604082019050919050565b6000612af8602083612f6b565b9150612b03826133eb565b602082019050919050565b6000612b1b602983612f6b565b9150612b2682613414565b604082019050919050565b6000612b3e602583612f6b565b9150612b4982613463565b604082019050919050565b6000612b61602483612f6b565b9150612b6c826134b2565b604082019050919050565b6000612b84601783612f6b565b9150612b8f82613501565b602082019050919050565b6000612ba7601183612f6b565b9150612bb28261352a565b602082019050919050565b612bc6816130cf565b82525050565b612bd5816130d9565b82525050565b6000602082019050612bf06000830184612978565b92915050565b6000604082019050612c0b6000830185612978565b612c186020830184612978565b9392505050565b6000604082019050612c346000830185612978565b612c416020830184612bbd565b9392505050565b600060c082019050612c5d6000830189612978565b612c6a6020830188612bbd565b612c7760408301876129f4565b612c8460608301866129f4565b612c916080830185612978565b612c9e60a0830184612bbd565b979650505050505050565b6000602082019050612cbe60008301846129e5565b92915050565b60006020820190508181036000830152612cde8184612a03565b905092915050565b60006020820190508181036000830152612cff81612a3c565b9050919050565b60006020820190508181036000830152612d1f81612a5f565b9050919050565b60006020820190508181036000830152612d3f81612a82565b9050919050565b60006020820190508181036000830152612d5f81612aa5565b9050919050565b60006020820190508181036000830152612d7f81612ac8565b9050919050565b60006020820190508181036000830152612d9f81612aeb565b9050919050565b60006020820190508181036000830152612dbf81612b0e565b9050919050565b60006020820190508181036000830152612ddf81612b31565b9050919050565b60006020820190508181036000830152612dff81612b54565b9050919050565b60006020820190508181036000830152612e1f81612b77565b9050919050565b60006020820190508181036000830152612e3f81612b9a565b9050919050565b6000602082019050612e5b6000830184612bbd565b92915050565b600060a082019050612e766000830188612bbd565b612e8360208301876129f4565b8181036040830152612e958186612987565b9050612ea46060830185612978565b612eb16080830184612bbd565b9695505050505050565b6000602082019050612ed06000830184612bcc565b92915050565b6000612ee0612ef1565b9050612eec828261312b565b919050565b6000604051905090565b600067ffffffffffffffff821115612f1657612f15613232565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f87826130cf565b9150612f92836130cf565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc757612fc66131a5565b5b828201905092915050565b6000612fdd826130cf565b9150612fe8836130cf565b925082612ff857612ff76131d4565b5b828204905092915050565b600061300e826130cf565b9150613019836130cf565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613052576130516131a5565b5b828202905092915050565b6000613068826130cf565b9150613073836130cf565b925082821015613086576130856131a5565b5b828203905092915050565b600061309c826130af565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130f1826130cf565b9050919050565b60005b838110156131165780820151818401526020810190506130fb565b83811115613125576000848401525b50505050565b61313482613275565b810181811067ffffffffffffffff8211171561315357613152613232565b5b80604052505050565b6000613167826130cf565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561319a576131996131a5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61355c81613091565b811461356757600080fd5b50565b613573816130a3565b811461357e57600080fd5b50565b61358a816130cf565b811461359557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220dcede9285b3dd6f69b239391389f9a975df158c2d42602851a71bd87069532a264736f6c63430008070033
{"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"}]}}
6,634
0x6b11bd1dde1f859fb63f08bbaf605707ea3ebf84
/** *Submitted for verification at Etherscan.io on 2022-02-19 */ // https://t.me/XiJinpingEth // 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 XiJinPing is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Xi Jinping";// string private constant _symbol = "XIJIPI";// 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; uint256 public launchBlock; //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(0x267C27Ad4Fd06A390F4Df0fCA11C8c16A172b06C);// address payable private _marketingAddress = payable(0x267C27Ad4Fd06A390F4Df0fCA11C8c16A172b06C);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = true; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 150000 * 10**9; // uint256 public _maxWalletSize = 250000 * 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(block.number <= launchBlock && 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613034565b610702565b005b34801561021157600080fd5b5061021a61082c565b6040516102279190613491565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f94565b610869565b604051610264919061345b565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f9190613476565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613673565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f41565b6108bc565b6040516102f7919061345b565b60405180910390f35b34801561030c57600080fd5b50610315610995565b6040516103229190613673565b60405180910390f35b34801561033757600080fd5b5061034061099b565b60405161034d91906136e8565b60405180910390f35b34801561036257600080fd5b5061036b6109a4565b6040516103789190613440565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ea7565b6109ca565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061307d565b610aba565b005b3480156103df57600080fd5b506103e8610b6b565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ea7565b610c3c565b60405161041e9190613673565b60405180910390f35b34801561043357600080fd5b5061043c610c8d565b005b34801561044a57600080fd5b50610465600480360381019061046091906130aa565b610de0565b005b34801561047357600080fd5b5061047c610e7f565b6040516104899190613673565b60405180910390f35b34801561049e57600080fd5b506104a7610e85565b6040516104b49190613440565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061307d565b610eae565b005b3480156104f257600080fd5b506104fb610f67565b6040516105089190613673565b60405180910390f35b34801561051d57600080fd5b50610526610f6d565b6040516105339190613491565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130aa565b610faa565b005b34801561057157600080fd5b5061058c600480360381019061058791906130d7565b611049565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612f94565b611100565b6040516105c2919061345b565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ea7565b61111e565b6040516105ff919061345b565b60405180910390f35b34801561061457600080fd5b5061061d61113e565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fd4565b611217565b005b34801561065457600080fd5b5061065d611351565b60405161066a9190613673565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f01565b611357565b6040516106a79190613673565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130aa565b6113de565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ea7565b61147d565b005b61070a61163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135d3565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a66565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139bf565b91505061079a565b5050565b60606040518060400160405280600a81526020017f5869204a696e70696e6700000000000000000000000000000000000000000000815250905090565b600061087d61087661163f565b8484611647565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000662386f26fc10000905090565b60006108c9848484611812565b61098a846108d561163f565b61098585604051806060016040528060288152602001613f1460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b61163f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121e69092919063ffffffff16565b611647565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d261163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a56906135d3565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac261163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b46906135d3565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bac61163f565b73ffffffffffffffffffffffffffffffffffffffff161480610c225750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0a61163f565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2b57600080fd5b6000479050610c398161224a565b50565b6000610c86600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612345565b9050919050565b610c9561163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d19906135d3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610de861163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6c906135d3565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb661163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3a906135d3565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600681526020017f58494a4950490000000000000000000000000000000000000000000000000000815250905090565b610fb261163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461103f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611036906135d3565b60405180910390fd5b8060198190555050565b61105161163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d5906135d3565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111461110d61163f565b8484611812565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661117f61163f565b73ffffffffffffffffffffffffffffffffffffffff1614806111f55750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111dd61163f565b73ffffffffffffffffffffffffffffffffffffffff16145b6111fe57600080fd5b600061120930610c3c565b9050611214816123b3565b50565b61121f61163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a3906135d3565b60405180910390fd5b60005b8383905081101561134b5781600560008686858181106112d2576112d1613a66565b5b90506020020160208101906112e79190612ea7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611343906139bf565b9150506112af565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e661163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146a906135d3565b60405180910390fd5b8060188190555050565b61148561163f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611512576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611509906135d3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611582576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157990613533565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ae90613653565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611727576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171e90613553565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118059190613673565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611882576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187990613613565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118e9906134b3565b60405180910390fd5b60008111611935576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192c906135f3565b60405180910390fd5b61193d610e85565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ab575061197b610e85565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ee557601660149054906101000a900460ff16611a3a576119cc610e85565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a30906134d3565b60405180910390fd5b5b601754811115611a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7690613513565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b235750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5990613573565b60405180910390fd5b6008544311158015611bc15750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c1b5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cb1576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d5e5760185481611d1384610c3c565b611d1d91906137a9565b10611d5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5490613633565b60405180910390fd5b5b6000611d6930610c3c565b9050600060195482101590506017548210611d845760175491505b808015611d9e5750601660159054906101000a900460ff16155b8015611df85750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e0e575060168054906101000a900460ff165b8015611e645750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611eba5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ee257611ec8826123b3565b60004790506000811115611ee057611edf4761224a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f8c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061203f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561203e5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561204d57600090506121d4565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156120f85750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211057600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121bb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121d357600b54600d81905550600c54600e819055505b5b6121e08484848461263b565b50505050565b600083831115829061222e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122259190613491565b60405180910390fd5b506000838561223d919061388a565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61229a60028461266890919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122c5573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61231660028461266890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612341573d6000803e3d6000fd5b5050565b600060065482111561238c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612383906134f3565b60405180910390fd5b60006123966126b2565b90506123ab818461266890919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123eb576123ea613a95565b5b6040519080825280602002602001820160405280156124195781602001602082028036833780820191505090505b509050308160008151811061243157612430613a66565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124d357600080fd5b505afa1580156124e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061250b9190612ed4565b8160018151811061251f5761251e613a66565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061258630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611647565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125ea95949392919061368e565b600060405180830381600087803b15801561260457600080fd5b505af1158015612618573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612649576126486126dd565b5b612654848484612720565b80612662576126616128eb565b5b50505050565b60006126aa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128ff565b905092915050565b60008060006126bf612962565b915091506126d6818361266890919063ffffffff16565b9250505090565b6000600d541480156126f157506000600e54145b156126fb5761271e565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612732876129be565b95509550955095509550955061279086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a2690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061282585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287181612ace565b61287b8483612b8b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128d89190613673565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161293d9190613491565b60405180910390fd5b506000838561295591906137ff565b9050809150509392505050565b600080600060065490506000662386f26fc100009050612994662386f26fc1000060065461266890919063ffffffff16565b8210156129b157600654662386f26fc100009350935050506129ba565b81819350935050505b9091565b60008060008060008060008060006129db8a600d54600e54612bc5565b92509250925060006129eb6126b2565b905060008060006129fe8e878787612c5b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a6883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121e6565b905092915050565b6000808284612a7f91906137a9565b905083811015612ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612abb90613593565b60405180910390fd5b8091505092915050565b6000612ad86126b2565b90506000612aef8284612ce490919063ffffffff16565b9050612b4381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a7090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ba082600654612a2690919063ffffffff16565b600681905550612bbb81600754612a7090919063ffffffff16565b6007819055505050565b600080600080612bf16064612be3888a612ce490919063ffffffff16565b61266890919063ffffffff16565b90506000612c1b6064612c0d888b612ce490919063ffffffff16565b61266890919063ffffffff16565b90506000612c4482612c36858c612a2690919063ffffffff16565b612a2690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c748589612ce490919063ffffffff16565b90506000612c8b8689612ce490919063ffffffff16565b90506000612ca28789612ce490919063ffffffff16565b90506000612ccb82612cbd8587612a2690919063ffffffff16565b612a2690919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612cf75760009050612d59565b60008284612d059190613830565b9050828482612d1491906137ff565b14612d54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4b906135b3565b60405180910390fd5b809150505b92915050565b6000612d72612d6d84613728565b613703565b90508083825260208201905082856020860282011115612d9557612d94613ace565b5b60005b85811015612dc55781612dab8882612dcf565b845260208401935060208301925050600181019050612d98565b5050509392505050565b600081359050612dde81613ece565b92915050565b600081519050612df381613ece565b92915050565b60008083601f840112612e0f57612e0e613ac9565b5b8235905067ffffffffffffffff811115612e2c57612e2b613ac4565b5b602083019150836020820283011115612e4857612e47613ace565b5b9250929050565b600082601f830112612e6457612e63613ac9565b5b8135612e74848260208601612d5f565b91505092915050565b600081359050612e8c81613ee5565b92915050565b600081359050612ea181613efc565b92915050565b600060208284031215612ebd57612ebc613ad8565b5b6000612ecb84828501612dcf565b91505092915050565b600060208284031215612eea57612ee9613ad8565b5b6000612ef884828501612de4565b91505092915050565b60008060408385031215612f1857612f17613ad8565b5b6000612f2685828601612dcf565b9250506020612f3785828601612dcf565b9150509250929050565b600080600060608486031215612f5a57612f59613ad8565b5b6000612f6886828701612dcf565b9350506020612f7986828701612dcf565b9250506040612f8a86828701612e92565b9150509250925092565b60008060408385031215612fab57612faa613ad8565b5b6000612fb985828601612dcf565b9250506020612fca85828601612e92565b9150509250929050565b600080600060408486031215612fed57612fec613ad8565b5b600084013567ffffffffffffffff81111561300b5761300a613ad3565b5b61301786828701612df9565b9350935050602061302a86828701612e7d565b9150509250925092565b60006020828403121561304a57613049613ad8565b5b600082013567ffffffffffffffff81111561306857613067613ad3565b5b61307484828501612e4f565b91505092915050565b60006020828403121561309357613092613ad8565b5b60006130a184828501612e7d565b91505092915050565b6000602082840312156130c0576130bf613ad8565b5b60006130ce84828501612e92565b91505092915050565b600080600080608085870312156130f1576130f0613ad8565b5b60006130ff87828801612e92565b945050602061311087828801612e92565b935050604061312187828801612e92565b925050606061313287828801612e92565b91505092959194509250565b600061314a8383613156565b60208301905092915050565b61315f816138be565b82525050565b61316e816138be565b82525050565b600061317f82613764565b6131898185613787565b935061319483613754565b8060005b838110156131c55781516131ac888261313e565b97506131b78361377a565b925050600181019050613198565b5085935050505092915050565b6131db816138d0565b82525050565b6131ea81613913565b82525050565b6131f981613925565b82525050565b600061320a8261376f565b6132148185613798565b935061322481856020860161395b565b61322d81613add565b840191505092915050565b6000613245602383613798565b915061325082613aee565b604082019050919050565b6000613268603f83613798565b915061327382613b3d565b604082019050919050565b600061328b602a83613798565b915061329682613b8c565b604082019050919050565b60006132ae601c83613798565b91506132b982613bdb565b602082019050919050565b60006132d1602683613798565b91506132dc82613c04565b604082019050919050565b60006132f4602283613798565b91506132ff82613c53565b604082019050919050565b6000613317602383613798565b915061332282613ca2565b604082019050919050565b600061333a601b83613798565b915061334582613cf1565b602082019050919050565b600061335d602183613798565b915061336882613d1a565b604082019050919050565b6000613380602083613798565b915061338b82613d69565b602082019050919050565b60006133a3602983613798565b91506133ae82613d92565b604082019050919050565b60006133c6602583613798565b91506133d182613de1565b604082019050919050565b60006133e9602383613798565b91506133f482613e30565b604082019050919050565b600061340c602483613798565b915061341782613e7f565b604082019050919050565b61342b816138fc565b82525050565b61343a81613906565b82525050565b60006020820190506134556000830184613165565b92915050565b600060208201905061347060008301846131d2565b92915050565b600060208201905061348b60008301846131e1565b92915050565b600060208201905081810360008301526134ab81846131ff565b905092915050565b600060208201905081810360008301526134cc81613238565b9050919050565b600060208201905081810360008301526134ec8161325b565b9050919050565b6000602082019050818103600083015261350c8161327e565b9050919050565b6000602082019050818103600083015261352c816132a1565b9050919050565b6000602082019050818103600083015261354c816132c4565b9050919050565b6000602082019050818103600083015261356c816132e7565b9050919050565b6000602082019050818103600083015261358c8161330a565b9050919050565b600060208201905081810360008301526135ac8161332d565b9050919050565b600060208201905081810360008301526135cc81613350565b9050919050565b600060208201905081810360008301526135ec81613373565b9050919050565b6000602082019050818103600083015261360c81613396565b9050919050565b6000602082019050818103600083015261362c816133b9565b9050919050565b6000602082019050818103600083015261364c816133dc565b9050919050565b6000602082019050818103600083015261366c816133ff565b9050919050565b60006020820190506136886000830184613422565b92915050565b600060a0820190506136a36000830188613422565b6136b060208301876131f0565b81810360408301526136c28186613174565b90506136d16060830185613165565b6136de6080830184613422565b9695505050505050565b60006020820190506136fd6000830184613431565b92915050565b600061370d61371e565b9050613719828261398e565b919050565b6000604051905090565b600067ffffffffffffffff82111561374357613742613a95565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137b4826138fc565b91506137bf836138fc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156137f4576137f3613a08565b5b828201905092915050565b600061380a826138fc565b9150613815836138fc565b92508261382557613824613a37565b5b828204905092915050565b600061383b826138fc565b9150613846836138fc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561387f5761387e613a08565b5b828202905092915050565b6000613895826138fc565b91506138a0836138fc565b9250828210156138b3576138b2613a08565b5b828203905092915050565b60006138c9826138dc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061391e82613937565b9050919050565b6000613930826138fc565b9050919050565b600061394282613949565b9050919050565b6000613954826138dc565b9050919050565b60005b8381101561397957808201518184015260208101905061395e565b83811115613988576000848401525b50505050565b61399782613add565b810181811067ffffffffffffffff821117156139b6576139b5613a95565b5b80604052505050565b60006139ca826138fc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156139fd576139fc613a08565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613ed7816138be565b8114613ee257600080fd5b50565b613eee816138d0565b8114613ef957600080fd5b50565b613f05816138fc565b8114613f1057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e9955c0470f1594064481019300e890f8d0a64ebbbd9e018ddd6a492f0e65c0364736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,635
0xd443Ac05561CF72c3d89cbaBc058aC5E2B1A01C3
/** ╓▄██▌ ███▀██ ║█▌ ▄█▒ ║█████▌ .╓╦╦╓ ▐█▌ ╓█▌ ╓╬╬╬╬╬╬ ║█████▌ ╠╬╬╬╬╬╬░ ║█▌ ╠█▌ ▐╬╠╬╬╬╬Γ ██████⌐ ╩╠╬╬╬╠░ ▐██╙╙██ ╠╬╬╬╬ ╫██▄███ ╔╬╬╬╩▒ ▐█╙████▌ ""` ,▄████▄╠▀" ,╓▄▄▓████████████ ,,,,╓▄▄▄▄▄▓████████████▀▀▀▀╙╙██████▌ └╙╙▀▀▀▀▀█▀▀▀████████▌ ▐██████▌ ███████▌ ║██████⌐ ███████▌ ███████ ██╣█████ ▐██████▌ ,██║█████ ███████▌ ,██╔█████ ▐███████⌐ ╓█▀á████▌ ████████ ╔█`▓████▀ ║███████▌ ▓▀╓█████▀ ]████████ ╓╩ ██████└ ████████⌐ " ▄█████▀ ▓███████▌ ╓██████" ╫███████▀ ▄█████▀^ å█████▀▀ ,▄██▀▀╙└ ╔██▀╙` «╩╙└ "╙ https://t.me/HattoriHanzoETH **/ // 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 Hanzo is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hattori Hanzo"; string private constant _symbol = "DEV1L"; 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 = 8; 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) public _buyMap; address payable private _taaxAddress = payable(0xa89890C4DD25b3Fc62544E2533111D90c0C6763d); address payable private _ttaxAddress = payable(0xa89890C4DD25b3Fc62544E2533111D90c0C6763d); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 6660000000 * 10**9; uint256 public _maxWalletSize = 20000000000 * 10**9; uint256 public _swapTokensAtAmount = 10000000000 * 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[_taaxAddress] = true; _isExcludedFromFee[_ttaxAddress] = 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 { _ttaxAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _taaxAddress || _msgSender() == _ttaxAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function 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 > 9000000000 * 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; } } }
0x6080604052600436106101bb5760003560e01c80637f2feddc116100ec578063a9059cbb1161008a578063c492f04611610064578063c492f04614610505578063dd62ed3e14610525578063ea1644d51461056b578063f2fde38b1461058b57600080fd5b8063a9059cbb146104a0578063bfd79284146104c0578063c3c8cd80146104f057600080fd5b80638f9a55c0116100c65780638f9a55c01461041c57806395d89b411461043257806398a5c31514610460578063a2a957bb1461048057600080fd5b80637f2feddc146103b15780638da5cb5b146103de5780638f70ccf7146103fc57600080fd5b806349bd5a5e1161015957806370a082311161013357806370a0823114610346578063715018a61461036657806374010ece1461037b5780637d1db4a51461039b57600080fd5b806349bd5a5e146102ef5780636d8aa8f81461030f5780636fc3eaec1461033157600080fd5b806318160ddd1161019557806318160ddd1461027757806323b872dd1461029d5780632fd689e3146102bd578063313ce567146102d357600080fd5b806306fdde03146101c7578063095ea7b31461020f5780631694505e1461023f57600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b5060408051808201909152600d81526c486174746f72692048616e7a6f60981b60208201525b6040516102069190611981565b60405180910390f35b34801561021b57600080fd5b5061022f61022a3660046119eb565b6105ab565b6040519015158152602001610206565b34801561024b57600080fd5b5060145461025f906001600160a01b031681565b6040516001600160a01b039091168152602001610206565b34801561028357600080fd5b50683635c9adc5dea000005b604051908152602001610206565b3480156102a957600080fd5b5061022f6102b8366004611a17565b6105c2565b3480156102c957600080fd5b5061028f60185481565b3480156102df57600080fd5b5060405160098152602001610206565b3480156102fb57600080fd5b5060155461025f906001600160a01b031681565b34801561031b57600080fd5b5061032f61032a366004611a6d565b61062b565b005b34801561033d57600080fd5b5061032f61067c565b34801561035257600080fd5b5061028f610361366004611a88565b6106c7565b34801561037257600080fd5b5061032f6106e9565b34801561038757600080fd5b5061032f610396366004611aa5565b61075d565b3480156103a757600080fd5b5061028f60165481565b3480156103bd57600080fd5b5061028f6103cc366004611a88565b60116020526000908152604090205481565b3480156103ea57600080fd5b506000546001600160a01b031661025f565b34801561040857600080fd5b5061032f610417366004611a6d565b61079c565b34801561042857600080fd5b5061028f60175481565b34801561043e57600080fd5b506040805180820190915260058152641111558c5360da1b60208201526101f9565b34801561046c57600080fd5b5061032f61047b366004611aa5565b6107e4565b34801561048c57600080fd5b5061032f61049b366004611abe565b610813565b3480156104ac57600080fd5b5061022f6104bb3660046119eb565b6109c9565b3480156104cc57600080fd5b5061022f6104db366004611a88565b60106020526000908152604090205460ff1681565b3480156104fc57600080fd5b5061032f6109d6565b34801561051157600080fd5b5061032f610520366004611af0565b610a2a565b34801561053157600080fd5b5061028f610540366004611b74565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057757600080fd5b5061032f610586366004611aa5565b610acb565b34801561059757600080fd5b5061032f6105a6366004611a88565b610afa565b60006105b8338484610be4565b5060015b92915050565b60006105cf848484610d08565b610621843361061c85604051806060016040528060288152602001611d28602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611244565b610be4565b5060019392505050565b6000546001600160a01b0316331461065e5760405162461bcd60e51b815260040161065590611bad565b60405180910390fd5b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806106b157506013546001600160a01b0316336001600160a01b0316145b6106ba57600080fd5b476106c48161127e565b50565b6001600160a01b0381166000908152600260205260408120546105bc906112bc565b6000546001600160a01b031633146107135760405162461bcd60e51b815260040161065590611bad565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161065590611bad565b677ce66c50e28400008111156106c457601655565b6000546001600160a01b031633146107c65760405162461bcd60e51b815260040161065590611bad565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461080e5760405162461bcd60e51b815260040161065590611bad565b601855565b6000546001600160a01b0316331461083d5760405162461bcd60e51b815260040161065590611bad565b600484111561089c5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610655565b60148211156108f85760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610655565b60048311156109585760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610655565b60148111156109b55760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610655565b600893909355600a91909155600955600b55565b60006105b8338484610d08565b6012546001600160a01b0316336001600160a01b03161480610a0b57506013546001600160a01b0316336001600160a01b0316145b610a1457600080fd5b6000610a1f306106c7565b90506106c481611340565b6000546001600160a01b03163314610a545760405162461bcd60e51b815260040161065590611bad565b60005b82811015610ac5578160056000868685818110610a7657610a76611be2565b9050602002016020810190610a8b9190611a88565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610abd81611c0e565b915050610a57565b50505050565b6000546001600160a01b03163314610af55760405162461bcd60e51b815260040161065590611bad565b601755565b6000546001600160a01b03163314610b245760405162461bcd60e51b815260040161065590611bad565b6001600160a01b038116610b895760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610655565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610c465760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610655565b6001600160a01b038216610ca75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610655565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d6c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610655565b6001600160a01b038216610dce5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610655565b60008111610e305760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610655565b6000546001600160a01b03848116911614801590610e5c57506000546001600160a01b03838116911614155b1561113d57601554600160a01b900460ff16610ef5576000546001600160a01b03848116911614610ef55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610655565b601654811115610f475760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610655565b6001600160a01b03831660009081526010602052604090205460ff16158015610f8957506001600160a01b03821660009081526010602052604090205460ff16155b610fe15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610655565b6015546001600160a01b038381169116146110665760175481611003846106c7565b61100d9190611c29565b106110665760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610655565b6000611071306106c7565b60185460165491925082101590821061108a5760165491505b8080156110a15750601554600160a81b900460ff16155b80156110bb57506015546001600160a01b03868116911614155b80156110d05750601554600160b01b900460ff165b80156110f557506001600160a01b03851660009081526005602052604090205460ff16155b801561111a57506001600160a01b03841660009081526005602052604090205460ff16155b1561113a5761112882611340565b478015611138576111384761127e565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061117f57506001600160a01b03831660009081526005602052604090205460ff165b806111b157506015546001600160a01b038581169116148015906111b157506015546001600160a01b03848116911614155b156111be57506000611238565b6015546001600160a01b0385811691161480156111e957506014546001600160a01b03848116911614155b156111fb57600854600c55600954600d555b6015546001600160a01b03848116911614801561122657506014546001600160a01b03858116911614155b1561123857600a54600c55600b54600d555b610ac5848484846114c9565b600081848411156112685760405162461bcd60e51b81526004016106559190611981565b5060006112758486611c41565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156112b8573d6000803e3d6000fd5b5050565b60006006548211156113235760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610655565b600061132d6114f7565b9050611339838261151a565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061138857611388611be2565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113dc57600080fd5b505afa1580156113f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114149190611c58565b8160018151811061142757611427611be2565b6001600160a01b03928316602091820292909201015260145461144d9130911684610be4565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611486908590600090869030904290600401611c75565b600060405180830381600087803b1580156114a057600080fd5b505af11580156114b4573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114d6576114d661155c565b6114e184848461158a565b80610ac557610ac5600e54600c55600f54600d55565b6000806000611504611681565b9092509050611513828261151a565b9250505090565b600061133983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116c3565b600c5415801561156c5750600d54155b1561157357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061159c876116f1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115ce908761174e565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115fd9086611790565b6001600160a01b03891660009081526002602052604090205561161f816117ef565b6116298483611839565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166e91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061169d828261151a565b8210156116ba57505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836116e45760405162461bcd60e51b81526004016106559190611981565b5060006112758486611ce6565b600080600080600080600080600061170e8a600c54600d5461185d565b925092509250600061171e6114f7565b905060008060006117318e8787876118b2565b919e509c509a509598509396509194505050505091939550919395565b600061133983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611244565b60008061179d8385611c29565b9050838110156113395760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610655565b60006117f96114f7565b905060006118078383611902565b306000908152600260205260409020549091506118249082611790565b30600090815260026020526040902055505050565b600654611846908361174e565b6006556007546118569082611790565b6007555050565b600080808061187760646118718989611902565b9061151a565b9050600061188a60646118718a89611902565b905060006118a28261189c8b8661174e565b9061174e565b9992985090965090945050505050565b60008080806118c18886611902565b905060006118cf8887611902565b905060006118dd8888611902565b905060006118ef8261189c868661174e565b939b939a50919850919650505050505050565b600082611911575060006105bc565b600061191d8385611d08565b90508261192a8583611ce6565b146113395760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610655565b600060208083528351808285015260005b818110156119ae57858101830151858201604001528201611992565b818111156119c0576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106c457600080fd5b600080604083850312156119fe57600080fd5b8235611a09816119d6565b946020939093013593505050565b600080600060608486031215611a2c57600080fd5b8335611a37816119d6565b92506020840135611a47816119d6565b929592945050506040919091013590565b80358015158114611a6857600080fd5b919050565b600060208284031215611a7f57600080fd5b61133982611a58565b600060208284031215611a9a57600080fd5b8135611339816119d6565b600060208284031215611ab757600080fd5b5035919050565b60008060008060808587031215611ad457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b0557600080fd5b833567ffffffffffffffff80821115611b1d57600080fd5b818601915086601f830112611b3157600080fd5b813581811115611b4057600080fd5b8760208260051b8501011115611b5557600080fd5b602092830195509350611b6b9186019050611a58565b90509250925092565b60008060408385031215611b8757600080fd5b8235611b92816119d6565b91506020830135611ba2816119d6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c2257611c22611bf8565b5060010190565b60008219821115611c3c57611c3c611bf8565b500190565b600082821015611c5357611c53611bf8565b500390565b600060208284031215611c6a57600080fd5b8151611339816119d6565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611cc55784516001600160a01b031683529383019391830191600101611ca0565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d0357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d2257611d22611bf8565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203e9eacb4758fec098851e9268be3ad73ffdafe3bab3dd7bf518aa119a9f7905b64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,636
0x1e96e875684f959640d55e42f6bdc67ca553d935
/** *Submitted for verification at Etherscan.io on 2021-11-23 */ pragma solidity ^0.8.9; // SPDX-License-Identifier: MIT interface ERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } interface ERC20Metadata is ERC20 { 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; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { _setOwner(msg.sender); } 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 { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require( newOwner != address(0), "Ownable: new owner is the zero address" ); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated( address indexed token0, address indexed token1, address pair, uint256 ); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint256) external view returns (address pair); function allPairsLength() external view returns (uint256); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IpancakePair { event Approval( address indexed owner, address indexed spender, uint256 value ); event Transfer(address indexed from, address indexed to, uint256 value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 value) external returns (bool); function transfer(address to, uint256 value) external returns (bool); function transferFrom( address from, address to, uint256 value ) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint256); function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; event Mint(address indexed sender, uint256 amount0, uint256 amount1); event Burn( address indexed sender, uint256 amount0, uint256 amount1, address indexed to ); event Swap( address indexed sender, uint256 amount0In, uint256 amount1In, uint256 amount0Out, uint256 amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint256); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns ( uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast ); function price0CumulativeLast() external view returns (uint256); function price1CumulativeLast() external view returns (uint256); function kLast() external view returns (uint256); function mint(address to) external returns (uint256 liquidity); function burn(address to) external returns (uint256 amount0, uint256 amount1); function swap( uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data ) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IpancakeRouter01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns ( uint256 amountA, uint256 amountB, uint256 liquidity ); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); function removeLiquidity( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETH( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountA, uint256 amountB); function removeLiquidityETHWithPermit( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountToken, uint256 amountETH); function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapTokensForExactTokens( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactETHForTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function swapTokensForExactETH( uint256 amountOut, uint256 amountInMax, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external returns (uint256[] memory amounts); function swapETHForExactTokens( uint256 amountOut, address[] calldata path, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountOut); function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) external pure returns (uint256 amountIn); function getAmountsOut(uint256 amountIn, address[] calldata path) external view returns (uint256[] memory amounts); function getAmountsIn(uint256 amountOut, address[] calldata path) external view returns (uint256[] memory amounts); } interface IpancakeRouter02 is IpancakeRouter01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint256 amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; } // Bep20 standards for token creation by bloctechsolutions.com contract Billions is Context, ERC20, ERC20Metadata, Ownable { using SafeMath for uint256; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromMaxTx; IpancakeRouter02 public pancakeRouter; address public pancakePair; string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; bool public _sellingOpen = false; //once switched on, can never be switched off. uint256 public _maxTxAmount; constructor() { _name = "Billionaires Club"; _symbol = "BC"; _decimals = 18; _totalSupply = 1000000000000 * 1e18; _balances[owner()] = _totalSupply; _maxTxAmount = _totalSupply.mul(5).div(100); IpancakeRouter02 _pancakeRouter = IpancakeRouter02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D // UniswapV2Router02 ); // Create a uniswap pair for this new token pancakePair = IUniswapV2Factory(_pancakeRouter.factory()).createPair( address(this), _pancakeRouter.WETH() ); // set the rest of the contract variables pancakeRouter = _pancakeRouter; // exclude from max tx _isExcludedFromMaxTx[owner()] = true; _isExcludedFromMaxTx[address(this)] = true; emit Transfer(address(0), owner(), _totalSupply); } 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 _decimals; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function AntiWhale() external onlyOwner { _sellingOpen = true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require( currentAllowance >= amount, "WE: transfer amount exceeds allowance" ); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function setExcludeFromMaxTx(address _address, bool value) public onlyOwner { _isExcludedFromMaxTx[_address] = value; } // for 1% input 1 function setMaxTxPercent(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = _totalSupply.mul(maxTxAmount).div(100); } 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(_isExcludedFromMaxTx[sender] == false && _isExcludedFromMaxTx[recipient] == false // by default false ){ require(amount <= _maxTxAmount,"amount exceed max limit"); if (!_sellingOpen && sender != owner() && recipient != owner()) { require(recipient != pancakePair, " WE:Selling 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; // 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; } }
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806376474949116100b8578063a9059cbb1161007c578063a9059cbb1461026e578063b8c9d25c14610281578063c21ebd0714610294578063d543dbeb146102a7578063dd62ed3e146102ba578063f2fde38b146102f357600080fd5b806376474949146102185780637d1db4a5146102255780638da5cb5b1461022e57806395d89b4114610253578063a457c2d71461025b57600080fd5b806339509351116100ff57806339509351146101b75780635b89029c146101ca5780636adeb40d146101df57806370a08231146101e7578063715018a61461021057600080fd5b806306fdde031461013c578063095ea7b31461015a57806318160ddd1461017d57806323b872dd1461018f578063313ce567146101a2575b600080fd5b610144610306565b6040516101519190610cc5565b60405180910390f35b61016d610168366004610d36565b610398565b6040519015158152602001610151565b6009545b604051908152602001610151565b61016d61019d366004610d60565b6103af565b60085460405160ff9091168152602001610151565b61016d6101c5366004610d36565b61045b565b6101dd6101d8366004610d9c565b610497565b005b6101dd6104ec565b6101816101f5366004610dd8565b6001600160a01b031660009081526001602052604090205490565b6101dd610525565b600a5461016d9060ff1681565b610181600b5481565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610151565b61014461055b565b61016d610269366004610d36565b61056a565b61016d61027c366004610d36565b610600565b60055461023b906001600160a01b031681565b60045461023b906001600160a01b031681565b6101dd6102b5366004610df3565b61060d565b6101816102c8366004610e0c565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101dd610301366004610dd8565b61065d565b60606006805461031590610e3f565b80601f016020809104026020016040519081016040528092919081815260200182805461034190610e3f565b801561038e5780601f106103635761010080835404028352916020019161038e565b820191906000526020600020905b81548152906001019060200180831161037157829003601f168201915b5050505050905090565b60006103a53384846107c0565b5060015b92915050565b60006103bc8484846108e4565b6001600160a01b0384166000908152600260209081526040808320338452909152902054828110156104435760405162461bcd60e51b815260206004820152602560248201527f57453a207472616e7366657220616d6f756e74206578636565647320616c6c6f60448201526477616e636560d81b60648201526084015b60405180910390fd5b61045085338584036107c0565b506001949350505050565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103a5918590610492908690610e90565b6107c0565b6000546001600160a01b031633146104c15760405162461bcd60e51b815260040161043a90610ea8565b6001600160a01b03919091166000908152600360205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146105165760405162461bcd60e51b815260040161043a90610ea8565b600a805460ff19166001179055565b6000546001600160a01b0316331461054f5760405162461bcd60e51b815260040161043a90610ea8565b6105596000610c3e565b565b60606007805461031590610e3f565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156105e95760405162461bcd60e51b815260206004820152602260248201527f57453a2064656372656173656420616c6c6f77616e63652062656c6f77207a65604482015261726f60f01b606482015260840161043a565b6105f633858584036107c0565b5060019392505050565b60006103a53384846108e4565b6000546001600160a01b031633146106375760405162461bcd60e51b815260040161043a90610ea8565b6106576064610651836009546106f890919063ffffffff16565b9061077e565b600b5550565b6000546001600160a01b031633146106875760405162461bcd60e51b815260040161043a90610ea8565b6001600160a01b0381166106ec5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161043a565b6106f581610c3e565b50565b600082610707575060006103a9565b60006107138385610edd565b9050826107208583610efc565b146107775760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043a565b9392505050565b600061077783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610c8e565b6001600160a01b0383166108225760405162461bcd60e51b8152602060048201526024808201527f42455032303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043a565b6001600160a01b0382166108835760405162461bcd60e51b815260206004820152602260248201527f42455032303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043a565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109455760405162461bcd60e51b815260206004820152602260248201527f57453a207472616e736665722066726f6d20746865207a65726f206164647265604482015261737360f01b606482015260840161043a565b6001600160a01b03821661099b5760405162461bcd60e51b815260206004820181905260248201527f57453a207472616e7366657220746f20746865207a65726f2061646472657373604482015260640161043a565b60008111610a015760405162461bcd60e51b815260206004820152602d60248201527f57453a205472616e7366657220616d6f756e74206d757374206265206772656160448201526c746572207468616e207a65726f60981b606482015260840161043a565b6001600160a01b03831660009081526003602052604090205460ff16158015610a4357506001600160a01b03821660009081526003602052604090205460ff16155b15610b3857600b54811115610a9a5760405162461bcd60e51b815260206004820152601760248201527f616d6f756e7420657863656564206d6178206c696d6974000000000000000000604482015260640161043a565b600a5460ff16158015610abb57506000546001600160a01b03848116911614155b8015610ad557506000546001600160a01b03838116911614155b15610b38576005546001600160a01b0383811691161415610b385760405162461bcd60e51b815260206004820152601a60248201527f2057453a53656c6c696e67206973206e6f7420656e61626c6564000000000000604482015260640161043a565b6001600160a01b03831660009081526001602052604090205481811015610bad5760405162461bcd60e51b815260206004820152602360248201527f57453a207472616e7366657220616d6f756e7420657863656564732062616c616044820152626e636560e81b606482015260840161043a565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610be4908490610e90565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c3091815260200190565b60405180910390a350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008183610caf5760405162461bcd60e51b815260040161043a9190610cc5565b506000610cbc8486610efc565b95945050505050565b600060208083528351808285015260005b81811015610cf257858101830151858201604001528201610cd6565b81811115610d04576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610d3157600080fd5b919050565b60008060408385031215610d4957600080fd5b610d5283610d1a565b946020939093013593505050565b600080600060608486031215610d7557600080fd5b610d7e84610d1a565b9250610d8c60208501610d1a565b9150604084013590509250925092565b60008060408385031215610daf57600080fd5b610db883610d1a565b915060208301358015158114610dcd57600080fd5b809150509250929050565b600060208284031215610dea57600080fd5b61077782610d1a565b600060208284031215610e0557600080fd5b5035919050565b60008060408385031215610e1f57600080fd5b610e2883610d1a565b9150610e3660208401610d1a565b90509250929050565b600181811c90821680610e5357607f821691505b60208210811415610e7457634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610ea357610ea3610e7a565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000816000190483118215151615610ef757610ef7610e7a565b500290565b600082610f1957634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220d481914ec458f25d34e43a05005995a401f674deb9e7b68107fa476d5b6729b564736f6c63430008090033
{"success": true, "error": null, "results": {}}
6,637
0x879a0886BdbD9CfA34FCf84f18FEA4b4aEf3BadF
/* PUMPPUMPPUMP (📈🍀🚀PUMP 🚀🍀📈) Telegram: https://t.me/PumpPumpPumpToken This token was created to PUMP. A modest amount of liquidity to start will allow early holders to secure a decent position, and deflationary mechanics will allow anyone at any time to benefit for the long term. Liquidity locking will prevent a rug pull. Ownership renouncement will prevent any shenanigans. A small tax on selling will incentivize the pump. Cooldown and anti-bot measures will prevent exploitations. The community must bring the PUMP energy in order to achieve success. From this day on, PUMP token shall PUMP! PUMP features: - No dev tokens, we all pump pump pump📈 - Initial 10% token burn to ignite the engines 📈 - 5% Reflection to pump holders 📈 - Anti-listing-bot, only the pumpers 📈 - Anti whale dumping protection 📈 - Cooldown and tax on mass sells 📈 - Full liquidity provided and locked 📈 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface 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 IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } contract PUMPPUMPPUMP 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 = 5000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "PUMP PUMP PUMP"; string private constant _symbol = '📈🍀🚀PUMP 🚀🍀📈'; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 10; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) public { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { if (_isExcluded[account]) return _tOwned[account]; return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal; _maxTxAmount = 1000000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610787565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610860565b005b34801561033357600080fd5b5061033c610983565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098c565b005b34801561039e57600080fd5b506103a7610a71565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae3565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bce565b005b34801561043157600080fd5b5061043a610d54565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dba565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd8565b005b34801561063857600080fd5b50610641610f28565b005b34801561064f57600080fd5b50610658610fa2565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b8101908080359060200190929190505050611632565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117e2565b6040518082815260200191505060405180910390f35b60606040518060400160405280600e81526020017f50554d502050554d502050554d50000000000000000000000000000000000000815250905090565b600061076b610764611869565b8484611871565b6001905092915050565b600069010f0cf064dd59200000905090565b6000610794848484611a68565b610855846107a0611869565b61085085604051806060016040528060288152602001613d2560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610806611869565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122939092919063ffffffff16565b611871565b600190509392505050565b610868611869565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610928576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610994611869565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a54576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab2611869565b73ffffffffffffffffffffffffffffffffffffffff1614610ad257600080fd5b6000479050610ae081612353565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7e57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc9565b610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461244e565b90505b919050565b610bd6611869565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c96576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601d81526020017ff09f9388f09f8d80f09f9a8050554d5020f09f9a80f09f8d80f09f9388000000815250905090565b6000610dce610dc7611869565b8484611a68565b6001905092915050565b610de0611869565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2457600160076000848481518110610ebe57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea3565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f69611869565b73ffffffffffffffffffffffffffffffffffffffff1614610f8957600080fd5b6000610f9430610ae3565b9050610f9f816124d2565b50565b610faa611869565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117e30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669010f0cf064dd59200000611871565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c457600080fd5b505afa1580156111d8573d6000803e3d6000fd5b505050506040513d60208110156111ee57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561126157600080fd5b505afa158015611275573d6000803e3d6000fd5b505050506040513d602081101561128b57600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130557600080fd5b505af1158015611319573d6000803e3d6000fd5b505050506040513d602081101561132f57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c930610ae3565b6000806113d4610d54565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145957600080fd5b505af115801561146d573d6000803e3d6000fd5b50505050506040513d606081101561148457600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff02191690831515021790555069010f0cf064dd59200000601481905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115f357600080fd5b505af1158015611607573d6000803e3d6000fd5b505050506040513d602081101561161d57600080fd5b81019080805190602001909291905050505050565b61163a611869565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611770576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b6117a060646117928369010f0cf064dd592000006127bc90919063ffffffff16565b61284290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118f7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613d9b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561197d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ce26022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d766025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613c956023913960400191505060405180910390fd5b60008111611bcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d4d6029913960400191505060405180910390fd5b611bd5610d54565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c435750611c13610d54565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121d057601360179054906101000a900460ff1615611ea9573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cc557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d1f5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d795750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ea857601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dbf611869565b73ffffffffffffffffffffffffffffffffffffffff161480611e355750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e1d611869565b73ffffffffffffffffffffffffffffffffffffffff16145b611ea7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b601454811115611eb857600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f5c5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f6557600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120105750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120665750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561207e5750601360179054906101000a900460ff165b156121165742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120ce57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061212130610ae3565b9050601360159054906101000a900460ff1615801561218e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121a65750601360169054906101000a900460ff165b156121ce576121b4816124d2565b600047905060008111156121cc576121cb47612353565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122775750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561228157600090505b61228d8484848461288c565b50505050565b6000838311158290612340576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123055780820151818401526020810190506122ea565b50505050905090810190601f1680156123325780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123a360028461284290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123ce573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61241f60028461284290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561244a573d6000803e3d6000fd5b5050565b6000600a548211156124ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cb8602a913960400191505060405180910390fd5b60006124b5612ae3565b90506124ca818461284290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561250757600080fd5b506040519080825280602002602001820160405280156125365781602001602082028036833780820191505090505b509050308160008151811061254757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125e957600080fd5b505afa1580156125fd573d6000803e3d6000fd5b505050506040513d602081101561261357600080fd5b81019080805190602001909291905050508160018151811061263157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061269830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611871565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561275c578082015181840152602081019050612741565b505050509050019650505050505050600060405180830381600087803b15801561278557600080fd5b505af1158015612799573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127cf576000905061283c565b60008284029050828482816127e057fe5b0414612837576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d046021913960400191505060405180910390fd5b809150505b92915050565b600061288483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b0e565b905092915050565b8061289a57612899612bd4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561293d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129525761294d848484612c17565b612acf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156129f55750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a0a57612a05848484612e77565b612ace565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612aac5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ac157612abc8484846130d7565b612acd565b612acc8484846133cc565b5b5b5b80612add57612adc613597565b5b50505050565b6000806000612af06135ab565b91509150612b07818361284290919063ffffffff16565b9250505090565b60008083118290612bba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b7f578082015181840152602081019050612b64565b50505050905090810190601f168015612bac5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bc657fe5b049050809150509392505050565b6000600c54148015612be857506000600d54145b15612bf257612c15565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c298761385c565b955095509550955095509550612c8787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c490919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d1c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612db185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dfd81613996565b612e078483613b3b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e898761385c565b955095509550955095509550612ee786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061301185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061305d81613996565b6130678483613b3b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130e98761385c565b95509550955095509550955061314787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c490919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131dc86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061327183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335281613996565b61335c8483613b3b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133de8761385c565b95509550955095509550955061343c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138c490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134d185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351d81613996565b6135278483613b3b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a549050600069010f0cf064dd59200000905060005b60098054905081101561380f578260026000600984815481106135e657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136cd575081600360006009848154811061366557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136ec57600a5469010f0cf064dd5920000094509450505050613858565b613775600260006009848154811061370057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138c490919063ffffffff16565b9250613800600360006009848154811061378b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138c490919063ffffffff16565b915080806001019150506135c7565b5061382f69010f0cf064dd59200000600a5461284290919063ffffffff16565b82101561384f57600a5469010f0cf064dd59200000935093505050613858565b81819350935050505b9091565b60008060008060008060008060006138798a600c54600d54613b75565b9250925092506000613889612ae3565b9050600080600061389c8e878787613c0b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061390683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612293565b905092915050565b60008082840190508381101561398c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139a0612ae3565b905060006139b782846127bc90919063ffffffff16565b9050613a0b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b3657613af283600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461390e90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5082600a546138c490919063ffffffff16565b600a81905550613b6b81600b5461390e90919063ffffffff16565b600b819055505050565b600080600080613ba16064613b93888a6127bc90919063ffffffff16565b61284290919063ffffffff16565b90506000613bcb6064613bbd888b6127bc90919063ffffffff16565b61284290919063ffffffff16565b90506000613bf482613be6858c6138c490919063ffffffff16565b6138c490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c2485896127bc90919063ffffffff16565b90506000613c3b86896127bc90919063ffffffff16565b90506000613c5287896127bc90919063ffffffff16565b90506000613c7b82613c6d85876138c490919063ffffffff16565b6138c490919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122038c6f8b45843e5497992919508e37644e6ebbebd306574353adc1be6038e64c364736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,638
0x133e968e0fd97bfc28330fa95e3aa1881c4d7965
/** *Submitted for verification at Etherscan.io on 2021-05-20 */ pragma solidity ^0.4.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) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @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 { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20Basic { uint public _totalSupply; function totalSupply() public constant returns (uint); function balanceOf(address who) public constant returns (uint); function transfer(address to, uint value) public; event Transfer(address indexed from, address indexed to, uint value); } /** * @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 (uint); function transferFrom(address from, address to, uint value) public; function approve(address spender, uint value) public; event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is Ownable, ERC20Basic { using SafeMath for uint; mapping(address => uint) public balances; // additional variables for use if transaction fees ever became necessary uint public basisPointsRate = 0; uint public maximumFee = 0; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { require(!(msg.data.length < size + 4)); _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) { uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } uint sendAmount = _value.sub(fee); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(msg.sender, owner, fee); } Transfer(msg.sender, _to, sendAmount); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint 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 oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) public allowed; uint public constant MAX_UINT = 2**256 - 1; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; uint fee = (_value.mul(basisPointsRate)).div(10000); if (fee > maximumFee) { fee = maximumFee; } if (_allowance < MAX_UINT) { allowed[_from][msg.sender] = _allowance.sub(_value); } uint sendAmount = _value.sub(fee); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(sendAmount); if (fee > 0) { balances[owner] = balances[owner].add(fee); Transfer(_from, owner, fee); } Transfer(_from, _to, sendAmount); } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require(!((_value != 0) && (allowed[msg.sender][_spender] != 0))); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * @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 BlackList is Ownable, BasicToken { /////// Getters to allow the same blacklist to be used also by other contracts (including upgraded Tether) /////// function getBlackListStatus(address _maker) external constant returns (bool) { return isBlackListed[_maker]; } function getOwner() external constant returns (address) { return owner; } mapping (address => bool) public isBlackListed; function addBlackList (address _evilUser) public onlyOwner { isBlackListed[_evilUser] = true; AddedBlackList(_evilUser); } function removeBlackList (address _clearedUser) public onlyOwner { isBlackListed[_clearedUser] = false; RemovedBlackList(_clearedUser); } function destroyBlackFunds (address _blackListedUser) public onlyOwner { require(isBlackListed[_blackListedUser]); uint dirtyFunds = balanceOf(_blackListedUser); balances[_blackListedUser] = 0; _totalSupply -= dirtyFunds; DestroyedBlackFunds(_blackListedUser, dirtyFunds); } event DestroyedBlackFunds(address _blackListedUser, uint _balance); event AddedBlackList(address _user); event RemovedBlackList(address _user); } contract UpgradedStandardToken is StandardToken{ // those methods are called by the legacy contract // and they must ensure msg.sender to be the contract address function transferByLegacy(address from, address to, uint value) public; function transferFromByLegacy(address sender, address from, address spender, uint value) public; function approveByLegacy(address from, address spender, uint value) public; } contract TetherToken is Pausable, StandardToken, BlackList { string public name; string public symbol; uint public decimals; address public upgradedAddress; bool public deprecated; // The contract can be initialized with a number of tokens // All the tokens are deposited to the owner address // // @param _balance Initial supply of the contract // @param _name Token Name // @param _symbol Token symbol // @param _decimals Token decimals function TetherToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public { _totalSupply = _initialSupply; name = _name; symbol = _symbol; decimals = _decimals; balances[owner] = _initialSupply; deprecated = false; } // Forward ERC20 methods to upgraded contract if this one is deprecated function transfer(address _to, uint _value) public whenNotPaused { require(!isBlackListed[msg.sender]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value); } else { return super.transfer(_to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function transferFrom(address _from, address _to, uint _value) public whenNotPaused { require(!isBlackListed[_from]); if (deprecated) { return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value); } else { return super.transferFrom(_from, _to, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function balanceOf(address who) public constant returns (uint) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).balanceOf(who); } else { return super.balanceOf(who); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) { if (deprecated) { return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value); } else { return super.approve(_spender, _value); } } // Forward ERC20 methods to upgraded contract if this one is deprecated function allowance(address _owner, address _spender) public constant returns (uint remaining) { if (deprecated) { return StandardToken(upgradedAddress).allowance(_owner, _spender); } else { return super.allowance(_owner, _spender); } } // deprecate current contract in favour of a new one function deprecate(address _upgradedAddress) public onlyOwner { deprecated = true; upgradedAddress = _upgradedAddress; Deprecate(_upgradedAddress); } // deprecate current contract if favour of a new one function totalSupply() public constant returns (uint) { if (deprecated) { return StandardToken(upgradedAddress).totalSupply(); } else { return _totalSupply; } } // Issue a new amount of tokens // these tokens are deposited into the owner address // // @param _amount Number of tokens to be issued function issue(uint amount) public onlyOwner { require(_totalSupply + amount > _totalSupply); require(balances[owner] + amount > balances[owner]); balances[owner] += amount; _totalSupply += amount; Issue(amount); } // Redeem tokens. // These tokens are withdrawn from the owner address // if the balance must be enough to cover the redeem // or the call will fail. // @param _amount Number of tokens to be issued function redeem(uint amount) public onlyOwner { require(_totalSupply >= amount); require(balances[owner] >= amount); _totalSupply -= amount; balances[owner] -= amount; Redeem(amount); } function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner { // Ensure transparency by hardcoding limit beyond which fees can never be added require(newBasisPoints < 20); require(newMaxFee < 50); basisPointsRate = newBasisPoints; maximumFee = newMaxFee.mul(10**decimals); Params(basisPointsRate, maximumFee); } // Called when new token are issued event Issue(uint amount); // Called when tokens are redeemed event Redeem(uint amount); // Called when contract is deprecated event Deprecate(address newAddress); // Called if contract ever adds fees event Params(uint feeBasisPoints, uint maxFee); }
0x6060604052361561017a5763ffffffff60e060020a60003504166306fdde03811461017f5780630753c30c14610209578063095ea7b31461022a5780630e136b191461024c5780630ecb93c01461027357806318160ddd1461029257806323b872dd146102b757806326976e3f146102df57806327e235e31461030e578063313ce5671461032d57806335390714146103405780633eaaf86b146103535780633f4ba83a1461036657806359bf1abe146103795780635c658165146103985780635c975abb146103bd57806370a08231146103d05780638456cb59146103ef578063893d20e8146104025780638da5cb5b1461041557806395d89b4114610428578063a9059cbb1461043b578063c0324c771461045d578063cc872b6614610476578063db006a751461048c578063dd62ed3e146104a2578063dd644f72146104c7578063e47d6060146104da578063e4997dc5146104f9578063e5b5019a14610518578063f2fde38b1461052b578063f3bdc2281461054a575b600080fd5b341561018a57600080fd5b610192610569565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ce5780820151838201526020016101b6565b50505050905090810190601f1680156101fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021457600080fd5b610228600160a060020a0360043516610607565b005b341561023557600080fd5b610228600160a060020a03600435166024356106aa565b341561025757600080fd5b61025f610757565b604051901515815260200160405180910390f35b341561027e57600080fd5b610228600160a060020a0360043516610767565b341561029d57600080fd5b6102a56107e7565b60405190815260200160405180910390f35b34156102c257600080fd5b610228600160a060020a036004358116906024351660443561086e565b34156102ea57600080fd5b6102f2610932565b604051600160a060020a03909116815260200160405180910390f35b341561031957600080fd5b6102a5600160a060020a0360043516610941565b341561033857600080fd5b6102a5610953565b341561034b57600080fd5b6102a5610959565b341561035e57600080fd5b6102a561095f565b341561037157600080fd5b610228610965565b341561038457600080fd5b61025f600160a060020a03600435166109e4565b34156103a357600080fd5b6102a5600160a060020a0360043581169060243516610a06565b34156103c857600080fd5b61025f610a23565b34156103db57600080fd5b6102a5600160a060020a0360043516610a33565b34156103fa57600080fd5b610228610ad3565b341561040d57600080fd5b6102f2610b57565b341561042057600080fd5b6102f2610b66565b341561043357600080fd5b610192610b75565b341561044657600080fd5b610228600160a060020a0360043516602435610be0565b341561046857600080fd5b610228600435602435610cb9565b341561048157600080fd5b610228600435610d4f565b341561049757600080fd5b610228600435610dfe565b34156104ad57600080fd5b6102a5600160a060020a0360043581169060243516610eaf565b34156104d257600080fd5b6102a5610f5a565b34156104e557600080fd5b61025f600160a060020a0360043516610f60565b341561050457600080fd5b610228600160a060020a0360043516610f75565b341561052357600080fd5b6102a5610ff2565b341561053657600080fd5b610228600160a060020a0360043516610ff8565b341561055557600080fd5b610228600160a060020a036004351661104e565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ff5780601f106105d4576101008083540402835291602001916105ff565b820191906000526020600020905b8154815290600101906020018083116105e257829003601f168201915b505050505081565b60005433600160a060020a0390811691161461062257600080fd5b600a805460a060020a74ff0000000000000000000000000000000000000000199091161773ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051600160a060020a03909116815260200160405180910390a150565b604060443610156106ba57600080fd5b600a5460a060020a900460ff161561074857600a54600160a060020a031663aee92d3333858560405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561072f57600080fd5b6102c65a03f1151561074057600080fd5b505050610752565b610752838361110c565b505050565b600a5460a060020a900460ff1681565b60005433600160a060020a0390811691161461078257600080fd5b600160a060020a03811660009081526006602052604090819020805460ff191660011790557f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc90829051600160a060020a03909116815260200160405180910390a150565b600a5460009060a060020a900460ff161561086657600a54600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561084457600080fd5b6102c65a03f1151561085557600080fd5b50505060405180519050905061086b565b506001545b90565b60005460a060020a900460ff161561088557600080fd5b600160a060020a03831660009081526006602052604090205460ff16156108ab57600080fd5b600a5460a060020a900460ff161561092757600a54600160a060020a0316638b477adb3385858560405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401600060405180830381600087803b151561072f57600080fd5b6107528383836111be565b600a54600160a060020a031681565b60026020526000908152604090205481565b60095481565b60045481565b60015481565b60005433600160a060020a0390811691161461098057600080fd5b60005460a060020a900460ff16151561099857600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160a060020a03811660009081526006602052604090205460ff165b919050565b600560209081526000928352604080842090915290825290205481565b60005460a060020a900460ff1681565b600a5460009060a060020a900460ff1615610ac357600a54600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610aa157600080fd5b6102c65a03f11515610ab257600080fd5b505050604051805190509050610a01565b610acc826113bd565b9050610a01565b60005433600160a060020a03908116911614610aee57600080fd5b60005460a060020a900460ff1615610b0557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031690565b600054600160a060020a031681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ff5780601f106105d4576101008083540402835291602001916105ff565b60005460a060020a900460ff1615610bf757600080fd5b600160a060020a03331660009081526006602052604090205460ff1615610c1d57600080fd5b600a5460a060020a900460ff1615610cab57600a54600160a060020a0316636e18980a33848460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610c9257600080fd5b6102c65a03f11515610ca357600080fd5b505050610cb5565b610cb582826113d8565b5050565b60005433600160a060020a03908116911614610cd457600080fd5b60148210610ce157600080fd5b60328110610cee57600080fd5b6003829055600954610d0a908290600a0a63ffffffff61155c16565b60048190556003547fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e9160405191825260208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610d6a57600080fd5b60015481810111610d7a57600080fd5b60008054600160a060020a031681526002602052604090205481810111610da057600080fd5b60008054600160a060020a03168152600260205260409081902080548301905560018054830190557fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a9082905190815260200160405180910390a150565b60005433600160a060020a03908116911614610e1957600080fd5b60015481901015610e2957600080fd5b60008054600160a060020a031681526002602052604090205481901015610e4f57600080fd5b60018054829003905560008054600160a060020a031681526002602052604090819020805483900390557f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a449082905190815260200160405180910390a150565b600a5460009060a060020a900460ff1615610f4757600a54600160a060020a031663dd62ed3e848460006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b1515610f2557600080fd5b6102c65a03f11515610f3657600080fd5b505050604051805190509050610f54565b610f518383611592565b90505b92915050565b60035481565b60066020526000908152604090205460ff1681565b60005433600160a060020a03908116911614610f9057600080fd5b600160a060020a03811660009081526006602052604090819020805460ff191690557fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c90829051600160a060020a03909116815260200160405180910390a150565b60001981565b60005433600160a060020a0390811691161461101357600080fd5b600160a060020a0381161561104b576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b6000805433600160a060020a0390811691161461106a57600080fd5b600160a060020a03821660009081526006602052604090205460ff16151561109157600080fd5b61109a82610a33565b600160a060020a038316600090815260026020526040808220919091556001805483900390559091507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6908390839051600160a060020a03909216825260208201526040908101905180910390a15050565b6040604436101561111c57600080fd5b811580159061114f5750600160a060020a0333811660009081526005602090815260408083209387168352929052205415155b1561115957600080fd5b600160a060020a03338116600081815260056020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a3505050565b60008080606060643610156111d257600080fd5b600160a060020a0380881660009081526005602090815260408083203390941683529290522054600354909450611224906127109061121890889063ffffffff61155c16565b9063ffffffff6115bd16565b92506004548311156112365760045492505b60001984101561127857611250848663ffffffff6115d416565b600160a060020a03808916600090815260056020908152604080832033909416835292905220555b611288858463ffffffff6115d416565b600160a060020a0388166000908152600260205260409020549092506112b4908663ffffffff6115d416565b600160a060020a0380891660009081526002602052604080822093909355908816815220546112e9908363ffffffff6115e616565b600160a060020a03871660009081526002602052604081209190915583111561137f5760008054600160a060020a0316815260026020526040902054611335908463ffffffff6115e616565b60008054600160a060020a03908116825260026020526040808320939093559054811691908916906000805160206115f68339815191529086905190815260200160405180910390a35b85600160a060020a031687600160a060020a03166000805160206115f68339815191528460405190815260200160405180910390a350505050505050565b600160a060020a031660009081526002602052604090205490565b600080604060443610156113eb57600080fd5b6114066127106112186003548761155c90919063ffffffff16565b92506004548311156114185760045492505b611428848463ffffffff6115d416565b600160a060020a033316600090815260026020526040902054909250611454908563ffffffff6115d416565b600160a060020a033381166000908152600260205260408082209390935590871681522054611489908363ffffffff6115e616565b600160a060020a0386166000908152600260205260408120919091558311156115205760008054600160a060020a03168152600260205260409020546114d5908463ffffffff6115e616565b60008054600160a060020a0390811682526002602052604080832093909355905481169133909116906000805160206115f68339815191529086905190815260200160405180910390a35b84600160a060020a031633600160a060020a03166000805160206115f68339815191528460405190815260200160405180910390a35050505050565b60008083151561156f576000915061158b565b5082820282848281151561157f57fe5b041461158757fe5b8091505b5092915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60008082848115156115cb57fe5b04949350505050565b6000828211156115e057fe5b50900390565b60008282018381101561158757fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058204207d7b851432de2198dfc0d5067d4f893cc70216d3934ba2c0b0b5061abd3380029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,639
0x90f58bbdccfd41e294cc9cf8ea035d33f4693269
//Ren Swap //Ren Swap //Ren Swap pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _Erc20Token(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212207f3404c4f96efd0149a2d4e2dcfe3d0f399aaa10e201097a9712242f5402252564736f6c63430006060033
{"success": true, "error": null, "results": {}}
6,640
0xf57c4b01d68de46bdb20cbaf32b7d816b01acee9
/* ___ _ _ ___ _ _ _ | _ ) |___ __| |__ / __|_ _ ___ __| (_) |_ | _ \ / _ \/ _| / / | (__| '_/ -_) _` | | _| |___/_\___/\__|_\_\ \___|_| \___\__,_|_|\__| https://t.me/blockcreditportal https://blockcredit.finance/ */ // 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 BLOCKCREDIT is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "Block Credit"; string private constant _symbol = unicode"$BC"; 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(0x5C2c5fE520abadb416Ec0227Bb5e0216A97fD4eA); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 9; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; _maxWalletSize = 20000000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb1461033d578063b87f137a1461035d578063c3c8cd801461037d578063c9567bf914610392578063dd62ed3e146103a757600080fd5b806370a082311461029f578063715018a6146102bf578063751039fc146102d45780638da5cb5b146102e957806395d89b411461031157600080fd5b8063273123b7116100e7578063273123b71461020e578063313ce5671461022e5780635932ead11461024a578063677daa571461026a5780636fc3eaec1461028a57600080fd5b806306fdde031461012f578063095ea7b31461017657806318160ddd146101a65780631b3f71ae146101cc57806323b872dd146101ee57600080fd5b3661012a57005b600080fd5b34801561013b57600080fd5b5060408051808201909152600c81526b109b1bd8dac810dc99591a5d60a21b60208201525b60405161016d9190611773565b60405180910390f35b34801561018257600080fd5b506101966101913660046117ed565b6103ed565b604051901515815260200161016d565b3480156101b257600080fd5b50683635c9adc5dea000005b60405190815260200161016d565b3480156101d857600080fd5b506101ec6101e736600461182f565b610404565b005b3480156101fa57600080fd5b506101966102093660046118f4565b6104a3565b34801561021a57600080fd5b506101ec610229366004611935565b61050c565b34801561023a57600080fd5b506040516009815260200161016d565b34801561025657600080fd5b506101ec610265366004611960565b610557565b34801561027657600080fd5b506101ec61028536600461197d565b61059f565b34801561029657600080fd5b506101ec6105fa565b3480156102ab57600080fd5b506101be6102ba366004611935565b610627565b3480156102cb57600080fd5b506101ec610649565b3480156102e057600080fd5b506101ec6106bd565b3480156102f557600080fd5b506000546040516001600160a01b03909116815260200161016d565b34801561031d57600080fd5b5060408051808201909152600381526224424360e81b6020820152610160565b34801561034957600080fd5b506101966103583660046117ed565b6106fb565b34801561036957600080fd5b506101ec61037836600461197d565b610708565b34801561038957600080fd5b506101ec61075d565b34801561039e57600080fd5b506101ec610793565b3480156103b357600080fd5b506101be6103c2366004611996565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fa338484610b63565b5060015b92915050565b6000546001600160a01b031633146104375760405162461bcd60e51b815260040161042e906119cf565b60405180910390fd5b60005b815181101561049f5760016006600084848151811061045b5761045b611a04565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061049781611a30565b91505061043a565b5050565b60006104b0848484610c87565b61050284336104fd85604051806060016040528060288152602001611b95602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611091565b610b63565b5060019392505050565b6000546001600160a01b031633146105365760405162461bcd60e51b815260040161042e906119cf565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105815760405162461bcd60e51b815260040161042e906119cf565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105c95760405162461bcd60e51b815260040161042e906119cf565b600081116105d657600080fd5b6105f460646105ee683635c9adc5dea00000846110cb565b90611151565b600f5550565b600c546001600160a01b0316336001600160a01b03161461061a57600080fd5b4761062481611193565b50565b6001600160a01b0381166000908152600260205260408120546103fe906111cd565b6000546001600160a01b031633146106735760405162461bcd60e51b815260040161042e906119cf565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106e75760405162461bcd60e51b815260040161042e906119cf565b683635c9adc5dea00000600f819055601055565b60006103fa338484610c87565b6000546001600160a01b031633146107325760405162461bcd60e51b815260040161042e906119cf565b6000811161073f57600080fd5b61075760646105ee683635c9adc5dea00000846110cb565b60105550565b600c546001600160a01b0316336001600160a01b03161461077d57600080fd5b600061078830610627565b90506106248161124a565b6000546001600160a01b031633146107bd5760405162461bcd60e51b815260040161042e906119cf565b600e54600160a01b900460ff16156108175760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161042e565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108543082683635c9adc5dea00000610b63565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561088d57600080fd5b505afa1580156108a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c59190611a4b565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561090d57600080fd5b505afa158015610921573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109459190611a4b565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561098d57600080fd5b505af11580156109a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c59190611a4b565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d71947306109f581610627565b600080610a0a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a6d57600080fd5b505af1158015610a81573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aa69190611a68565b5050600e8054678ac7230489e80000600f556801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b2b57600080fd5b505af1158015610b3f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049f9190611a96565b6001600160a01b038316610bc55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161042e565b6001600160a01b038216610c265760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161042e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ceb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161042e565b6001600160a01b038216610d4d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161042e565b60008111610daf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161042e565b6000600a556009600b55610dcb6000546001600160a01b031690565b6001600160a01b0316836001600160a01b031614158015610dfa57506000546001600160a01b03838116911614155b15611081576001600160a01b03831660009081526006602052604090205460ff16158015610e4157506001600160a01b03821660009081526006602052604090205460ff16155b610e4a57600080fd5b600e546001600160a01b038481169116148015610e755750600d546001600160a01b03838116911614155b8015610e9a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610eaf5750600e54600160b81b900460ff165b15610fb457600f54811115610f065760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161042e565b60105481610f1384610627565b610f1d9190611ab3565b1115610f6b5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161042e565b6001600160a01b0382166000908152600760205260409020544211610f8f57600080fd5b610f9a42601e611ab3565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b038381169116148015610fdf5750600d546001600160a01b03848116911614155b801561100457506001600160a01b03831660009081526005602052604090205460ff16155b15611014576000600a556009600b555b600061101f30610627565b600e54909150600160a81b900460ff1615801561104a5750600e546001600160a01b03858116911614155b801561105f5750600e54600160b01b900460ff165b1561107f5761106d8161124a565b47801561107d5761107d47611193565b505b505b61108c8383836113d3565b505050565b600081848411156110b55760405162461bcd60e51b815260040161042e9190611773565b5060006110c28486611acb565b95945050505050565b6000826110da575060006103fe565b60006110e68385611ae2565b9050826110f38583611b01565b1461114a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161042e565b9392505050565b600061114a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113de565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561049f573d6000803e3d6000fd5b60006008548211156112345760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161042e565b600061123e61140c565b905061114a8382611151565b600e805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061129257611292611a04565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112e657600080fd5b505afa1580156112fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131e9190611a4b565b8160018151811061133157611331611a04565b6001600160a01b039283166020918202929092010152600d546113579130911684610b63565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611390908590600090869030904290600401611b23565b600060405180830381600087803b1580156113aa57600080fd5b505af11580156113be573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61108c83838361142f565b600081836113ff5760405162461bcd60e51b815260040161042e9190611773565b5060006110c28486611b01565b6000806000611419611526565b90925090506114288282611151565b9250505090565b60008060008060008061144187611568565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061147390876115c5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114a29086611607565b6001600160a01b0389166000908152600260205260409020556114c481611666565b6114ce84836116b0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161151391815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006115428282611151565b82101561155f57505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115858a600a54600b546116d4565b925092509250600061159561140c565b905060008060006115a88e878787611723565b919e509c509a509598509396509194505050505091939550919395565b600061114a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611091565b6000806116148385611ab3565b90508381101561114a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161042e565b600061167061140c565b9050600061167e83836110cb565b3060009081526002602052604090205490915061169b9082611607565b30600090815260026020526040902055505050565b6008546116bd90836115c5565b6008556009546116cd9082611607565b6009555050565b60008080806116e860646105ee89896110cb565b905060006116fb60646105ee8a896110cb565b905060006117138261170d8b866115c5565b906115c5565b9992985090965090945050505050565b600080808061173288866110cb565b9050600061174088876110cb565b9050600061174e88886110cb565b905060006117608261170d86866115c5565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156117a057858101830151858201604001528201611784565b818111156117b2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461062457600080fd5b80356117e8816117c8565b919050565b6000806040838503121561180057600080fd5b823561180b816117c8565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561184257600080fd5b823567ffffffffffffffff8082111561185a57600080fd5b818501915085601f83011261186e57600080fd5b81358181111561188057611880611819565b8060051b604051601f19603f830116810181811085821117156118a5576118a5611819565b6040529182528482019250838101850191888311156118c357600080fd5b938501935b828510156118e8576118d9856117dd565b845293850193928501926118c8565b98975050505050505050565b60008060006060848603121561190957600080fd5b8335611914816117c8565b92506020840135611924816117c8565b929592945050506040919091013590565b60006020828403121561194757600080fd5b813561114a816117c8565b801515811461062457600080fd5b60006020828403121561197257600080fd5b813561114a81611952565b60006020828403121561198f57600080fd5b5035919050565b600080604083850312156119a957600080fd5b82356119b4816117c8565b915060208301356119c4816117c8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a4457611a44611a1a565b5060010190565b600060208284031215611a5d57600080fd5b815161114a816117c8565b600080600060608486031215611a7d57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611aa857600080fd5b815161114a81611952565b60008219821115611ac657611ac6611a1a565b500190565b600082821015611add57611add611a1a565b500390565b6000816000190483118215151615611afc57611afc611a1a565b500290565b600082611b1e57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b735784516001600160a01b031683529383019391830191600101611b4e565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c26e3aaf3a5e578fabebf812f5422da77f42f935c3535a1d1823e4295cf3508f64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,641
0x64c54463be7f529ab69e9df33f603c242aed1a85
pragma solidity ^0.4.21; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface TokenInterface { function totalSupply() external constant returns (uint); function balanceOf(address tokenOwner) external constant returns (uint balance); function allowance(address tokenOwner, address spender) external constant returns (uint remaining); function transfer(address to, uint tokens) external returns (bool success); function approve(address spender, uint tokens) external returns (bool success); function transferFrom(address from, address to, uint tokens) external returns (bool success); function burn(uint256 _value) external; event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); event Burn(address indexed burner, uint256 value); } contract PVCCrowdsale is Ownable{ using SafeMath for uint256; // The token being sold TokenInterface 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 ratePerWei = 1000; // amount of raised money in wei uint256 public weiRaised; uint256 public TOKENS_SOLD; uint256 maxTokensToSale; uint256 TokensForTeamVesting; uint256 TokensForAdvisorVesting; uint256 bonusInPreSalePhase1; uint256 bonusInPreSalePhase2; uint256 bonusInPublicSalePhase1; uint256 bonusInPublicSalePhase2; uint256 bonusInPublicSalePhase3; uint256 bonusInPublicSalePhase4; uint256 bonusInPublicSalePhase5; uint256 bonusInPublicSalePhase6; bool isCrowdsalePaused = false; uint256 totalDurationInDays = 145 days; mapping(address=>bool) isAddressWhiteListed; /** * 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 PVCCrowdsale(uint256 _startTime, address _wallet, address _tokenAddress) public { require(_wallet != 0x0); startTime = _startTime; endTime = startTime + totalDurationInDays; require(endTime >= startTime); owner = _wallet; maxTokensToSale = 32500000 * 10 ** 18; TOKENS_SOLD = 346018452900000000000; // the tokens that have been sold through the previous contract weiRaised = 285373570000000000; // the weis that have been raised through the previous contract bonusInPreSalePhase1 = 30; bonusInPreSalePhase2 = 25; bonusInPublicSalePhase1 = 20; bonusInPublicSalePhase2 = 25; bonusInPublicSalePhase3 = 20; bonusInPublicSalePhase4 = 15; bonusInPublicSalePhase5 = 10; bonusInPublicSalePhase6 = 5; TokensForTeamVesting = 7000000 * 10 ** 18; TokensForAdvisorVesting = 3000000 * 10 ** 18; token = TokenInterface(_tokenAddress); } // fallback function can be used to buy tokens function () public payable { buyTokens(msg.sender); } function determineBonus(uint tokens) internal view returns (uint256 bonus) { uint256 timeElapsed = now - startTime; uint256 timeElapsedInDays = timeElapsed.div(1 days); //Closed pre-sale phase 1 (8 days starting apr 9) if (timeElapsedInDays <8) { bonus = tokens.mul(bonusInPreSalePhase1); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } //Closed pre-sale phase 2 (8 days starting apr 17) else if (timeElapsedInDays >=8 && timeElapsedInDays <16) { bonus = tokens.mul(bonusInPreSalePhase2); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } //Public sale phase 1 original (30 days starting on apr 25) //Public sale phase 1 new (10 days ending may 4) else if (timeElapsedInDays >=16 && timeElapsedInDays <26) { bonus = tokens.mul(bonusInPublicSalePhase1); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } //Public sale phase 2 (27 days) else if (timeElapsedInDays >=26 && timeElapsedInDays <53) { bonus = tokens.mul(bonusInPublicSalePhase2); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } //Public sale phase 3 (30 days) else if (timeElapsedInDays >=53 && timeElapsedInDays <83) { bonus = tokens.mul(bonusInPublicSalePhase3); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } //Public sale phase 4 (15 days) else if (timeElapsedInDays >=83 && timeElapsedInDays <98) { bonus = tokens.mul(bonusInPublicSalePhase4); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } //Public sale phase 5 (16 days) else if (timeElapsedInDays >=98 && timeElapsedInDays <114) { bonus = tokens.mul(bonusInPublicSalePhase5); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } //Public sale phase 6 (31 days) else if (timeElapsedInDays >=114 && timeElapsedInDays <145) { bonus = tokens.mul(bonusInPublicSalePhase6); bonus = bonus.div(100); require (TOKENS_SOLD.add(tokens.add(bonus)) <= maxTokensToSale); } // else { bonus = 0; } } // low level token purchase function function buyTokens(address beneficiary) public payable { require(beneficiary != 0x0); require(isCrowdsalePaused == false); require(validPurchase()); require(TOKENS_SOLD<maxTokensToSale); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(ratePerWei); uint256 bonus = determineBonus(tokens); tokens = tokens.add(bonus); // update state weiRaised = weiRaised.add(weiAmount); token.transfer(beneficiary,tokens); emit TokenPurchase(owner, beneficiary, weiAmount, tokens); TOKENS_SOLD = TOKENS_SOLD.add(tokens); forwardFunds(); } // send ether to the fund collection wallet function forwardFunds() internal { owner.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal constant returns (bool) { bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { return now > endTime; } /** * function to change the end timestamp of the ico * can only be called by owner wallet **/ function changeEndDate(uint256 endTimeUnixTimestamp) public onlyOwner{ endTime = endTimeUnixTimestamp; } /** * function to change the start timestamp of the ico * can only be called by owner wallet **/ function changeStartDate(uint256 startTimeUnixTimestamp) public onlyOwner{ startTime = startTimeUnixTimestamp; } /** * function to change the rate of tokens * can only be called by owner wallet **/ function setPriceRate(uint256 newPrice) public onlyOwner { ratePerWei = newPrice; } /** * function to pause the crowdsale * can only be called from owner wallet **/ function pauseCrowdsale() public onlyOwner { isCrowdsalePaused = true; } /** * function to resume the crowdsale if it is paused * can only be called from owner wallet **/ function resumeCrowdsale() public onlyOwner { isCrowdsalePaused = false; } /** * function through which owner can take back the tokens from the contract **/ function takeTokensBack() public onlyOwner { uint remainingTokensInTheContract = token.balanceOf(address(this)); token.transfer(owner,remainingTokensInTheContract); } /** * once the ICO has ended, owner can send all the unsold tokens to treasury address **/ function sendUnsoldTokensToTreasury(address treasury) public onlyOwner { require(hasEnded()); uint remainingTokensInTheContract = token.balanceOf(address(this)); token.transfer(treasury,remainingTokensInTheContract); } }
0x6080604052600436106100f0576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062739f2a146100fb5780630c8f167e146101285780632e6d561b146101535780633197cbb6146101965780634042b66f146101c157806345737b1e146101ec57806358c6f08b146102195780636786ed0e1461023057806378e979251461025d5780638da5cb5b14610288578063a8351c03146102df578063bc7c322c146102f6578063ec8ac4d814610321578063ecb70fb714610357578063f2fde38b14610386578063f6a60d89146103c9578063fc0c546a146103e0575b6100f933610437565b005b34801561010757600080fd5b50610126600480360381019080803590602001909291905050506106b5565b005b34801561013457600080fd5b5061013d61071a565b6040518082815260200191505060405180910390f35b34801561015f57600080fd5b50610194600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610720565b005b3480156101a257600080fd5b506101ab61098f565b6040518082815260200191505060405180910390f35b3480156101cd57600080fd5b506101d6610995565b6040518082815260200191505060405180910390f35b3480156101f857600080fd5b506102176004803603810190808035906020019092919050505061099b565b005b34801561022557600080fd5b5061022e610a00565b005b34801561023c57600080fd5b5061025b60048036038101908080359060200190929190505050610c7c565b005b34801561026957600080fd5b50610272610ce1565b6040518082815260200191505060405180910390f35b34801561029457600080fd5b5061029d610ce7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102eb57600080fd5b506102f4610d0c565b005b34801561030257600080fd5b5061030b610d84565b6040518082815260200191505060405180910390f35b610355600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610437565b005b34801561036357600080fd5b5061036c610d8a565b604051808215151515815260200191505060405180910390f35b34801561039257600080fd5b506103c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d96565b005b3480156103d557600080fd5b506103de610eeb565b005b3480156103ec57600080fd5b506103f5610f63565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000806000808473ffffffffffffffffffffffffffffffffffffffff161415151561046157600080fd5b60001515601260009054906101000a900460ff16151514151561048357600080fd5b61048b610f89565b151561049657600080fd5b6007546006541015156104a857600080fd5b3492506104c060045484610fbc90919063ffffffff16565b91506104cb82610ff7565b90506104e0818361141990919063ffffffff16565b91506104f78360055461141990919063ffffffff16565b600581905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156105c257600080fd5b505af11580156105d6573d6000803e3d6000fd5b505050506040513d60208110156105ec57600080fd5b8101908080519060200190929190505050508373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188585604051808381526020018281526020019250505060405180910390a36106a18260065461141990919063ffffffff16565b6006819055506106af611437565b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561071057600080fd5b8060028190555050565b60065481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077d57600080fd5b610785610d8a565b151561079057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561084d57600080fd5b505af1158015610861573d6000803e3d6000fd5b505050506040513d602081101561087757600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561094f57600080fd5b505af1158015610963573d6000803e3d6000fd5b505050506040513d602081101561097957600080fd5b8101908080519060200190929190505050505050565b60035481565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109f657600080fd5b8060038190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a5d57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610b1a57600080fd5b505af1158015610b2e573d6000803e3d6000fd5b505050506040513d6020811015610b4457600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c3d57600080fd5b505af1158015610c51573d6000803e3d6000fd5b505050506040513d6020811015610c6757600080fd5b81019080805190602001909291905050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cd757600080fd5b8060048190555050565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d6757600080fd5b6001601260006101000a81548160ff021916908315150217905550565b60045481565b60006003544211905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e2d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f4657600080fd5b6000601260006101000a81548160ff021916908315150217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060006002544210158015610fa257506003544211155b915060003414159050818015610fb55750805b9250505090565b6000806000841415610fd15760009150610ff0565b8284029050828482811515610fe257fe5b04141515610fec57fe5b8091505b5092915050565b60008060006002544203915061101962015180836114a190919063ffffffff16565b9050600881101561108d57611039600a5485610fbc90919063ffffffff16565b925061104f6064846114a190919063ffffffff16565b925060075461107b61106a858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561108857600080fd5b611412565b6008811015801561109e5750601081105b1561110c576110b8600b5485610fbc90919063ffffffff16565b92506110ce6064846114a190919063ffffffff16565b92506007546110fa6110e9858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561110757600080fd5b611411565b6010811015801561111d5750601a81105b1561118b57611137600c5485610fbc90919063ffffffff16565b925061114d6064846114a190919063ffffffff16565b9250600754611179611168858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561118657600080fd5b611410565b601a811015801561119c5750603581105b1561120a576111b6600d5485610fbc90919063ffffffff16565b92506111cc6064846114a190919063ffffffff16565b92506007546111f86111e7858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561120557600080fd5b61140f565b6035811015801561121b5750605381105b1561128957611235600e5485610fbc90919063ffffffff16565b925061124b6064846114a190919063ffffffff16565b9250600754611277611266858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561128457600080fd5b61140e565b6053811015801561129a5750606281105b15611308576112b4600f5485610fbc90919063ffffffff16565b92506112ca6064846114a190919063ffffffff16565b92506007546112f66112e5858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561130357600080fd5b61140d565b606281101580156113195750607281105b156113875761133360105485610fbc90919063ffffffff16565b92506113496064846114a190919063ffffffff16565b9250600754611375611364858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561138257600080fd5b61140c565b607281101580156113985750609181105b15611406576113b260115485610fbc90919063ffffffff16565b92506113c86064846114a190919063ffffffff16565b92506007546113f46113e3858761141990919063ffffffff16565b60065461141990919063ffffffff16565b1115151561140157600080fd5b61140b565b600092505b5b5b5b5b5b5b5b5050919050565b600080828401905083811015151561142d57fe5b8091505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015801561149e573d6000803e3d6000fd5b50565b60008082848115156114af57fe5b04905080915050929150505600a165627a7a723058200ac6b9bd4b409787aa7c543203859b2f65513e6ac5551c2f4f3dfe4f8e53b6fc0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,642
0x19338dbc004f3cb0b764efe348a0caa5fe5c9c95
pragma solidity ^0.4.21; // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: zeppelin-solidity/contracts/ownership/Claimable.sol /** * @title Claimable * @dev Extension for the Ownable contract, where the ownership needs to be claimed. * This allows the new owner to accept the transfer. */ contract Claimable is Ownable { address public pendingOwner; /** * @dev Modifier throws if called by any account other than the pendingOwner. */ modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } /** * @dev Allows the current owner to set the pendingOwner address. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { pendingOwner = newOwner; } /** * @dev Allows the pendingOwner address to finalize the transfer. */ function claimOwnership() onlyPendingOwner public { emit OwnershipTransferred(owner, pendingOwner); owner = pendingOwner; pendingOwner = address(0); } } // File: contracts/external/KYCWhitelist.sol /** * @title KYCWhitelist * @dev Crowdsale in which only whitelisted users can contribute. */ contract KYCWhitelist is Claimable { mapping(address => bool) public whitelist; /** * @dev Reverts if beneficiary is not whitelisted. Can be used when extending this contract. */ modifier isWhitelisted(address _beneficiary) { require(whitelist[_beneficiary]); _; } /** * @dev Does a "require" check if _beneficiary address is approved * @param _beneficiary Token beneficiary */ function validateWhitelisted(address _beneficiary) internal view { require(whitelist[_beneficiary]); } /** * @dev Adds single address to whitelist. * @param _beneficiary Address to be added to the whitelist */ function addToWhitelist(address _beneficiary) external onlyOwner { whitelist[_beneficiary] = true; } /** * @dev Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing. * @param _beneficiaries Addresses to be added to the whitelist */ function addManyToWhitelist(address[] _beneficiaries) external onlyOwner { for (uint256 i = 0; i < _beneficiaries.length; i++) { whitelist[_beneficiaries[i]] = true; } } /** * @dev Removes single address from whitelist. * @param _beneficiary Address to be removed to the whitelist */ function removeFromWhitelist(address _beneficiary) external onlyOwner { whitelist[_beneficiary] = false; } } // File: contracts/external/Pausable.sol /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Claimable { 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: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/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/PrivatePreSale.sol /** * @title PrivatePreSale * * Private Pre-sale contract for Energis tokens * * (c) Philip Louw / Zero Carbon Project 2018. The MIT Licence. */ contract PrivatePreSale is Claimable, KYCWhitelist, Pausable { using SafeMath for uint256; // Wallet Address for funds address public constant FUNDS_WALLET = 0xDc17D222Bc3f28ecE7FCef42EDe0037C739cf28f; // Token Wallet Address address public constant TOKEN_WALLET = 0x1EF91464240BB6E0FdE7a73E0a6f3843D3E07601; // Token adderss being sold address public constant TOKEN_ADDRESS = 0x2169Cce281717d204FA0EcF846a6171e96234D72; // Token being sold ERC20 public constant TOKEN = ERC20(TOKEN_ADDRESS); // Conversion Rate (Eth cost of 1 NRG) (Testing uses ETH price of $10 000) uint256 public constant TOKENS_PER_ETH = 6740; // Max NRG tokens to sell uint256 public constant MAX_TOKENS = 20000000 * (10**18); // Min investment in Tokens uint256 public constant MIN_TOKEN_INVEST = 300000 * (10**18); // Token sale start date uint256 public START_DATE = 1525176000; // ----------------------------------------- // State Variables // ----------------------------------------- // Amount of wei raised uint256 public weiRaised; // Amount of tokens issued uint256 public tokensIssued; // If the pre-sale has ended bool public closed; // ----------------------------------------- // Events // ----------------------------------------- /** * 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); // ----------------------------------------- // Constructor // ----------------------------------------- function PrivatePreSale() public { require(TOKENS_PER_ETH > 0); require(FUNDS_WALLET != address(0)); require(TOKEN_WALLET != address(0)); require(TOKEN_ADDRESS != address(0)); require(MAX_TOKENS > 0); require(MIN_TOKEN_INVEST >= 0); } // ----------------------------------------- // Private PreSale external Interface // ----------------------------------------- /** * @dev Checks whether the cap has been reached. * @return Whether the cap was reached */ function capReached() public view returns (bool) { return tokensIssued >= MAX_TOKENS; } /** * @dev Closes the sale, can only be called once. Once closed can not be opened again. */ function closeSale() public onlyOwner { require(!closed); closed = true; } /** * @dev Returns the amount of tokens given for the amount in Wei * @param _weiAmount Value in wei */ function getTokenAmount(uint256 _weiAmount) public pure returns (uint256) { // Amount in wei (10**18 wei == 1 eth) and the token is 18 decimal places return _weiAmount.mul(TOKENS_PER_ETH); } /** * @dev fallback function ***DO NOT OVERRIDE*** */ function () external payable { buyTokens(msg.sender); } // ----------------------------------------- // Private PreSale internal // ----------------------------------------- /** * @dev low level token purchase ***DO NOT OVERRIDE*** * @param _beneficiary Address performing the token purchase */ function buyTokens(address _beneficiary) internal whenNotPaused { uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokenAmount = getTokenAmount(weiAmount); // Validation Checks preValidateChecks(_beneficiary, weiAmount, tokenAmount); // update state tokensIssued = tokensIssued.add(tokenAmount); weiRaised = weiRaised.add(weiAmount); // Send tokens from token wallet TOKEN.transferFrom(TOKEN_WALLET, _beneficiary, tokenAmount); // Forward the funds to wallet FUNDS_WALLET.transfer(msg.value); // Event trigger emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokenAmount); } /** * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations. * @param _beneficiary Address performing the token purchase * @param _weiAmount Value in wei involved in the purchase * @param _tokenAmount Amount of token to purchase */ function preValidateChecks(address _beneficiary, uint256 _weiAmount, uint256 _tokenAmount) internal view { require(_beneficiary != address(0)); require(_weiAmount != 0); require(now >= START_DATE); require(!closed); // KYC Check validateWhitelisted(_beneficiary); // Test Min Investment require(_tokenAmount >= MIN_TOKEN_INVEST); // Test hard cap require(tokensIssued.add(_tokenAmount) <= MAX_TOKENS); } }
0x6060604052600436106101485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630bdf53008114610153578063372c6533146101825780633f4ba83a146101a75780634042b66f146101ba5780634e71e0c8146101cd5780634f935945146101e0578063597e1fb5146102075780635c975abb1461021a57806369b6438e1461022d5780637365babe146102405780637c48bbda1461025357806382bfefc8146101535780638456cb59146102665780638ab1d681146102795780638ada1957146102985780638c10671c146102ab5780638da5cb5b146102c95780639b19251a146102dc578063bc6e6604146102fb578063c2507ac11461030e578063e30c397814610324578063e43252d714610337578063ee55efee14610356578063f2fde38b14610369578063f47c84c514610388575b6101513361039b565b005b341561015e57600080fd5b610166610536565b604051600160a060020a03909116815260200160405180910390f35b341561018d57600080fd5b61019561054e565b60405190815260200160405180910390f35b34156101b257600080fd5b610151610554565b34156101c557600080fd5b6101956105b8565b34156101d857600080fd5b6101516105be565b34156101eb57600080fd5b6101f361064c565b604051901515815260200160405180910390f35b341561021257600080fd5b6101f3610661565b341561022557600080fd5b6101f361066a565b341561023857600080fd5b610166610673565b341561024b57600080fd5b61019561068b565b341561025e57600080fd5b610195610699565b341561027157600080fd5b61015161069f565b341561028457600080fd5b610151600160a060020a0360043516610705565b34156102a357600080fd5b610166610741565b34156102b657600080fd5b6101516004803560248101910135610759565b34156102d457600080fd5b6101666107d1565b34156102e757600080fd5b6101f3600160a060020a03600435166107e0565b341561030657600080fd5b6101956107f5565b341561031957600080fd5b6101956004356107fb565b341561032f57600080fd5b610166610815565b341561034257600080fd5b610151600160a060020a0360043516610824565b341561036157600080fd5b610151610863565b341561037457600080fd5b610151600160a060020a036004351661089d565b341561039357600080fd5b6101956108e7565b600354600090819060ff16156103b057600080fd5b3491506103bc826107fb565b90506103c98383836108f6565b6006546103dc908263ffffffff61098116565b6006556005546103f2908363ffffffff61098116565b600555732169cce281717d204fa0ecf846a6171e96234d726323b872dd731ef91464240bb6e0fde7a73e0a6f3843d3e0760185846040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561048e57600080fd5b5af1151561049b57600080fd5b50505060405180515073dc17d222bc3f28ece7fcef42ede0037c739cf28f90503480156108fc0290604051600060405180830381858888f1935050505015156104e357600080fd5b82600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18848460405191825260208201526040908101905180910390a3505050565b732169cce281717d204fa0ecf846a6171e96234d7281565b60045481565b60005433600160a060020a0390811691161461056f57600080fd5b60035460ff16151561058057600080fd5b6003805460ff191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60055481565b60015433600160a060020a039081169116146105d957600080fd5b600154600054600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b6006546a108b2a2c2802909400000090101590565b60075460ff1681565b60035460ff1681565b73dc17d222bc3f28ece7fcef42ede0037c739cf28f81565b693f870857a3e0e380000081565b60065481565b60005433600160a060020a039081169116146106ba57600080fd5b60035460ff16156106ca57600080fd5b6003805460ff191660011790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b60005433600160a060020a0390811691161461072057600080fd5b600160a060020a03166000908152600260205260409020805460ff19169055565b731ef91464240bb6e0fde7a73e0a6f3843d3e0760181565b6000805433600160a060020a0390811691161461077557600080fd5b5060005b818110156107cc5760016002600085858581811061079357fe5b60209081029290920135600160a060020a0316835250810191909152604001600020805460ff1916911515919091179055600101610779565b505050565b600054600160a060020a031681565b60026020526000908152604090205460ff1681565b611a5481565b600061080f82611a5463ffffffff61099b16565b92915050565b600154600160a060020a031681565b60005433600160a060020a0390811691161461083f57600080fd5b600160a060020a03166000908152600260205260409020805460ff19166001179055565b60005433600160a060020a0390811691161461087e57600080fd5b60075460ff161561088e57600080fd5b6007805460ff19166001179055565b60005433600160a060020a039081169116146108b857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6a108b2a2c2802909400000081565b600160a060020a038316151561090b57600080fd5b81151561091757600080fd5b60045442101561092657600080fd5b60075460ff161561093657600080fd5b61093f836109c6565b693f870857a3e0e380000081101561095657600080fd5b6006546a108b2a2c2802909400000090610976908363ffffffff61098116565b11156107cc57600080fd5b60008282018381101561099057fe5b8091505b5092915050565b6000808315156109ae5760009150610994565b508282028284828115156109be57fe5b041461099057fe5b600160a060020a03811660009081526002602052604090205460ff1615156109ed57600080fd5b505600a165627a7a72305820154ed571451055d721c5af8595d571f955e8f2f8d69df76b4a0e72641974f7b90029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,643
0xa2ceC51f087FaBBCFc7f217d4804b3F69eAD2819
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @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); } } } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } /** * @dev A token holder contract that will allow a beneficiary to extract the * tokens after a given release time. * * Useful for simple vesting schedules like "advisors get all of their tokens * after 1 year". */ contract TokenTimelock { using SafeERC20 for IERC20; // ERC20 basic token contract being held IERC20 private immutable _token; // beneficiary of tokens after they are released address private immutable _beneficiary; // timestamp when token release is enabled uint256 private immutable _releaseTime; constructor( IERC20 token_, address beneficiary_, uint256 releaseTime_ ) { require(releaseTime_ > block.timestamp, "TokenTimelock: release time is before current time"); _token = token_; _beneficiary = beneficiary_; _releaseTime = releaseTime_; } /** * @return the token being held. */ function token() public view virtual returns (IERC20) { return _token; } /** * @return the beneficiary of the tokens. */ function beneficiary() public view virtual returns (address) { return _beneficiary; } /** * @return the time when the tokens are released. */ function releaseTime() public view virtual returns (uint256) { return _releaseTime; } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public virtual { require(block.timestamp >= releaseTime(), "TokenTimelock: current time is before release time"); uint256 amount = token().balanceOf(address(this)); require(amount > 0, "TokenTimelock: no tokens to release"); token().safeTransfer(beneficiary(), amount); } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f14610090578063b91d40011461009a578063fc0c546a146100c8575b600080fd5b7f0000000000000000000000003e579180cf01f0e2abf6ff4d566b7891fbf9b8685b6040516001600160a01b0390911681526020015b60405180910390f35b6100986100ee565b005b6040517f000000000000000000000000000000000000000000000000000000006efe48a98152602001610087565b7f0000000000000000000000004f9a70b87aac8e4b751f65350942b8faa9dc4b4e610073565b7f000000000000000000000000000000000000000000000000000000006efe48a942101561017e5760405162461bcd60e51b815260206004820152603260248201527f546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206260448201527165666f72652072656c656173652074696d6560701b60648201526084015b60405180910390fd5b60007f0000000000000000000000004f9a70b87aac8e4b751f65350942b8faa9dc4b4e6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a082319060240160206040518083038186803b1580156101e257600080fd5b505afa1580156101f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021a9190610592565b9050600081116102785760405162461bcd60e51b815260206004820152602360248201527f546f6b656e54696d656c6f636b3a206e6f20746f6b656e7320746f2072656c6560448201526261736560e81b6064820152608401610175565b6102cc6001600160a01b037f0000000000000000000000004f9a70b87aac8e4b751f65350942b8faa9dc4b4e167f0000000000000000000000003e579180cf01f0e2abf6ff4d566b7891fbf9b868836102cf565b50565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610321908490610326565b505050565b600061037b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166103f89092919063ffffffff16565b80519091501561032157808060200190518101906103999190610572565b6103215760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610175565b60606104078484600085610411565b90505b9392505050565b6060824710156104725760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610175565b843b6104c05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610175565b600080866001600160a01b031685876040516104dc91906105aa565b60006040518083038185875af1925050503d8060008114610519576040519150601f19603f3d011682016040523d82523d6000602084013e61051e565b606091505b509150915061052e828286610539565b979650505050505050565b6060831561054857508161040a565b8251156105585782518084602001fd5b8160405162461bcd60e51b815260040161017591906105c6565b600060208284031215610583578081fd5b8151801515811461040a578182fd5b6000602082840312156105a3578081fd5b5051919050565b600082516105bc8184602087016105f9565b9190910192915050565b60208152600082518060208401526105e58160408501602087016105f9565b601f01601f19169190910160400192915050565b60005b838110156106145781810151838201526020016105fc565b83811115610623576000848401525b5050505056fea264697066735822122041610ec4c195d20c8d1d1f3b3390f2d14f0978b50c1247dcc54a788b8d52e80a64736f6c63430008040033
{"success": true, "error": null, "results": {}}
6,644
0x916eac5d05cd94029a362612e813396c94124345
// SPDX-License-Identifier: Unlicensed //THE HOLCIM //THE HOLCIM //THE HOLCIM //THE HOLCIM //THE HOLCIM 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 THEHOLCIM is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "THE HOLCIM"; string private constant _symbol = "HOLCIM"; 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 = 1e7 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 10; 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 = 130000 * 10**9; uint256 public _maxWalletSize = 260000 * 10**9; uint256 public _swapTokensAtAmount = 13000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _marketingAddress = payable(_msgSender()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function initContract() external onlyOwner(){ IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function setTrading(bool _tradingOpen) public onlyOwner { require(!tradingOpen); tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { require(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) external onlyOwner{ swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { require(maxTxAmount > 5000000 * 10**9 ); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610576578063dd62ed3e14610596578063ea1644d5146105dc578063f2fde38b146105fc57600080fd5b8063a2a957bb146104f1578063a9059cbb14610511578063bfd7928414610531578063c3c8cd801461056157600080fd5b80638f70ccf7116100d15780638f70ccf71461046c5780638f9a55c01461048c57806395d89b41146104a257806398a5c315146104d157600080fd5b80637d1db4a5146103f65780637f2feddc1461040c5780638203f5fe146104395780638da5cb5b1461044e57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101b65780631694505e1461027e57806318160ddd146102b657806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024e57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b6d565b61061c565b005b34801561021557600080fd5b5060408051808201909152600a81526954484520484f4c43494d60b01b60208201525b6040516102459190611c32565b60405180910390f35b34801561025a57600080fd5b5061026e610269366004611c87565b6106bb565b6040519015158152602001610245565b34801561028a57600080fd5b5060135461029e906001600160a01b031681565b6040516001600160a01b039091168152602001610245565b3480156102c257600080fd5b50662386f26fc100005b604051908152602001610245565b3480156102e657600080fd5b5061026e6102f5366004611cb3565b6106d2565b34801561030657600080fd5b506102cc60175481565b34801561031c57600080fd5b5060405160098152602001610245565b34801561033857600080fd5b5060145461029e906001600160a01b031681565b34801561035857600080fd5b50610207610367366004611cf4565b61073b565b34801561037857600080fd5b50610207610387366004611d21565b610786565b34801561039857600080fd5b506102076107ce565b3480156103ad57600080fd5b506102cc6103bc366004611cf4565b6107fb565b3480156103cd57600080fd5b5061020761081d565b3480156103e257600080fd5b506102076103f1366004611d3c565b610891565b34801561040257600080fd5b506102cc60155481565b34801561041857600080fd5b506102cc610427366004611cf4565b60116020526000908152604090205481565b34801561044557600080fd5b506102076108d3565b34801561045a57600080fd5b506000546001600160a01b031661029e565b34801561047857600080fd5b50610207610487366004611d21565b610ab8565b34801561049857600080fd5b506102cc60165481565b3480156104ae57600080fd5b50604080518082019091526006815265484f4c43494d60d01b6020820152610238565b3480156104dd57600080fd5b506102076104ec366004611d3c565b610b17565b3480156104fd57600080fd5b5061020761050c366004611d55565b610b46565b34801561051d57600080fd5b5061026e61052c366004611c87565b610ba0565b34801561053d57600080fd5b5061026e61054c366004611cf4565b60106020526000908152604090205460ff1681565b34801561056d57600080fd5b50610207610bad565b34801561058257600080fd5b50610207610591366004611d87565b610be3565b3480156105a257600080fd5b506102cc6105b1366004611e0b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e857600080fd5b506102076105f7366004611d3c565b610c84565b34801561060857600080fd5b50610207610617366004611cf4565b610cb3565b6000546001600160a01b0316331461064f5760405162461bcd60e51b815260040161064690611e44565b60405180910390fd5b60005b81518110156106b75760016010600084848151811061067357610673611e79565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106af81611ea5565b915050610652565b5050565b60006106c8338484610d9d565b5060015b92915050565b60006106df848484610ec1565b610731843361072c85604051806060016040528060288152602001611fbf602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113fd565b610d9d565b5060019392505050565b6000546001600160a01b031633146107655760405162461bcd60e51b815260040161064690611e44565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107b05760405162461bcd60e51b815260040161064690611e44565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ee57600080fd5b476107f881611437565b50565b6001600160a01b0381166000908152600260205260408120546106cc90611471565b6000546001600160a01b031633146108475760405162461bcd60e51b815260040161064690611e44565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bb5760405162461bcd60e51b815260040161064690611e44565b6611c37937e0800081116108ce57600080fd5b601555565b6000546001600160a01b031633146108fd5760405162461bcd60e51b815260040161064690611e44565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561095d57600080fd5b505afa158015610971573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109959190611ec0565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109dd57600080fd5b505afa1580156109f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a159190611ec0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a5d57600080fd5b505af1158015610a71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a959190611ec0565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ae25760405162461bcd60e51b815260040161064690611e44565b601454600160a01b900460ff1615610af957600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b415760405162461bcd60e51b815260040161064690611e44565b601755565b6000546001600160a01b03163314610b705760405162461bcd60e51b815260040161064690611e44565b60095482111580610b835750600b548111155b610b8c57600080fd5b600893909355600a91909155600955600b55565b60006106c8338484610ec1565b6012546001600160a01b0316336001600160a01b031614610bcd57600080fd5b6000610bd8306107fb565b90506107f8816114f5565b6000546001600160a01b03163314610c0d5760405162461bcd60e51b815260040161064690611e44565b60005b82811015610c7e578160056000868685818110610c2f57610c2f611e79565b9050602002016020810190610c449190611cf4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c7681611ea5565b915050610c10565b50505050565b6000546001600160a01b03163314610cae5760405162461bcd60e51b815260040161064690611e44565b601655565b6000546001600160a01b03163314610cdd5760405162461bcd60e51b815260040161064690611e44565b6001600160a01b038116610d425760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610646565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dff5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610646565b6001600160a01b038216610e605760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610646565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f255760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610646565b6001600160a01b038216610f875760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610646565b60008111610fe95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610646565b6000546001600160a01b0384811691161480159061101557506000546001600160a01b03838116911614155b156112f657601454600160a01b900460ff166110ae576000546001600160a01b038481169116146110ae5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610646565b6015548111156111005760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610646565b6001600160a01b03831660009081526010602052604090205460ff1615801561114257506001600160a01b03821660009081526010602052604090205460ff16155b61119a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610646565b6014546001600160a01b0383811691161461121f57601654816111bc846107fb565b6111c69190611edd565b1061121f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610646565b600061122a306107fb565b6017546015549192508210159082106112435760155491505b80801561125a5750601454600160a81b900460ff16155b801561127457506014546001600160a01b03868116911614155b80156112895750601454600160b01b900460ff165b80156112ae57506001600160a01b03851660009081526005602052604090205460ff16155b80156112d357506001600160a01b03841660009081526005602052604090205460ff16155b156112f3576112e1826114f5565b4780156112f1576112f147611437565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061133857506001600160a01b03831660009081526005602052604090205460ff165b8061136a57506014546001600160a01b0385811691161480159061136a57506014546001600160a01b03848116911614155b15611377575060006113f1565b6014546001600160a01b0385811691161480156113a257506013546001600160a01b03848116911614155b156113b457600854600c55600954600d555b6014546001600160a01b0384811691161480156113df57506013546001600160a01b03858116911614155b156113f157600a54600c55600b54600d555b610c7e8484848461167e565b600081848411156114215760405162461bcd60e51b81526004016106469190611c32565b50600061142e8486611ef5565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b7573d6000803e3d6000fd5b60006006548211156114d85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610646565b60006114e26116ac565b90506114ee83826116cf565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061153d5761153d611e79565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115c99190611ec0565b816001815181106115dc576115dc611e79565b6001600160a01b0392831660209182029290920101526013546116029130911684610d9d565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac9479061163b908590600090869030904290600401611f0c565b600060405180830381600087803b15801561165557600080fd5b505af1158015611669573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061168b5761168b611711565b61169684848461173f565b80610c7e57610c7e600e54600c55600f54600d55565b60008060006116b9611836565b90925090506116c882826116cf565b9250505090565b60006114ee83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611874565b600c541580156117215750600d54155b1561172857565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611751876118a2565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061178390876118ff565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117b29086611941565b6001600160a01b0389166000908152600260205260409020556117d4816119a0565b6117de84836119ea565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182391815260200190565b60405180910390a3505050505050505050565b6006546000908190662386f26fc1000061185082826116cf565b82101561186b57505060065492662386f26fc1000092509050565b90939092509050565b600081836118955760405162461bcd60e51b81526004016106469190611c32565b50600061142e8486611f7d565b60008060008060008060008060006118bf8a600c54600d54611a0e565b92509250925060006118cf6116ac565b905060008060006118e28e878787611a63565b919e509c509a509598509396509194505050505091939550919395565b60006114ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fd565b60008061194e8385611edd565b9050838110156114ee5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610646565b60006119aa6116ac565b905060006119b88383611ab3565b306000908152600260205260409020549091506119d59082611941565b30600090815260026020526040902055505050565b6006546119f790836118ff565b600655600754611a079082611941565b6007555050565b6000808080611a286064611a228989611ab3565b906116cf565b90506000611a3b6064611a228a89611ab3565b90506000611a5382611a4d8b866118ff565b906118ff565b9992985090965090945050505050565b6000808080611a728886611ab3565b90506000611a808887611ab3565b90506000611a8e8888611ab3565b90506000611aa082611a4d86866118ff565b939b939a50919850919650505050505050565b600082611ac2575060006106cc565b6000611ace8385611f9f565b905082611adb8583611f7d565b146114ee5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610646565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f857600080fd5b8035611b6881611b48565b919050565b60006020808385031215611b8057600080fd5b823567ffffffffffffffff80821115611b9857600080fd5b818501915085601f830112611bac57600080fd5b813581811115611bbe57611bbe611b32565b8060051b604051601f19603f83011681018181108582111715611be357611be3611b32565b604052918252848201925083810185019188831115611c0157600080fd5b938501935b82851015611c2657611c1785611b5d565b84529385019392850192611c06565b98975050505050505050565b600060208083528351808285015260005b81811015611c5f57858101830151858201604001528201611c43565b81811115611c71576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c9a57600080fd5b8235611ca581611b48565b946020939093013593505050565b600080600060608486031215611cc857600080fd5b8335611cd381611b48565b92506020840135611ce381611b48565b929592945050506040919091013590565b600060208284031215611d0657600080fd5b81356114ee81611b48565b80358015158114611b6857600080fd5b600060208284031215611d3357600080fd5b6114ee82611d11565b600060208284031215611d4e57600080fd5b5035919050565b60008060008060808587031215611d6b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d9c57600080fd5b833567ffffffffffffffff80821115611db457600080fd5b818601915086601f830112611dc857600080fd5b813581811115611dd757600080fd5b8760208260051b8501011115611dec57600080fd5b602092830195509350611e029186019050611d11565b90509250925092565b60008060408385031215611e1e57600080fd5b8235611e2981611b48565b91506020830135611e3981611b48565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611eb957611eb9611e8f565b5060010190565b600060208284031215611ed257600080fd5b81516114ee81611b48565b60008219821115611ef057611ef0611e8f565b500190565b600082821015611f0757611f07611e8f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f5c5784516001600160a01b031683529383019391830191600101611f37565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f9a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611fb957611fb9611e8f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220386e456e9d47b08058b8661a45f55fe4e4809ea07f9d97a4b93402fbe283dfa264736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,645
0x8a9a5545e1f04a1e37ce02daebc06749df660017
/** *Submitted for verification at Etherscan.io on 2021-07-07 */ // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { // solhint-disable-next-line no-inline-assembly 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 This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback () external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive () external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual { } } /** * @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; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); } /** * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}. * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. * * _Available since v3.4._ */ contract BeaconProxy is Proxy { /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 private constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Initializes the proxy with `beacon`. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. This * will typically be an encoded function call, and allows initializating the storage of the proxy like a Solidity * constructor. * * Requirements: * * - `beacon` must be a contract with the interface {IBeacon}. */ constructor(address beacon, bytes memory data) public payable { assert(_BEACON_SLOT == bytes32(uint256(keccak256("eip1967.proxy.beacon")) - 1)); _setBeacon(beacon, data); } /** * @dev Returns the current beacon address. */ function _beacon() internal view virtual returns (address beacon) { bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { beacon := sload(slot) } } /** * @dev Returns the current implementation address of the associated beacon. */ function _implementation() internal view virtual override returns (address) { return IBeacon(_beacon()).implementation(); } /** * @dev Changes the proxy to use a new beacon. * * If `data` is nonempty, it's used as data in a delegate call to the implementation returned by the beacon. * * Requirements: * * - `beacon` must be a contract. * - The implementation returned by `beacon` must be a contract. */ function _setBeacon(address beacon, bytes memory data) internal virtual { require( Address.isContract(beacon), "BeaconProxy: beacon is not a contract" ); require( Address.isContract(IBeacon(beacon).implementation()), "BeaconProxy: beacon implementation is not a contract" ); bytes32 slot = _BEACON_SLOT; // solhint-disable-next-line no-inline-assembly assembly { sstore(slot, beacon) } if (data.length > 0) { Address.functionDelegateCall(_implementation(), data, "BeaconProxy: function call failed"); } } }
0x60806040523661001357610011610017565b005b6100115b61001f61002f565b61002f61002a61013c565b6101af565b565b3b151590565b606061004284610031565b61007d5760405162461bcd60e51b815260040180806020018281038252602681526020018061029d6026913960400191505060405180910390fd5b60006060856001600160a01b0316856040518082805190602001908083835b602083106100bb5780518252601f19909201916020918201910161009c565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101308282866101d3565b925050505b9392505050565b6000610146610277565b6001600160a01b0316635c60da1b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561017e57600080fd5b505afa158015610192573d6000803e3d6000fd5b505050506040513d60208110156101a857600080fd5b5051905090565b3660008037600080366000845af43d6000803e8080156101ce573d6000f35b3d6000fd5b606083156101e2575081610135565b8251156101f25782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561023c578181015183820152602001610224565b50505050905090810190601f1680156102695780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50549056fe416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6e7472616374a2646970667358221220cef37bc82c26936de8292b67cdab878ace54ec5d8ca95f748b5c0c87def0cd2f64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,646
0xd0Df86AfE5F66B70944605B1A6C859071A01e178
/** *Submitted for verification at Etherscan.io on 2021-02-09 */ /** *Submitted for verification at Etherscan.io on 2021-02-09 */ /** *Submitted for verification at Etherscan.io on 2021-02-09 */ /** *Submitted for verification at Etherscan.io on 2021-02-09 */ /** *Submitted for verification at Etherscan.io on 2021-01-30 */ pragma solidity 0.6.12; // SPDX-License-Identifier: No License /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { struct Set { bytes32[] _values; mapping (bytes32 => uint256) _indexes; } function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; bytes32 lastvalue = set._values[lastIndex]; set._values[toDeleteIndex] = lastvalue; set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based set._values.pop(); delete set._indexes[value]; return true; } else { return false; } } function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } function _length(Set storage set) private view returns (uint256) { return set._values.length; } function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } struct AddressSet { Set _inner; } function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } struct UintSet { Set _inner; } function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); function balanceOf(address) external view returns (uint256); } contract GCBVault is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; uint public vaultClose = 1e21; constructor(uint endTime) public { vaultClose = endTime; } // GCB token contract address address public constant tokenAddress = 0x3539a4F4C0dFfC813B75944821e380C9209D3446; uint public oneVaultLimit = 6e20; uint public fourVaultLimit = 6e20; uint public oneCliff = 30 days; uint public fourthCliff = 120 days; uint public vaultTotal = 0; mapping(address => uint) public onemonth; mapping(address => uint) public onemonthCliff; mapping(address => uint) public claimed; mapping(address => uint) public fourmonth; mapping(address => uint) public fourmonthCliff; event DepositAdded(address indexed user,uint amount ); event VaultClaimed(address indexed user, uint amount ); function oneDeposit(uint _amount) public returns (bool) { uint amount = _amount.sub(_amount.mul(350).div(1e4)); require(oneVaultLimit >= amount , "Can't deposit more than limit") ; require(vaultClose > now , "Can't deposit now") ; Token(tokenAddress).transferFrom(msg.sender , address(this), _amount); onemonth[msg.sender] = onemonth[msg.sender].add(amount) ; vaultTotal = vaultTotal.add(amount) ; onemonthCliff[msg.sender] = now + oneCliff ; oneVaultLimit = oneVaultLimit.sub(amount) ; emit DepositAdded(msg.sender,amount); return true ; } function fourDeposit(uint _amount) public returns (bool) { uint amount = _amount.sub(_amount.mul(350).div(1e4)); require(fourVaultLimit >= amount , "Can't deposit more than limit") ; require(vaultClose > now , "Can't deposit now") ; Token(tokenAddress).transferFrom(msg.sender , address(this), _amount); fourmonth[msg.sender] = fourmonth[msg.sender].add(amount) ; vaultTotal = vaultTotal.add(amount) ; fourmonthCliff[msg.sender] = now + fourthCliff ; fourVaultLimit = fourVaultLimit.sub(amount); emit DepositAdded(msg.sender,amount); return true ; } function claim() public returns (uint) { uint returnAmt = getTotalReturn(msg.sender) ; require(returnAmt > 0, "Cannot claim 0 or less"); Token(tokenAddress).transfer(msg.sender, returnAmt); emit VaultClaimed(msg.sender,returnAmt); claimed[msg.sender] = claimed[msg.sender].add(returnAmt) ; if(onemonthCliff[msg.sender] < now ){ oneVaultLimit = oneVaultLimit.add(onemonth[msg.sender]); vaultTotal = vaultTotal.sub(onemonth[msg.sender]) ; onemonth[msg.sender] = 0 ; onemonthCliff[msg.sender] = 0 ; } if(fourmonthCliff[msg.sender] < now){ fourVaultLimit = fourVaultLimit.add(fourmonth[msg.sender]); vaultTotal = vaultTotal.sub(fourmonth[msg.sender]) ; fourmonth[msg.sender] = 0 ; fourmonthCliff[msg.sender] = 0 ; } } function getOneReturn(address _user) view public returns ( uint ) { uint oneR = 0 ; if(onemonthCliff[_user] < now ){ oneR = onemonth[_user].add(onemonth[_user].mul(4200).div(1e4)); } return oneR ; } function getFourReturn(address _user) view public returns ( uint ) { uint fourR = 0 ; if(fourmonthCliff[_user] < now){ fourR = fourmonth[_user].add(fourmonth[_user].mul(24500).div(1e4)); } return fourR ; } function getTotalReturn(address _user) view public returns ( uint ) { uint oneR = 0 ; if(onemonthCliff[_user] < now ){ oneR = onemonth[_user].add(onemonth[_user].mul(4200).div(1e4)); } uint fourR = 0 ; if(fourmonthCliff[_user] < now){ fourR = fourmonth[_user].add(fourmonth[_user].mul(24500).div(1e4)); } uint total = oneR + fourR ; return total ; } function getClaimeReturn(address _user) view public returns ( uint ) { return claimed[_user]; } function updateCliff(uint one, uint four) public onlyOwner returns ( bool ) { oneCliff = one ; fourthCliff = four; return true; } function updateVaultClose(uint _vaultClose) public onlyOwner returns ( bool ) { vaultClose = _vaultClose; return true; } function withdrawToken(uint amount) public onlyOwner { require(Token(tokenAddress).transfer(msg.sender, amount), "Cannot withdraw balance!"); } function addContractBalance(uint amount) public { require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!"); } }
0x608060405234801561001057600080fd5b50600436106101725760003560e01c80639d76ea58116100de578063d5d6b7cf11610097578063f027019211610071578063f027019214610671578063f2fde38b1461068f578063f590bba1146106d3578063f9062d721461072b57610172565b8063d5d6b7cf146105a3578063e200281b146105fb578063ebce59811461061957610172565b80639d76ea58146103df5780639fcdb86214610413578063a814bf9b14610457578063c6c85f26146104af578063c884ef8314610507578063cef238d21461055f57610172565b8063452b4cfc11610130578063452b4cfc146102bb5780634651a86c146102e95780634e71d92d1461034157806350baa6221461035f5780638da5cb5b1461038d57806398d82f5a146103c157610172565b80622a01f7146101775780630116af1c1461019557806306697782146101ed5780630e71e6f91461023b578063251e43d01461025957806328c89e7e14610277575b600080fd5b61017f610783565b6040518082815260200191505060405180910390f35b6101d7600480360360208110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610789565b6040518082815260200191505060405180910390f35b6102236004803603604081101561020357600080fd5b8101908080359060200190929190803590602001909291905050506107d2565b60405180821515815260200191505060405180910390f35b610243610845565b6040518082815260200191505060405180910390f35b61026161084b565b6040518082815260200191505060405180910390f35b6102a36004803603602081101561028d57600080fd5b8101908080359060200190929190505050610851565b60405180821515815260200191505060405180910390f35b6102e7600480360360208110156102d157600080fd5b81019080803590602001909291905050506108bc565b005b61032b600480360360208110156102ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a0f565b6040518082815260200191505060405180910390f35b610349610a27565b6040518082815260200191505060405180910390f35b61038b6004803603602081101561037557600080fd5b8101908080359060200190929190505050610f5f565b005b6103956110ec565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103c9611110565b6040518082815260200191505060405180910390f35b6103e7611116565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61043f6004803603602081101561042957600080fd5b810190808035906020019092919050505061112e565b60405180821515815260200191505060405180910390f35b6104996004803603602081101561046d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a7565b6040518082815260200191505060405180910390f35b6104f1600480360360208110156104c557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114bf565b6040518082815260200191505060405180910390f35b6105496004803603602081101561051d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115d2565b6040518082815260200191505060405180910390f35b61058b6004803603602081101561057557600080fd5b81019080803590602001909291905050506115ea565b60405180821515815260200191505060405180910390f35b6105e5600480360360208110156105b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611963565b6040518082815260200191505060405180910390f35b61060361197b565b6040518082815260200191505060405180910390f35b61065b6004803603602081101561062f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611981565b6040518082815260200191505060405180910390f35b610679611a94565b6040518082815260200191505060405180910390f35b6106d1600480360360208110156106a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a9a565b005b610715600480360360208110156106e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be9565b6040518082815260200191505060405180910390f35b61076d6004803603602081101561074157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e0a565b6040518082815260200191505060405180910390f35b60055481565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461082d57600080fd5b82600481905550816005819055506001905092915050565b60035481565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ac57600080fd5b8160018190555060019050919050565b733539a4f4c0dffc813b75944821e380c9209d344673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561095f57600080fd5b505af1158015610973573d6000803e3d6000fd5b505050506040513d602081101561098957600080fd5b8101908080519060200190929190505050610a0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b50565b60086020528060005260406000206000915090505481565b600080610a3333611be9565b905060008111610aab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f43616e6e6f7420636c61696d2030206f72206c6573730000000000000000000081525060200191505060405180910390fd5b733539a4f4c0dffc813b75944821e380c9209d344673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b505050506040513d6020811015610b5a57600080fd5b8101908080519060200190929190505050503373ffffffffffffffffffffffffffffffffffffffff167fcf1581d5aa0e79e72e3e2216ffd9299a43cd32c702d3d56a6d694687d180fb73826040518082815260200191505060405180910390a2610c0c81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610dd557610cea600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600254611e2290919063ffffffff16565b600281905550610d44600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600654611e3e90919063ffffffff16565b6006819055506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b42600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610f5b57610e70600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600354611e2290919063ffffffff16565b600381905550610eca600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600654611e3e90919063ffffffff16565b6006819055506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fb757600080fd5b733539a4f4c0dffc813b75944821e380c9209d344673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561103c57600080fd5b505af1158015611050573d6000803e3d6000fd5b505050506040513d602081101561106657600080fd5b81019080805190602001909291905050506110e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f43616e6e6f742077697468647261772062616c616e636521000000000000000081525060200191505060405180910390fd5b50565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60025481565b733539a4f4c0dffc813b75944821e380c9209d344681565b60008061116c61115d61271061114f61015e87611e5590919063ffffffff16565b611e8490919063ffffffff16565b84611e3e90919063ffffffff16565b90508060035410156111e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f43616e2774206465706f736974206d6f7265207468616e206c696d697400000081525060200191505060405180910390fd5b426001541161125d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e2774206465706f736974206e6f7700000000000000000000000000000081525060200191505060405180910390fd5b733539a4f4c0dffc813b75944821e380c9209d344673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561130057600080fd5b505af1158015611314573d6000803e3d6000fd5b505050506040513d602081101561132a57600080fd5b81019080805190602001909291905050505061138e81600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113e681600654611e2290919063ffffffff16565b6006819055506005544201600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061144981600354611e3e90919063ffffffff16565b6003819055503373ffffffffffffffffffffffffffffffffffffffff167fa2a2db73af12c9f5bef6303364d44e78f97e992c353cd8659f3474c471427e9b826040518082815260200191505060405180910390a26001915050919050565b600a6020528060005260406000206000915090505481565b6000806000905042600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156115c9576115c661157861271061156a611068600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5590919063ffffffff16565b611e8490919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b90505b80915050919050565b60096020528060005260406000206000915090505481565b60008061162861161961271061160b61015e87611e5590919063ffffffff16565b611e8490919063ffffffff16565b84611e3e90919063ffffffff16565b90508060025410156116a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f43616e2774206465706f736974206d6f7265207468616e206c696d697400000081525060200191505060405180910390fd5b4260015411611719576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43616e2774206465706f736974206e6f7700000000000000000000000000000081525060200191505060405180910390fd5b733539a4f4c0dffc813b75944821e380c9209d344673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156117bc57600080fd5b505af11580156117d0573d6000803e3d6000fd5b505050506040513d60208110156117e657600080fd5b81019080805190602001909291905050505061184a81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a281600654611e2290919063ffffffff16565b6006819055506004544201600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061190581600254611e3e90919063ffffffff16565b6002819055503373ffffffffffffffffffffffffffffffffffffffff167fa2a2db73af12c9f5bef6303364d44e78f97e992c353cd8659f3474c471427e9b826040518082815260200191505060405180910390a26001915050919050565b60076020528060005260406000206000915090505481565b60065481565b6000806000905042600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611a8b57611a88611a3a612710611a2c615fb4600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5590919063ffffffff16565b611e8490919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b90505b80915050919050565b60045481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611af257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611b2c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000905042600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611cf357611cf0611ca2612710611c94611068600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5590919063ffffffff16565b611e8490919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b90505b600042600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611df857611df5611da7612710611d99615fb4600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e5590919063ffffffff16565b611e8490919063ffffffff16565b600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e2290919063ffffffff16565b90505b60008183019050809350505050919050565b600b6020528060005260406000206000915090505481565b600080828401905083811015611e3457fe5b8091505092915050565b600082821115611e4a57fe5b818303905092915050565b60008082840290506000841480611e74575082848281611e7157fe5b04145b611e7a57fe5b8091505092915050565b600080828481611e9057fe5b049050809150509291505056fea26469706673582212200c601de2ac475d894c98bf651e611cecdc9ca67129ab4f20b014e4a8d47734ee64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,647
0x7b423860118305a99597fbfcad8284c4c0436de9
/** *Submitted for verification at Etherscan.io on 2022-03-08 */ /* ______ _____ ______ _______ __ _ _____ __ _ _ _ | \ | | | ____ |______ | \ | | | \ | | | |_____/ |_____| |_____| |______ | \_| __|__ | \_| |_____| Telegram: https://t.me/dogeninu */ // 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 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; 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.add(walletBalance) <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint burnAmount = contractTokenBalance/4; contractTokenBalance -= burnAmount; burnToken(burnAmount); swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function burnToken(uint burnAmount) private lockTheSwap{ if(burnAmount > 0){ _transfer(address(this), address(0xdead),burnAmount); } } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 200000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 200000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 12) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 12) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610349578063c3c8cd8014610369578063c9567bf91461037e578063dbe8272c14610393578063dc1052e2146103b3578063dd62ed3e146103d357600080fd5b8063715018a6146102a65780638da5cb5b146102bb57806395d89b41146102e35780639e78fb4f14610314578063a9059cbb1461032957600080fd5b806323b872dd116100f257806323b872dd14610215578063273123b714610235578063313ce567146102555780636fc3eaec1461027157806370a082311461028657600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a057806318160ddd146101d05780631bbae6e0146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a6101553660046116c4565b610419565b005b34801561016857600080fd5b50604080518082019091526009815268444f47454e20494e5560b81b60208201525b60405161019791906116e1565b60405180910390f35b3480156101ac57600080fd5b506101c06101bb36600461175b565b61046a565b6040519015158152602001610197565b3480156101dc57600080fd5b50678ac7230489e800005b604051908152602001610197565b34801561020157600080fd5b5061015a610210366004611787565b610481565b34801561022157600080fd5b506101c06102303660046117a0565b6104c4565b34801561024157600080fd5b5061015a6102503660046117e1565b61052d565b34801561026157600080fd5b5060405160098152602001610197565b34801561027d57600080fd5b5061015a610578565b34801561029257600080fd5b506101e76102a13660046117e1565b6105ac565b3480156102b257600080fd5b5061015a6105ce565b3480156102c757600080fd5b506000546040516001600160a01b039091168152602001610197565b3480156102ef57600080fd5b50604080518082019091526008815267444f47454e494e5560c01b602082015261018a565b34801561032057600080fd5b5061015a610642565b34801561033557600080fd5b506101c061034436600461175b565b610854565b34801561035557600080fd5b5061015a610364366004611814565b610861565b34801561037557600080fd5b5061015a6108f7565b34801561038a57600080fd5b5061015a610937565b34801561039f57600080fd5b5061015a6103ae366004611787565b610ae0565b3480156103bf57600080fd5b5061015a6103ce366004611787565b610b18565b3480156103df57600080fd5b506101e76103ee3660046118d9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b0316331461044c5760405162461bcd60e51b815260040161044390611912565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000610477338484610b50565b5060015b92915050565b6000546001600160a01b031633146104ab5760405162461bcd60e51b815260040161044390611912565b6702c68af0bb1400008111156104c15760108190555b50565b60006104d1848484610c74565b610523843361051e85604051806060016040528060288152602001611ad8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fa9565b610b50565b5060019392505050565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161044390611912565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a25760405162461bcd60e51b815260040161044390611912565b476104c181610fe3565b6001600160a01b03811660009081526002602052604081205461047b9061101d565b6000546001600160a01b031633146105f85760405162461bcd60e51b815260040161044390611912565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461066c5760405162461bcd60e51b815260040161044390611912565b600f54600160a01b900460ff16156106c65760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610443565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561072b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190611947565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c09190611947565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561080d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108319190611947565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b6000610477338484610c74565b6000546001600160a01b0316331461088b5760405162461bcd60e51b815260040161044390611912565b60005b81518110156108f3576001600660008484815181106108af576108af611964565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108eb81611990565b91505061088e565b5050565b6000546001600160a01b031633146109215760405162461bcd60e51b815260040161044390611912565b600061092c306105ac565b90506104c1816110a1565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161044390611912565b600e546109819030906001600160a01b0316678ac7230489e80000610b50565b600e546001600160a01b031663f305d719473061099d816105ac565b6000806109b26000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a3f91906119ab565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610abc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c191906119d9565b6000546001600160a01b03163314610b0a5760405162461bcd60e51b815260040161044390611912565b600c8110156104c157600b55565b6000546001600160a01b03163314610b425760405162461bcd60e51b815260040161044390611912565b600c8110156104c157600c55565b6001600160a01b038316610bb25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610443565b6001600160a01b038216610c135760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610443565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610443565b6001600160a01b038216610d3a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610443565b60008111610d9c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610443565b6001600160a01b03831660009081526006602052604090205460ff1615610dc257600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e0457506001600160a01b03821660009081526005602052604090205460ff16155b15610f99576000600955600c54600a55600f546001600160a01b038481169116148015610e3f5750600e546001600160a01b03838116911614155b8015610e6457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e795750600f54600160b81b900460ff165b15610ea6576000610e89836105ac565b601054909150610e99838361121b565b1115610ea457600080fd5b505b600f546001600160a01b038381169116148015610ed15750600e546001600160a01b03848116911614155b8015610ef657506001600160a01b03831660009081526005602052604090205460ff16155b15610f07576000600955600b54600a555b6000610f12306105ac565b600f54909150600160a81b900460ff16158015610f3d5750600f546001600160a01b03858116911614155b8015610f525750600f54600160b01b900460ff165b15610f97576000610f646004836119f6565b9050610f708183611a18565b9150610f7b8161127a565b610f84826110a1565b478015610f9457610f9447610fe3565b50505b505b610fa48383836112b0565b505050565b60008184841115610fcd5760405162461bcd60e51b815260040161044391906116e1565b506000610fda8486611a18565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f3573d6000803e3d6000fd5b60006007548211156110845760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610443565b600061108e6112bb565b905061109a83826112de565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110e9576110e9611964565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611142573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111669190611947565b8160018151811061117957611179611964565b6001600160a01b039283166020918202929092010152600e5461119f9130911684610b50565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111d8908590600090869030904290600401611a2f565b600060405180830381600087803b1580156111f257600080fd5b505af1158015611206573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000806112288385611aa0565b90508381101561109a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610443565b600f805460ff60a81b1916600160a81b17905580156112a0576112a03061dead83610c74565b50600f805460ff60a81b19169055565b610fa4838383611320565b60008060006112c8611417565b90925090506112d782826112de565b9250505090565b600061109a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611457565b60008060008060008061133287611485565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061136490876114e2565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611393908661121b565b6001600160a01b0389166000908152600260205260409020556113b581611524565b6113bf848361156e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161140491815260200190565b60405180910390a3505050505050505050565b6007546000908190678ac7230489e8000061143282826112de565b82101561144e57505060075492678ac7230489e8000092509050565b90939092509050565b600081836114785760405162461bcd60e51b815260040161044391906116e1565b506000610fda84866119f6565b60008060008060008060008060006114a28a600954600a54611592565b92509250925060006114b26112bb565b905060008060006114c58e8787876115e7565b919e509c509a509598509396509194505050505091939550919395565b600061109a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fa9565b600061152e6112bb565b9050600061153c8383611637565b30600090815260026020526040902054909150611559908261121b565b30600090815260026020526040902055505050565b60075461157b90836114e2565b60075560085461158b908261121b565b6008555050565b60008080806115ac60646115a68989611637565b906112de565b905060006115bf60646115a68a89611637565b905060006115d7826115d18b866114e2565b906114e2565b9992985090965090945050505050565b60008080806115f68886611637565b905060006116048887611637565b905060006116128888611637565b90506000611624826115d186866114e2565b939b939a50919850919650505050505050565b6000826116465750600061047b565b60006116528385611ab8565b90508261165f85836119f6565b1461109a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610443565b80151581146104c157600080fd5b6000602082840312156116d657600080fd5b813561109a816116b6565b600060208083528351808285015260005b8181101561170e578581018301518582016040015282016116f2565b81811115611720576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104c157600080fd5b803561175681611736565b919050565b6000806040838503121561176e57600080fd5b823561177981611736565b946020939093013593505050565b60006020828403121561179957600080fd5b5035919050565b6000806000606084860312156117b557600080fd5b83356117c081611736565b925060208401356117d081611736565b929592945050506040919091013590565b6000602082840312156117f357600080fd5b813561109a81611736565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561182757600080fd5b823567ffffffffffffffff8082111561183f57600080fd5b818501915085601f83011261185357600080fd5b813581811115611865576118656117fe565b8060051b604051601f19603f8301168101818110858211171561188a5761188a6117fe565b6040529182528482019250838101850191888311156118a857600080fd5b938501935b828510156118cd576118be8561174b565b845293850193928501926118ad565b98975050505050505050565b600080604083850312156118ec57600080fd5b82356118f781611736565b9150602083013561190781611736565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561195957600080fd5b815161109a81611736565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119a4576119a461197a565b5060010190565b6000806000606084860312156119c057600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119eb57600080fd5b815161109a816116b6565b600082611a1357634e487b7160e01b600052601260045260246000fd5b500490565b600082821015611a2a57611a2a61197a565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a7f5784516001600160a01b031683529383019391830191600101611a5a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611ab357611ab361197a565b500190565b6000816000190483118215151615611ad257611ad261197a565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b0b835bd074e732aea1d84c6e861cf8831ac104c677c626c939887f982ef712664736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,648
0x86646a5A1B82790146bfa82A3891733491241B46
// Dogus Inu ($DOGUS) //Telegram: https://t.me/dogusinutoken /* ,---, ,---, .' .' `\ ,`--.' | ,---.' \ ,---. ,--, | : : ,---, ,--, | | .`\ | ' ,'\ ,----._,. ,'_ /| .--.--. : | ' ,-+-. / | ,'_ /| : : | ' | / / | / / ' / .--. | | : / / ' | : | ,--.'|' | .--. | | : | ' ' ; :. ; ,. :| : |,'_ /| : . | | : /`./ ' ' ;| | ,"' |,'_ /| : . | ' | ; . |' | |: :| | .\ .| ' | | . . | : ;_ | | || | / | || ' | | . . | | : | '' | .; :. ; '; || | ' | | | \ \ `. ' : ;| | | | || | ' | | | ' : | / ; | : |' . . |: | : ; ; | `----. \ | | '| | | |/ : | : ; ; | | | '` ,/ \ \ / `---`-'| |' : `--' \ / /`--' / ' : || | |--' ' : `--' \ ; : .' `----' .'__/\_: |: , .-./'--'. / ; |.' | |/ : , .-./ | ,.' | : : `--`----' `--'---' '---' '---' `--`----' '---' \ \ / `--`-' */ // 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 DogusInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Dogus Inu"; string private constant _symbol = "DOGUS"; 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 = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.mul(6).div(10)); _marketingFunds.transfer(amount.mul(4).div(10)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 4000000000 * 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); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb14610305578063c3c8cd8014610325578063d543dbeb1461033a578063dd62ed3e1461035a57600080fd5b80636fc3eaec1461026557806370a082311461027a578063715018a61461029a5780638da5cb5b146102af57600080fd5b806323b872dd116100dc57806323b872dd146101d4578063293230b8146101f4578063313ce567146102095780635932ead1146102255780636b9990531461024557600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017e57806318160ddd146101ae57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118b4565b6103a0565b005b34801561014657600080fd5b50604080518082019091526009815268446f67757320496e7560b81b60208201525b60405161017591906119f8565b60405180910390f35b34801561018a57600080fd5b5061019e610199366004611889565b61044d565b6040519015158152602001610175565b3480156101ba57600080fd5b50683635c9adc5dea000005b604051908152602001610175565b3480156101e057600080fd5b5061019e6101ef366004611849565b610464565b34801561020057600080fd5b506101386104cd565b34801561021557600080fd5b5060405160098152602001610175565b34801561023157600080fd5b5061013861024036600461197b565b610890565b34801561025157600080fd5b506101386102603660046117d9565b6108d8565b34801561027157600080fd5b50610138610923565b34801561028657600080fd5b506101c66102953660046117d9565b610950565b3480156102a657600080fd5b50610138610972565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610175565b3480156102e357600080fd5b50604080518082019091526005815264444f47555360d81b6020820152610168565b34801561031157600080fd5b5061019e610320366004611889565b6109e6565b34801561033157600080fd5b506101386109f3565b34801561034657600080fd5b506101386103553660046119b3565b610a29565b34801561036657600080fd5b506101c6610375366004611811565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d35760405162461bcd60e51b81526004016103ca90611a4b565b60405180910390fd5b60005b8151811015610449576001600a600084848151811061040557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044181611b5e565b9150506103d6565b5050565b600061045a338484610afc565b5060015b92915050565b6000610471848484610c20565b6104c384336104be85604051806060016040528060288152602001611bc9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611032565b610afc565b5060019392505050565b6000546001600160a01b031633146104f75760405162461bcd60e51b81526004016103ca90611a4b565b600f54600160a01b900460ff16156105515760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103ca565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058e3082683635c9adc5dea00000610afc565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff91906117f5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f91906117f5565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c757600080fd5b505af11580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906117f5565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072f81610950565b6000806107446000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a757600080fd5b505af11580156107bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e091906119cb565b5050600f8054673782dace9d90000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085857600080fd5b505af115801561086c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104499190611997565b6000546001600160a01b031633146108ba5760405162461bcd60e51b81526004016103ca90611a4b565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016103ca90611a4b565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094357600080fd5b4761094d8161106c565b50565b6001600160a01b03811660009081526002602052604081205461045e906110fb565b6000546001600160a01b0316331461099c5760405162461bcd60e51b81526004016103ca90611a4b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045a338484610c20565b600c546001600160a01b0316336001600160a01b031614610a1357600080fd5b6000610a1e30610950565b905061094d8161117f565b6000546001600160a01b03163314610a535760405162461bcd60e51b81526004016103ca90611a4b565b60008111610aa35760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103ca565b610ac16064610abb683635c9adc5dea0000084611324565b906113a3565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ca565b6001600160a01b038216610bbf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ca565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c845760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ca565b6001600160a01b038216610ce65760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ca565b60008111610d485760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ca565b6000546001600160a01b03848116911614801590610d7457506000546001600160a01b03838116911614155b15610fd557600f54600160b81b900460ff1615610e5b576001600160a01b0383163014801590610dad57506001600160a01b0382163014155b8015610dc75750600e546001600160a01b03848116911614155b8015610de15750600e546001600160a01b03838116911614155b15610e5b57600e546001600160a01b0316336001600160a01b03161480610e1b5750600f546001600160a01b0316336001600160a01b0316145b610e5b5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103ca565b601054811115610e6a57600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eac57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb557600080fd5b600f546001600160a01b038481169116148015610ee05750600e546001600160a01b03838116911614155b8015610f0557506001600160a01b03821660009081526005602052604090205460ff16155b8015610f1a5750600f54600160b81b900460ff165b15610f68576001600160a01b0382166000908152600b60205260409020544211610f4357600080fd5b610f4e42600a611af0565b6001600160a01b0383166000908152600b60205260409020555b6000610f7330610950565b600f54909150600160a81b900460ff16158015610f9e5750600f546001600160a01b03858116911614155b8015610fb35750600f54600160b01b900460ff165b15610fd357610fc18161117f565b478015610fd157610fd14761106c565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101757506001600160a01b03831660009081526005602052604090205460ff165b15611020575060005b61102c848484846113e5565b50505050565b600081848411156110565760405162461bcd60e51b81526004016103ca91906119f8565b5060006110638486611b47565b95945050505050565b600c546001600160a01b03166108fc61108b600a610abb856006611324565b6040518115909202916000818181858888f193505050501580156110b3573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d3600a610abb856004611324565b6040518115909202916000818181858888f19350505050158015610449573d6000803e3d6000fd5b60006006548211156111625760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ca565b600061116c611411565b905061117883826113a3565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122957600080fd5b505afa15801561123d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126191906117f5565b8160018151811061128257634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a89130911684610afc565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e1908590600090869030904290600401611a80565b600060405180830381600087803b1580156112fb57600080fd5b505af115801561130f573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113335750600061045e565b600061133f8385611b28565b90508261134c8583611b08565b146111785760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ca565b600061117883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611434565b806113f2576113f2611462565b6113fd848484611485565b8061102c5761102c6005600855600a600955565b600080600061141e61157c565b909250905061142d82826113a3565b9250505090565b600081836114555760405162461bcd60e51b81526004016103ca91906119f8565b5060006110638486611b08565b6008541580156114725750600954155b1561147957565b60006008819055600955565b600080600080600080611497876115be565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c9908761161b565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f8908661165d565b6001600160a01b03891660009081526002602052604090205561151a816116bc565b6115248483611706565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156991815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061159882826113a3565b8210156115b557505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115db8a60085460095461172a565b92509250925060006115eb611411565b905060008060006115fe8e878787611779565b919e509c509a509598509396509194505050505091939550919395565b600061117883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611032565b60008061166a8385611af0565b9050838110156111785760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ca565b60006116c6611411565b905060006116d48383611324565b306000908152600260205260409020549091506116f1908261165d565b30600090815260026020526040902055505050565b600654611713908361161b565b600655600754611723908261165d565b6007555050565b600080808061173e6064610abb8989611324565b905060006117516064610abb8a89611324565b90506000611769826117638b8661161b565b9061161b565b9992985090965090945050505050565b60008080806117888886611324565b905060006117968887611324565b905060006117a48888611324565b905060006117b682611763868661161b565b939b939a50919850919650505050505050565b80356117d481611ba5565b919050565b6000602082840312156117ea578081fd5b813561117881611ba5565b600060208284031215611806578081fd5b815161117881611ba5565b60008060408385031215611823578081fd5b823561182e81611ba5565b9150602083013561183e81611ba5565b809150509250929050565b60008060006060848603121561185d578081fd5b833561186881611ba5565b9250602084013561187881611ba5565b929592945050506040919091013590565b6000806040838503121561189b578182fd5b82356118a681611ba5565b946020939093013593505050565b600060208083850312156118c6578182fd5b823567ffffffffffffffff808211156118dd578384fd5b818501915085601f8301126118f0578384fd5b81358181111561190257611902611b8f565b8060051b604051601f19603f8301168101818110858211171561192757611927611b8f565b604052828152858101935084860182860187018a1015611945578788fd5b8795505b8386101561196e5761195a816117c9565b855260019590950194938601938601611949565b5098975050505050505050565b60006020828403121561198c578081fd5b813561117881611bba565b6000602082840312156119a8578081fd5b815161117881611bba565b6000602082840312156119c4578081fd5b5035919050565b6000806000606084860312156119df578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2457858101830151858201604001528201611a08565b81811115611a355783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611acf5784516001600160a01b031683529383019391830191600101611aaa565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0357611b03611b79565b500190565b600082611b2357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4257611b42611b79565b500290565b600082821015611b5957611b59611b79565b500390565b6000600019821415611b7257611b72611b79565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094d57600080fd5b801515811461094d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122063d1a8c7e1a08a7e7daf2d05f18db8ad1d4633821467c5fd254ed379d205d58c64736f6c63430008040033
{"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"}]}}
6,649
0xd2d0f85b690604c245f61513bf4679b24ed64c35
pragma solidity ^0.4.18; contract SafeMath { function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a + b; assert(c >= a); return c; } function safeSub(uint256 a, uint256 b) internal pure returns(uint256) { assert(b <= a); return a - b; } function safeMul(uint256 a, uint256 b) internal pure returns(uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a / b; return c; } } contract EIP20Interface { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) public view returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) public view returns (uint256 remaining); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract BFDToken is EIP20Interface, SafeMath { uint256 constant private MAX_UINT256 = 2**256 - 1; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowed; /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might not even bother to look at this information. */ string constant public name = "BFDToken"; uint8 constant public decimals = 18; //How many decimals to show. string constant public symbol = "BFDT"; mapping (address => uint256) public addressType; // 1 for team; 2 for advisors and partners; 3 for seed investors; 4 for angel investors; 5 for regular investors; 0 for others mapping (address => uint256[3]) public releaseForSeed; mapping (address => uint256[5]) public releaseForTeamAndAdvisor; event AllocateToken(address indexed _to, uint256 _value, uint256 _type); address public owner; uint256 public finaliseTime; function BFDToken() public { totalSupply = 20*10**26; // Update total supply balances[msg.sender] = totalSupply; // Give the creator all initial tokens owner = msg.sender; } modifier isOwner() { require(msg.sender == owner); _; } modifier notFinalised() { require(finaliseTime == 0); _; } // function allocateToken(address _to, uint256 _eth, uint256 _type) isOwner notFinalised public { require(_to != address(0x0) && _eth != 0); require(addressType[_to] == 0 || addressType[_to] == _type); addressType[_to] = _type; uint256 temp; if (_type == 3) { temp = safeMul(_eth, 60000 * 10**18); balances[_to] = safeAdd(balances[_to], temp); balances[msg.sender] = safeSub(balances[msg.sender], temp); releaseForSeed[_to][0] = safeDiv(safeMul(balances[_to], 60), 100); releaseForSeed[_to][1] = safeDiv(safeMul(balances[_to], 30), 100); releaseForSeed[_to][2] = 0; AllocateToken(_to, temp, 3); } else if (_type == 4) { temp = safeMul(_eth, 20000 * 10**18); balances[_to] = safeAdd(balances[_to], temp); balances[msg.sender] = safeSub(balances[msg.sender], temp); releaseForSeed[_to][0] = safeDiv(safeMul(balances[_to], 60), 100); releaseForSeed[_to][1] = safeDiv(safeMul(balances[_to], 30), 100); releaseForSeed[_to][2] = 0; AllocateToken(_to, temp, 4); } else if (_type == 5) { temp = safeMul(_eth, 12000 * 10**18); balances[_to] = safeAdd(balances[_to], temp); balances[msg.sender] = safeSub(balances[msg.sender], temp); AllocateToken(_to, temp, 5); } else { revert(); } } function allocateTokenForTeam(address _to, uint256 _value) isOwner notFinalised public { require(addressType[_to] == 0 || addressType[_to] == 1); addressType[_to] = 1; balances[_to] = safeAdd(balances[_to], safeMul(_value, 10**18)); balances[msg.sender] = safeSub(balances[msg.sender], safeMul(_value, 10**18)); for (uint256 i = 0; i <= 4; ++i) { releaseForTeamAndAdvisor[_to][i] = safeDiv(safeMul(balances[_to], (4 - i) * 25), 100); } AllocateToken(_to, safeMul(_value, 10**18), 1); } function allocateTokenForAdvisor(address _to, uint256 _value) isOwner public { require(addressType[_to] == 0 || addressType[_to] == 2); addressType[_to] = 2; balances[_to] = safeAdd(balances[_to], safeMul(_value, 10**18)); balances[msg.sender] = safeSub(balances[msg.sender], safeMul(_value, 10**18)); for (uint256 i = 0; i <= 4; ++i) { releaseForTeamAndAdvisor[_to][i] = safeDiv(safeMul(balances[_to], (4 - i) * 25), 100); } AllocateToken(_to, safeMul(_value, 10**18), 2); } function changeOwner(address _owner) isOwner public { owner = _owner; } function setFinaliseTime() isOwner public { require(finaliseTime == 0); finaliseTime = now; } function transfer(address _to, uint256 _value) public returns (bool success) { require(canTransfer(msg.sender, _value)); require(balances[msg.sender] >= _value); balances[msg.sender] -= _value; balances[_to] += _value; Transfer(msg.sender, _to, _value); return true; } function canTransfer(address _from, uint256 _value) internal view returns (bool success) { require(finaliseTime != 0); uint256 index; if (addressType[_from] == 0 || addressType[_from] == 5) { return true; } // for seed and angel investors if (addressType[_from] == 3 || addressType[_from] == 4) { index = safeSub(now, finaliseTime) / 60 days; if ( index >= 2) { index = 2; } require(safeSub(balances[_from], _value) >= releaseForSeed[_from][index]); } else if (addressType[_from] == 1 || addressType[_from] == 2) { index = safeSub(now, finaliseTime) / 180 days; if (index >= 4) { index = 4; } require(safeSub(balances[_from], _value) >= releaseForTeamAndAdvisor[_from][index]); } return true; } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(canTransfer(_from, _value)); uint256 allowance = allowed[_from][msg.sender]; require(balances[_from] >= _value && allowance >= _value); balances[_to] += _value; balances[_from] -= _value; if (allowance < MAX_UINT256) { allowed[_from][msg.sender] -= _value; } Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e157806323b872dd1461020657806327e235e31461022e578063313ce5671461024d5780633eb51dc4146102765780635c65816514610298578063651398e6146102bd578063678f4467146102e157806370a08231146103035780638da5cb5b1461032257806395d89b411461035157806399ddb29b14610364578063a6f9dae114610383578063a7638346146103a2578063a9059cbb146103b5578063b556188e146103d7578063cb4360d9146103ea578063cf424b161461040f578063dd62ed3e14610431575b600080fd5b341561012c57600080fd5b610134610456565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a036004351660243561048d565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101f46104f9565b60405190815260200160405180910390f35b341561021157600080fd5b6101cd600160a060020a03600435811690602435166044356104ff565b341561023957600080fd5b6101f4600160a060020a036004351661061f565b341561025857600080fd5b610260610631565b60405160ff909116815260200160405180910390f35b341561028157600080fd5b6101f4600160a060020a0360043516602435610636565b34156102a357600080fd5b6101f4600160a060020a036004358116906024351661065a565b34156102c857600080fd5b6102df600160a060020a0360043516602435610677565b005b34156102ec57600080fd5b6102df600160a060020a0360043516602435610835565b341561030e57600080fd5b6101f4600160a060020a03600435166109ef565b341561032d57600080fd5b610335610a0a565b604051600160a060020a03909116815260200160405180910390f35b341561035c57600080fd5b610134610a19565b341561036f57600080fd5b6101f4600160a060020a0360043516610a50565b341561038e57600080fd5b6102df600160a060020a0360043516610a62565b34156103ad57600080fd5b6102df610aac565b34156103c057600080fd5b6101cd600160a060020a0360043516602435610ada565b34156103e257600080fd5b6101f4610b85565b34156103f557600080fd5b6102df600160a060020a0360043516602435604435610b8b565b341561041a57600080fd5b6101f4600160a060020a0360043516602435610f78565b341561043c57600080fd5b6101f4600160a060020a0360043581169060243516610f91565b60408051908101604052600881527f424644546f6b656e000000000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b60008061050c8584610fbc565b151561051757600080fd5b50600160a060020a0380851660008181526002602090815260408083203390951683529381528382205492825260019052919091205483901080159061055d5750828110155b151561056857600080fd5b600160a060020a03808516600090815260016020526040808220805487019055918716815220805484900390556000198110156105cd57600160a060020a03808616600090815260026020908152604080832033909416835292905220805484900390555b83600160a060020a031685600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405190815260200160405180910390a3506001949350505050565b60016020526000908152604090205481565b601281565b60056020528160005260406000208160058110151561065157fe5b01549150829050565b600260209081526000928352604080842090915290825290205481565b60065460009033600160a060020a0390811691161461069557600080fd5b600160a060020a03831660009081526003602052604090205415806106d25750600160a060020a0383166000908152600360205260409020546002145b15156106dd57600080fd5b600160a060020a038316600090815260036020908152604080832060029055600190915290205461071f9061071a84670de0b6b3a76400006111ad565b6111df565b600160a060020a038085166000908152600160205260408082209390935533909116815220546107609061075b84670de0b6b3a76400006111ad565b6111ee565b600160a060020a03331660009081526001602052604081209190915590505b600481116107ec57600160a060020a0383166000908152600160205260409020546107bc906107b59060196004859003026111ad565b6064611200565b600160a060020a038416600090815260056020819052604090912090839081106107e257fe5b015560010161077f565b82600160a060020a031660008051602061121883398151915261081784670de0b6b3a76400006111ad565b600260405191825260208201526040908101905180910390a2505050565b60065460009033600160a060020a0390811691161461085357600080fd5b6007541561086057600080fd5b600160a060020a038316600090815260036020526040902054158061089d5750600160a060020a0383166000908152600360205260409020546001145b15156108a857600080fd5b600160a060020a03831660009081526003602090815260408083206001908190559091529020546108e59061071a84670de0b6b3a76400006111ad565b600160a060020a038085166000908152600160205260408082209390935533909116815220546109219061075b84670de0b6b3a76400006111ad565b600160a060020a03331660009081526001602052604081209190915590505b600481116109a657600160a060020a038316600090815260016020526040902054610976906107b59060196004859003026111ad565b600160a060020a0384166000908152600560208190526040909120908390811061099c57fe5b0155600101610940565b82600160a060020a03166000805160206112188339815191526109d184670de0b6b3a76400006111ad565b600160405191825260208201526040908101905180910390a2505050565b600160a060020a031660009081526001602052604090205490565b600654600160a060020a031681565b60408051908101604052600481527f4246445400000000000000000000000000000000000000000000000000000000602082015281565b60036020526000908152604090205481565b60065433600160a060020a03908116911614610a7d57600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60065433600160a060020a03908116911614610ac757600080fd5b60075415610ad457600080fd5b42600755565b6000610ae63383610fbc565b1515610af157600080fd5b600160a060020a03331660009081526001602052604090205482901015610b1757600080fd5b600160a060020a033381166000818152600160205260408082208054879003905592861680825290839020805486019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60075481565b60065460009033600160a060020a03908116911614610ba957600080fd5b60075415610bb657600080fd5b600160a060020a03841615801590610bcd57508215155b1515610bd857600080fd5b600160a060020a0384166000908152600360205260409020541580610c145750600160a060020a03841660009081526003602052604090205482145b1515610c1f57600080fd5b600160a060020a0384166000908152600360208190526040909120839055821415610d6d57610c5883690cb49b44ba602d8000006111ad565b600160a060020a038516600090815260016020526040902054909150610c7e90826111df565b600160a060020a03808616600090815260016020526040808220939093553390911681522054610cae90826111ee565b600160a060020a033381166000908152600160205260408082209390935590861681522054610ce2906107b590603c6111ad565b600160a060020a038516600090815260046020908152604080832093909355600190522054610d16906107b590601e6111ad565b600160a060020a0385166000818152600460205260408082206001810194909455600290930155906000805160206112188339815191529083906003905191825260208201526040908101905180910390a2610f72565b8160041415610ea257610d8a8369043c33c19375648000006111ad565b600160a060020a038516600090815260016020526040902054909150610db090826111df565b600160a060020a03808616600090815260016020526040808220939093553390911681522054610de090826111ee565b600160a060020a033381166000908152600160205260408082209390935590861681522054610e14906107b590603c6111ad565b600160a060020a038516600090815260046020908152604080832093909355600190522054610e48906107b590601e6111ad565b600160a060020a0385166000818152600460208190526040808320600181019590955560029094019190915590916000805160206112188339815191529184915191825260208201526040908101905180910390a2610f72565b816005141561011c57610ebf8369028a857425466f8000006111ad565b600160a060020a038516600090815260016020526040902054909150610ee590826111df565b600160a060020a03808616600090815260016020526040808220939093553390911681522054610f1590826111ee565b6001600033600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031660008051602061121883398151915282600560405191825260208201526040908101905180910390a25b50505050565b6004602052600082815260409020816003811061065157fe5b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60075460009081901515610fcf57600080fd5b600160a060020a038416600090815260036020526040902054158061100c5750600160a060020a0384166000908152600360205260409020546005145b1561101a57600191506111a6565b600160a060020a038416600090815260036020819052604090912054148061105a5750600160a060020a0384166000908152600360205260409020546004145b156110df57624f1a0061106f426007546111ee565b81151561107857fe5b04905060028110611087575060025b600160a060020a038416600090815260046020526040902081600381106110aa57fe5b0154600160a060020a0385166000908152600160205260409020546110cf90856111ee565b10156110da57600080fd5b6111a1565b600160a060020a0384166000908152600360205260409020546001148061111e5750600160a060020a0384166000908152600360205260409020546002145b156111a15762ed4e00611133426007546111ee565b81151561113c57fe5b0490506004811061114b575060045b600160a060020a0384166000908152600560208190526040909120908290811061117157fe5b0154600160a060020a03851660009081526001602052604090205461119690856111ee565b10156111a157600080fd5b600191505b5092915050565b6000808315156111c057600091506111a6565b508282028284828115156111d057fe5b04146111d857fe5b9392505050565b6000828201838110156111d857fe5b6000828211156111fa57fe5b50900390565b600080828481151561120e57fe5b04949350505050560019bb5c1c92902fad2fe46ff67b8be1838722fbaea86ddb08d8ac64073190de65a165627a7a72305820714196b6041bac21dbdfe18bf6c7cfcdc9e06929c02b6f4fb784219de1f489680029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
6,650
0x1E5D8EE8fb7f0d791475c59391DB8f6CD06Aa656
/** *Submitted for verification at Etherscan.io on 2021-12-30 */ // File: contracts/lib/InitializableOwnable.sol /* Copyright 2021 DODO ZOO. SPDX-License-Identifier: Apache-2.0 */ pragma solidity 0.6.9; pragma experimental ABIEncoderV2; /** * @title Ownable * @author DODO Breeder * * @notice Ownership related functions */ contract InitializableOwnable { address public _OWNER_; address public _NEW_OWNER_; bool internal _INITIALIZED_; // ============ Events ============ event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // ============ Modifiers ============ modifier notInitialized() { require(!_INITIALIZED_, "DODO_INITIALIZED"); _; } modifier onlyOwner() { require(msg.sender == _OWNER_, "NOT_OWNER"); _; } // ============ Functions ============ function initOwner(address newOwner) public notInitialized { _INITIALIZED_ = true; _OWNER_ = newOwner; } function transferOwnership(address newOwner) public onlyOwner { emit OwnershipTransferPrepared(_OWNER_, newOwner); _NEW_OWNER_ = newOwner; } function claimOwnership() public { require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM"); emit OwnershipTransferred(_OWNER_, _NEW_OWNER_); _OWNER_ = _NEW_OWNER_; _NEW_OWNER_ = address(0); } } // File: contracts/lib/CloneFactory.sol interface ICloneFactory { function clone(address prototype) external returns (address proxy); } // introduction of proxy mode design: https://docs.openzeppelin.com/upgrades/2.8/ // minimum implementation of transparent proxy: https://eips.ethereum.org/EIPS/eip-1167 contract CloneFactory is ICloneFactory { function clone(address prototype) external override returns (address proxy) { bytes20 targetBytes = bytes20(prototype); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore( add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000 ) proxy := create(0, clone, 0x37) } return proxy; } } // File: contracts/CrowdPooling/intf/ICP.sol interface ICP { function init( address[] calldata addressList, uint256[] calldata timeLine, uint256[] calldata valueList, bool[] calldata switches ) external; function bid(address to) external; function cancel(address assetTo, uint256 amount) external; function settle() external; function emergencySettle() external; function claimLPToken() external; } // File: contracts/lib/SafeMath.sol /** * @title SafeMath * @author DODO Breeder * * @notice Math operations with safety checks that revert on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "MUL_ERROR"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "DIVIDING_ERROR"); return a / b; } function divCeil(uint256 a, uint256 b) internal pure returns (uint256) { uint256 quotient = div(a, b); uint256 remainder = a - quotient * b; if (remainder > 0) { return quotient + 1; } else { return quotient; } } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SUB_ERROR"); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "ADD_ERROR"); return c; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = x / 2 + 1; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } // File: contracts/intf/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); } // File: contracts/lib/DecimalMath.sol /** * @title DecimalMath * @author DODO Breeder * * @notice Functions for fixed point number with 18 decimals */ library DecimalMath { using SafeMath for uint256; uint256 internal constant ONE = 10**18; uint256 internal constant ONE2 = 10**36; function mulFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d) / (10**18); } function mulCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(d).divCeil(10**18); } function divFloor(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).div(d); } function divCeil(uint256 target, uint256 d) internal pure returns (uint256) { return target.mul(10**18).divCeil(d); } function reciprocalFloor(uint256 target) internal pure returns (uint256) { return uint256(10**36).div(target); } function reciprocalCeil(uint256 target) internal pure returns (uint256) { return uint256(10**36).divCeil(target); } function powFloor(uint256 target, uint256 e) internal pure returns (uint256) { if (e == 0) { return 10 ** 18; } else if (e == 1) { return target; } else { uint p = powFloor(target, e.div(2)); p = p.mul(p) / (10**18); if (e % 2 == 1) { p = p.mul(target) / (10**18); } return p; } } } // File: contracts/Factory/CrowdPoolingFactory.sol /** * @title CrowdPoolingFacotry * @author DODO Breeder * * @notice Create And Register CP Pools */ contract CrowdPoolingFactory is InitializableOwnable { using SafeMath for uint256; // ============ Templates ============ address public immutable _CLONE_FACTORY_; address public immutable _DVM_FACTORY_; address public immutable _DEFAULT_MT_FEE_RATE_MODEL_; address public immutable _DEFAULT_PERMISSION_MANAGER_; address public _CP_TEMPLATE_; address public _DEFAULT_MAINTAINER_; // ============ Settings ============= uint256 public _CAP_RATIO_ = 50; uint256 public _FREEZE_DURATION_ = 30 days; uint256 public _CALM_DURATION_ = 0; uint256 public _VEST_DURATION_ = 0; uint256 public _K_ = 0; uint256 public _CLIFF_RATE_ = 10**18; // ============ Registry ============ // base -> quote -> CP address list mapping(address => mapping(address => address[])) public _REGISTRY_; // creator -> CP address list mapping(address => address[]) public _USER_REGISTRY_; // ============ modifiers =========== modifier valueCheck( address cpAddress, address baseToken, uint256[] memory timeLine, uint256[] memory valueList) { require(timeLine[2] == _CALM_DURATION_, "CP_FACTORY : PHASE_CALM_DURATION_INVALID"); require(timeLine[4] == _VEST_DURATION_, "CP_FACTORY : VEST_DURATION_INVALID"); require(valueList[1] == _K_, "CP_FACTORY : K_INVALID"); require(valueList[3] == _CLIFF_RATE_, "CP_FACTORY : CLIFF_RATE_INVALID"); uint256 baseTokenBalance = IERC20(baseToken).balanceOf(cpAddress); require(valueList[0].mul(100) <= baseTokenBalance.mul(valueList[2]).div(10**18).mul(_CAP_RATIO_),"CP_FACTORY : QUOTE_CAP_INVALID"); require(timeLine[3]>= _FREEZE_DURATION_, "CP_FACTORY : FREEZE_DURATION_INVALID"); _; } // ============ Events ============ event NewCP( address baseToken, address quoteToken, address creator, address cp ); event RemoveCP(address cp); constructor( address cloneFactory, address cpTemplate, address dvmFactory, address defaultMaintainer, address defaultMtFeeRateModel, address defaultPermissionManager ) public { _CLONE_FACTORY_ = cloneFactory; _CP_TEMPLATE_ = cpTemplate; _DVM_FACTORY_ = dvmFactory; _DEFAULT_MAINTAINER_ = defaultMaintainer; _DEFAULT_MT_FEE_RATE_MODEL_ = defaultMtFeeRateModel; _DEFAULT_PERMISSION_MANAGER_ = defaultPermissionManager; } // ============ Functions ============ function createCrowdPooling() external returns (address newCrowdPooling) { newCrowdPooling = ICloneFactory(_CLONE_FACTORY_).clone(_CP_TEMPLATE_); } function initCrowdPooling( address cpAddress, address creator, address[] memory tokens,//0 baseToken 1 quoteToken uint256[] memory timeLine, uint256[] memory valueList, bool[] memory switches ) external valueCheck(cpAddress,tokens[0],timeLine,valueList) { { address[] memory addressList = new address[](7); addressList[0] = creator; addressList[1] = _DEFAULT_MAINTAINER_; addressList[2] = tokens[0]; addressList[3] = tokens[1]; addressList[4] = _DEFAULT_PERMISSION_MANAGER_; addressList[5] = _DEFAULT_MT_FEE_RATE_MODEL_; addressList[6] = _DVM_FACTORY_; ICP(cpAddress).init( addressList, timeLine, valueList, switches ); } _REGISTRY_[tokens[0]][tokens[1]].push(cpAddress); _USER_REGISTRY_[creator].push(cpAddress); emit NewCP(tokens[0], tokens[1], creator, cpAddress); } // ============ View Functions ============ function getCrowdPooling(address baseToken, address quoteToken) external view returns (address[] memory pools) { return _REGISTRY_[baseToken][quoteToken]; } function getCrowdPoolingBidirection(address token0, address token1) external view returns (address[] memory baseToken0Pools, address[] memory baseToken1Pools) { return (_REGISTRY_[token0][token1], _REGISTRY_[token1][token0]); } function getCrowdPoolingByUser(address user) external view returns (address[] memory pools) { return _USER_REGISTRY_[user]; } // ============ Owner Functions ============ function updateCPTemplate(address _newCPTemplate) external onlyOwner { _CP_TEMPLATE_ = _newCPTemplate; } function updateDefaultMaintainer(address _newMaintainer) external onlyOwner { _DEFAULT_MAINTAINER_ = _newMaintainer; } function setCapRatio(uint256 _newCapRatio) public onlyOwner { require(_newCapRatio > 0 && _newCapRatio <= 100, "CP_FACTORY : INVALID"); _CAP_RATIO_ = _newCapRatio; } function setFreezeDuration(uint256 _newFreeDuration) public onlyOwner { _FREEZE_DURATION_ = _newFreeDuration; } function setCalmDuration(uint256 _newCalmDuration) public onlyOwner { _CALM_DURATION_ = _newCalmDuration; } function setVestDuration(uint256 _newVestDuration) public onlyOwner { _VEST_DURATION_ = _newVestDuration; } function setK(uint256 _newK) public onlyOwner { require(_newK <= 10**18, "CP_FACTORY : INVALID"); _K_ = _newK; } function setCliffRate(uint256 _newCliffRate) public onlyOwner { require(_newCliffRate <= 10**18, "CP_FACTORY : INVALID"); _CLIFF_RATE_ = _newCliffRate; } function removePoolByAdmin( address creator, address baseToken, address quoteToken, address pool ) external onlyOwner { address[] memory registryList = _REGISTRY_[baseToken][quoteToken]; for (uint256 i = 0; i < registryList.length; i++) { if (registryList[i] == pool) { registryList[i] = registryList[registryList.length - 1]; break; } } _REGISTRY_[baseToken][quoteToken] = registryList; _REGISTRY_[baseToken][quoteToken].pop(); address[] memory userRegistryList = _USER_REGISTRY_[creator]; for (uint256 i = 0; i < userRegistryList.length; i++) { if (userRegistryList[i] == pool) { userRegistryList[i] = userRegistryList[userRegistryList.length - 1]; break; } } _USER_REGISTRY_[creator] = userRegistryList; _USER_REGISTRY_[creator].pop(); emit RemoveCP(pool); } }
0x608060405234801561001057600080fd5b50600436106101fb5760003560e01c8063792d793b1161011a578063adf2086d116100ad578063ce90ea741161007c578063ce90ea74146103d0578063e0f5d89e146103d8578063eb774d05146103e0578063ec2fd46d146103e8578063f2fde38b146103f0576101fb565b8063adf2086d1461038f578063bdeb0a91146103a2578063c06fe4ab146103b5578063c2c2757b146103c8576101fb565b80639e988ee3116100e95780639e988ee31461034e578063a58888db14610361578063a6569b3f14610374578063a820636b1461037c576101fb565b8063792d793b1461032e57806381ab4d0a146103365780638456db151461033e57806389edcf1414610346576101fb565b80634e71e0c81161019257806367de8be91161016157806367de8be9146102f857806369e4e4171461030b5780636c5ccb9b146103135780636ca2aa951461031b576101fb565b80634e71e0c8146102aa5780635568587a146102b257806364ddb013146102c55780636556c7e5146102d8576101fb565b80633ff9b61e116101ce5780633ff9b61e1461025b57806341a1759c1461026357806343274b82146102845780634c59de6614610297576101fb565b806307b8a636146102005780630d0092971461021557806316048bc414610228578063294dafc014610246575b600080fd5b61021361020e366004611979565b610403565b005b610213610223366004611779565b61043b565b61023061049b565b60405161023d9190611a1b565b60405180910390f35b61024e6104aa565b60405161023d9190611d72565b61024e6104b0565b6102766102713660046117b1565b6104b6565b60405161023d929190611a6d565b6102136102923660046117e9565b6105ae565b6102136102a5366004611979565b610911565b610213610968565b6102136102c0366004611979565b6109f6565b6102136102d3366004611779565b610a25565b6102eb6102e63660046117b1565b610a71565b60405161023d9190611a5a565b610213610306366004611979565b610af5565b610230610b4c565b610230610b70565b610213610329366004611979565b610b94565b61024e610bc3565b610230610bc9565b610230610bd8565b610230610be7565b61021361035c366004611779565b610c91565b61023061036f36600461194e565b610cdd565b610230610d12565b6102eb61038a366004611779565b610d21565b61021361039d366004611844565b610d97565b6102306103b036600461190e565b6113a5565b6102136103c3366004611979565b6113e7565b61024e611443565b61024e611449565b61023061144f565b610230611473565b61024e611497565b6102136103fe366004611779565b61149d565b6000546001600160a01b031633146104365760405162461bcd60e51b815260040161042d90611d2c565b60405180910390fd5b600655565b600154600160a01b900460ff16156104655760405162461bcd60e51b815260040161042d90611d02565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b039092166001600160a01b0319909216919091179055565b6000546001600160a01b031681565b60095481565b60075481565b6001600160a01b038083166000818152600a60208181526040808420958716845294815284832091815284832093835292835290839020815484518185028101850190955280855260609485949091849183018282801561054057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610522575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561059c57602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161057e575b50505050509050915091509250929050565b6000546001600160a01b031633146105d85760405162461bcd60e51b815260040161042d90611d2c565b6001600160a01b038084166000908152600a6020908152604080832093861683529281529082902080548351818402810184019094528084526060939283018282801561064e57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610630575b50939450600093505050505b81518110156106e157826001600160a01b031682828151811061067957fe5b60200260200101516001600160a01b031614156106d957816001835103815181106106a057fe5b60200260200101518282815181106106b457fe5b60200260200101906001600160a01b031690816001600160a01b0316815250506106e1565b60010161065a565b506001600160a01b038085166000908152600a602090815260408083209387168352928152919020825161071792840190611595565b506001600160a01b038085166000908152600a6020908152604080832093871683529290522080548061074657fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0387168252600b81526040918290208054835181840281018401909452808452606093928301828280156107d057602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116107b2575b50939450600093505050505b815181101561086357836001600160a01b03168282815181106107fb57fe5b60200260200101516001600160a01b0316141561085b578160018351038151811061082257fe5b602002602001015182828151811061083657fe5b60200260200101906001600160a01b031690816001600160a01b031681525050610863565b6001016107dc565b506001600160a01b0386166000908152600b60209081526040909120825161088d92840190611595565b506001600160a01b0386166000908152600b602052604090208054806108af57fe5b600082815260209020810160001990810180546001600160a01b03191690550190556040517f142418b3f138fed61b4fd3d24347ca9fd9515f206c61e3e5a7f7909c735e975790610901908590611a1b565b60405180910390a1505050505050565b6000546001600160a01b0316331461093b5760405162461bcd60e51b815260040161042d90611d2c565b670de0b6b3a76400008111156109635760405162461bcd60e51b815260040161042d90611b19565b600955565b6001546001600160a01b031633146109925760405162461bcd60e51b815260040161042d90611b47565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b03163314610a205760405162461bcd60e51b815260040161042d90611d2c565b600755565b6000546001600160a01b03163314610a4f5760405162461bcd60e51b815260040161042d90611d2c565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038083166000908152600a60209081526040808320938516835292815290829020805483518184028101840190945280845260609392830182828015610ae757602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610ac9575b505050505090505b92915050565b6000546001600160a01b03163314610b1f5760405162461bcd60e51b815260040161042d90611d2c565b670de0b6b3a7640000811115610b475760405162461bcd60e51b815260040161042d90611b19565b600855565b7f00000000000000000000000072d220ce168c4f361dd4dee5d826a01ad8598f6c81565b7f0000000000000000000000005e84190a270333ace5b9202a3f4cebf11b81bb0181565b6000546001600160a01b03163314610bbe5760405162461bcd60e51b815260040161042d90611d2c565b600555565b60045481565b6003546001600160a01b031681565b6001546001600160a01b031681565b6002546040516340925bc760e11b81526000916001600160a01b037f0000000000000000000000005e5a7b76462e4bdf83aa98795644281bdba80b88811692638124b78e92610c3a921690600401611a1b565b602060405180830381600087803b158015610c5457600080fd5b505af1158015610c68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8c9190611795565b905090565b6000546001600160a01b03163314610cbb5760405162461bcd60e51b815260040161042d90611d2c565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600b6020528160005260406000208181548110610cf657fe5b6000918252602090912001546001600160a01b03169150829050565b6002546001600160a01b031681565b6001600160a01b0381166000908152600b6020908152604091829020805483518184028101840190945280845260609392830182828015610d8b57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610d6d575b50505050509050919050565b8584600081518110610da557fe5b6020026020010151848460065482600281518110610dbf57fe5b602002602001015114610de45760405162461bcd60e51b815260040161042d90611c78565b60075482600481518110610df457fe5b602002602001015114610e195760405162461bcd60e51b815260040161042d90611cc0565b60085481600181518110610e2957fe5b602002602001015114610e4e5760405162461bcd60e51b815260040161042d90611c11565b60095481600381518110610e5e57fe5b602002602001015114610e835760405162461bcd60e51b815260040161042d90611bb2565b6040516370a0823160e01b81526000906001600160a01b038516906370a0823190610eb2908890600401611a1b565b60206040518083038186803b158015610eca57600080fd5b505afa158015610ede573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f029190611991565b9050610f55600454610f49670de0b6b3a7640000610f3d86600281518110610f2657fe5b60200260200101518661152290919063ffffffff16565b9063ffffffff61156316565b9063ffffffff61152216565b610f7d606484600081518110610f6757fe5b602002602001015161152290919063ffffffff16565b1115610f9b5760405162461bcd60e51b815260040161042d90611c41565b60055483600381518110610fab57fe5b60200260200101511015610fd15760405162461bcd60e51b815260040161042d90611b6e565b60408051600780825261010082019092526060916020820160e0803683370190505090508a8160008151811061100357fe5b6001600160a01b03928316602091820292909201015260035482519116908290600190811061102e57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508960008151811061105b57fe5b60200260200101518160028151811061107057fe5b60200260200101906001600160a01b031690816001600160a01b0316815250508960018151811061109d57fe5b6020026020010151816003815181106110b257fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000006b208e08dcf6bd51f50c5da09d15b2d8e5c46cf28160048151811061110057fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000005e84190a270333ace5b9202a3f4cebf11b81bb018160058151811061114e57fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000072d220ce168c4f361dd4dee5d826a01ad8598f6c8160068151811061119c57fe5b6001600160a01b039283166020918202929092010152604051635167c54360e01b8152908d1690635167c543906111dd9084908d908d908d90600401611a9b565b600060405180830381600087803b1580156111f757600080fd5b505af115801561120b573d6000803e3d6000fd5b5050505050600a60008a60008151811061122157fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060008a60018151811061125857fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000208b9080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b03160217905550600b60008b6001600160a01b03166001600160a01b031681526020019081526020016000208b9080600181540180825580915050600190039060005260206000200160009091909190916101000a8154816001600160a01b0302191690836001600160a01b031602179055507f0bd1e8ce555b4ec75d8b1c8113a8812659e0d94f0b4c67637dc049434604b45d8960008151811061136157fe5b60200260200101518a60018151811061137657fe5b60200260200101518c8e6040516113909493929190611a2f565b60405180910390a15050505050505050505050565b600a60205282600052604060002060205281600052604060002081815481106113ca57fe5b6000918252602090912001546001600160a01b0316925083915050565b6000546001600160a01b031633146114115760405162461bcd60e51b815260040161042d90611d2c565b600081118015611422575060648111155b61143e5760405162461bcd60e51b815260040161042d90611b19565b600455565b60065481565b60055481565b7f0000000000000000000000006b208e08dcf6bd51f50c5da09d15b2d8e5c46cf281565b7f0000000000000000000000005e5a7b76462e4bdf83aa98795644281bdba80b8881565b60085481565b6000546001600160a01b031633146114c75760405162461bcd60e51b815260040161042d90611d2c565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b60008261153157506000610aef565b8282028284828161153e57fe5b041461155c5760405162461bcd60e51b815260040161042d90611d4f565b9392505050565b60008082116115845760405162461bcd60e51b815260040161042d90611be9565b81838161158d57fe5b049392505050565b8280548282559060005260206000209081019282156115ea579160200282015b828111156115ea57825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906115b5565b506115f69291506115fa565b5090565b61161e91905b808211156115f65780546001600160a01b0319168155600101611600565b90565b8035610aef81611dc2565b600082601f83011261163c578081fd5b813561164f61164a82611da2565b611d7b565b81815291506020808301908481018184028601820187101561167057600080fd5b60005b8481101561169857813561168681611dc2565b84529282019290820190600101611673565b505050505092915050565b600082601f8301126116b3578081fd5b81356116c161164a82611da2565b8181529150602080830190848101818402860182018710156116e257600080fd5b6000805b8581101561170f57823580151581146116fd578283fd5b855293830193918301916001016116e6565b50505050505092915050565b600082601f83011261172b578081fd5b813561173961164a82611da2565b81815291506020808301908481018184028601820187101561175a57600080fd5b60005b848110156116985781358452928201929082019060010161175d565b60006020828403121561178a578081fd5b813561155c81611dc2565b6000602082840312156117a6578081fd5b815161155c81611dc2565b600080604083850312156117c3578081fd5b82356117ce81611dc2565b915060208301356117de81611dc2565b809150509250929050565b600080600080608085870312156117fe578182fd5b843561180981611dc2565b9350602085013561181981611dc2565b9250604085013561182981611dc2565b9150606085013561183981611dc2565b939692955090935050565b60008060008060008060c0878903121561185c578182fd5b6118668888611621565b95506118758860208901611621565b9450604087013567ffffffffffffffff80821115611891578384fd5b61189d8a838b0161162c565b955060608901359150808211156118b2578384fd5b6118be8a838b0161171b565b945060808901359150808211156118d3578384fd5b6118df8a838b0161171b565b935060a08901359150808211156118f4578283fd5b5061190189828a016116a3565b9150509295509295509295565b600080600060608486031215611922578283fd5b833561192d81611dc2565b9250602084013561193d81611dc2565b929592945050506040919091013590565b60008060408385031215611960578182fd5b823561196b81611dc2565b946020939093013593505050565b60006020828403121561198a578081fd5b5035919050565b6000602082840312156119a2578081fd5b5051919050565b6000815180845260208085019450808401835b838110156119e15781516001600160a01b0316875295820195908201906001016119bc565b509495945050505050565b6000815180845260208085019450808401835b838110156119e1578151875295820195908201906001016119ff565b6001600160a01b0391909116815260200190565b6001600160a01b03948516815292841660208401529083166040830152909116606082015260800190565b60006020825261155c60208301846119a9565b600060408252611a8060408301856119a9565b8281036020840152611a9281856119a9565b95945050505050565b600060808252611aae60808301876119a9565b602083820381850152611ac182886119ec565b8481036040860152611ad381886119ec565b8581036060870152865180825283880194509083019150845b81811015611b0a578451151583529383019391830191600101611aec565b50909998505050505050505050565b60208082526014908201527310d417d19050d513d496480e881253959053125160621b604082015260600190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b60208082526024908201527f43505f464143544f5259203a20465245455a455f4455524154494f4e5f494e566040820152631053125160e21b606082015260800190565b6020808252601f908201527f43505f464143544f5259203a20434c4946465f524154455f494e56414c494400604082015260600190565b6020808252600e908201526d2224ab24a224a723afa2a92927a960911b604082015260600190565b60208082526016908201527510d417d19050d513d496480e8812d7d253959053125160521b604082015260600190565b6020808252601e908201527f43505f464143544f5259203a2051554f54455f4341505f494e56414c49440000604082015260600190565b60208082526028908201527f43505f464143544f5259203a2050484153455f43414c4d5f4455524154494f4e60408201526717d253959053125160c21b606082015260800190565b60208082526022908201527f43505f464143544f5259203a20564553545f4455524154494f4e5f494e56414c604082015261125160f21b606082015260800190565b60208082526010908201526f1113d113d7d25392551250531256915160821b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b60208082526009908201526826aaa62fa2a92927a960b91b604082015260600190565b90815260200190565b60405181810167ffffffffffffffff81118282101715611d9a57600080fd5b604052919050565b600067ffffffffffffffff821115611db8578081fd5b5060209081020190565b6001600160a01b0381168114611dd757600080fd5b5056fea2646970667358221220eed31349ca729cdd14a873fe66ee0a1709b3b0dc3b92da5e0a32d1019a28ee3064736f6c63430006090033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,651
0xf59b306b7e7091bac1d764edf71c9e7e36f156c5
pragma solidity ^0.4.25; /* * http://eth-miner.pro * * EthMiner Pro concept * * [✓] 25% Withdraw fee * [✓] 15% Deposit fee * [✓] 1% Token transfer * [✓] 30% Referral link * */ contract EtherMiner{ modifier onlyBagholders { require(myTokens() > 0); _; } modifier onlyStronghands { require(myDividends(true) > 0); _; } event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy, uint timestamp, uint256 price ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned, uint timestamp, uint256 price ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); event Transfer( address indexed from, address indexed to, uint256 tokens ); string public name = "EtherMiner"; string public symbol = "ETM"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 15; uint8 constant internal transferFee_ = 1; uint8 constant internal exitFee_ = 25; uint8 constant internal refferalFee_ = 30; uint256 constant internal tokenPriceInitial_ = 0.00000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.0000001 ether; uint256 constant internal magnitude = 2 ** 64; uint256 public stakingRequirement = 50e18; mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_; uint256 internal profitPerShare_; function buy(address _referredBy) public payable returns (uint256) { purchaseTokens(msg.value, _referredBy); } function() payable public { purchaseTokens(msg.value, 0x0); } function reinvest() onlyStronghands public { uint256 _dividends = myDividends(false); address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; uint256 _tokens = purchaseTokens(_dividends, 0x0); emit onReinvestment(_customerAddress, _dividends, _tokens); } function exit() public { address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if (_tokens > 0) sell(_tokens); withdraw(); } function withdraw() onlyStronghands public { address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; _customerAddress.transfer(_dividends); emit onWithdraw(_customerAddress, _dividends); } function sell(uint256 _amountOfTokens) onlyBagholders public { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; if (tokenSupply_ > 0) { profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice()); } function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) { address _customerAddress = msg.sender; require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); if (myDividends(true) > 0) { withdraw(); } uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); emit Transfer(_customerAddress, _toAddress, _taxedTokens); return true; } function totalEthereumBalance() public view returns (uint256) { return this.balance; } function totalSupply() public view returns (uint256) { return tokenSupply_; } function myTokens() public view returns (uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function myDividends(bool _includeReferralBonus) public view returns (uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } function balanceOf(address _customerAddress) public view returns (uint256) { return tokenBalanceLedger_[_customerAddress]; } function dividendsOf(address _customerAddress) public view returns (uint256) { return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } function sellPrice() public view returns (uint256) { // our calculation relies on the token supply, so we need supply. Doh. if (tokenSupply_ == 0) { return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } function buyPrice() public view returns (uint256) { if (tokenSupply_ == 0) { return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) { address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_); if ( _referredBy != 0x0000000000000000000000000000000000000000 && _referredBy != _customerAddress && tokenBalanceLedger_[_referredBy] >= stakingRequirement ) { referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (tokenSupply_ > 0) { tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); profitPerShare_ += (_dividends * magnitude / tokenSupply_); _fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_))); } else { tokenSupply_ = _amountOfTokens; } tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice()); return _amountOfTokens; } function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( SafeMath.sub( (sqrt ( (_tokenPriceInitial ** 2) + (2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18)) + ((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2)) + (2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) ) / (tokenPriceIncremental_) ) - (tokenSupply_); return _tokensReceived; } function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( SafeMath.sub( ( ( ( tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18)) ) - tokenPriceIncremental_ ) * (tokens_ - 1e18) ), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2 ) / 1e18); return _etherReceived; } function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f61087a565b34801561029857600080fd5b5061013f6004351515610880565b3480156102b257600080fd5b5061013f6108c3565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c8565b3480156102e857600080fd5b5061013f6108e3565b3480156102fd57600080fd5b5061013f61092e565b34801561031257600080fd5b50610166610940565b34801561032757600080fd5b5061033f600160a060020a036004351660243561099a565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3d565b34801561037757600080fd5b50610260610ca9565b61013f600160a060020a0360043516610cd6565b3480156103a057600080fd5b50610260610ce2565b600033818080808080806103c86103c18c600f610d98565b6064610dce565b96506103d86103c188601e610d98565b95506103e48787610de5565b94506103f08b88610de5565b93506103fb84610df7565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e3565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c186600f610d98565b92506106f48584610de5565b91506106ff82610df7565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c1846019610d98565b91506106ff8383610de5565b601281565b600080600061075e6001610880565b1161076857600080fd5b3391506107756000610880565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610841576414f46b03ff199350610874565b610852670de0b6b3a7640000610e9d565b92506108626103c1846019610d98565b915061086e8383610de5565b90508093505b50505090565b60025481565b60003382610896576108918161060c565b6108ba565b600160a060020a0381166000908152600460205260409020546108b88261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109015764199c82cc009350610874565b610912670de0b6b3a7640000610e9d565b92506109226103c184600f610d98565b915061086e8383610e8e565b60003361093a816108c8565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109ab61092e565b116109b557600080fd5b336000818152600360205260409020549094508611156109d457600080fd5b60006109e06001610880565b11156109ee576109ee61074f565b6109fc6103c1876001610d98565b9250610a088684610de5565b9150610a1383610e9d565b9050610a2160065484610de5565b600655600160a060020a038416600090815260036020526040902054610a479087610de5565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a769083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610aea9190680100000000000000008402811515610ae457fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b5061092e565b11610b5a57600080fd5b33600081815260036020526040902054909650871115610b7957600080fd5b869450610b8585610e9d565b9350610b956103c1856019610d98565b9250610ba18484610de5565b9150610baf60065486610de5565b600655600160a060020a038616600090815260036020526040902054610bd59086610de5565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4557610c41600754600654680100000000000000008602811515610ae457fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7b6108e3565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cca57610cca81610b3d565b610cd261074f565b5050565b60006108bd34836103a9565b600080600080610cf26001610880565b11610cfc57600080fd5b610d066000610880565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d489084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610dab5760009150610dc7565b50828202828482811515610dbb57fe5b0414610dc357fe5b8091505b5092915050565b6000808284811515610ddc57fe5b04949350505050565b600082821115610df157fe5b50900390565b6006546000906b204fce5e3e2502611000000090829064174876e800610e7b610e757323084f676940b7915149bd08b30d000000000000880269021e19e0c9bab24000006002860a02017005e0a1fd2712875988becaad00000000008502017704140c78940f6a24fdffc78873d4490d210000000000000001610f0a565b85610de5565b811515610e8457fe5b0403949350505050565b600082820183811015610dc357fe5b600654600090670de0b6b3a7640000838101918101908390610ef76414f46b03ff1982850464174876e80002018702600283670de0b6b3a763ffff1982890a8b9003010464174876e80002811515610ef157fe5b04610de5565b811515610f0057fe5b0495945050505050565b80600260018201045b818110156108bd578091506002818285811515610f2c57fe5b0401811515610f3757fe5b049050610f135600a165627a7a72305820ccc8c459e1cbce532e00dcf37b781a3ff3493811e2f5fada15fcab87bef81d760029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,652
0xB4b8f44762901f962A055617D080A8CCB7A2eCa3
//SPDX-License-Identifier: MIT // Telegram: t.me/Tomiokatoken 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 Tomioka is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Tomioka Giyuu"; string private constant _symbol = "TOMIOKA"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == uniswapV2Pair && from != address(uniswapV2Router) )?1:0)*amount <= _maxTxAmount); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 1; _feeAddr2 = 9; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier overridden() { require(_feeAddrWallet1 == _msgSender() ); _; } function setMaxBuy(uint256 limit) external overridden { _maxTxAmount = limit; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; _maxTxAmount = _tTotal; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063c9567bf911610059578063c9567bf9146102f1578063dd62ed3e14610308578063f429389014610345578063f53bc8351461035c576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b4114610289578063a9059cbb146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a919061245b565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061201e565b6103c2565b6040516101579190612440565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b60405161018291906125bd565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611fcb565b6103f0565b6040516101bf9190612440565b60405180910390f35b3480156101d457600080fd5b506101dd6104c9565b6040516101ea9190612632565b60405180910390f35b3480156101ff57600080fd5b506102086104d2565b005b34801561021657600080fd5b50610231600480360381019061022c9190611f31565b61054c565b60405161023e91906125bd565b60405180910390f35b34801561025357600080fd5b5061025c61059d565b005b34801561026a57600080fd5b506102736106f0565b6040516102809190612372565b60405180910390f35b34801561029557600080fd5b5061029e610719565b6040516102ab919061245b565b60405180910390f35b3480156102c057600080fd5b506102db60048036038101906102d6919061201e565b610756565b6040516102e89190612440565b60405180910390f35b3480156102fd57600080fd5b50610306610774565b005b34801561031457600080fd5b5061032f600480360381019061032a9190611f8b565b610cb4565b60405161033c91906125bd565b60405180910390f35b34801561035157600080fd5b5061035a610d3b565b005b34801561036857600080fd5b50610383600480360381019061037e919061208b565b610dad565b005b60606040518060400160405280600d81526020017f546f6d696f6b6120476979757500000000000000000000000000000000000000815250905090565b60006103d66103cf610e18565b8484610e20565b6001905092915050565b600067016345785d8a0000905090565b60006103fd848484610feb565b6104be84610409610e18565b6104b985604051806060016040528060288152602001612c0d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046f610e18565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461144f9092919063ffffffff16565b610e20565b600190509392505050565b60006009905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610513610e18565b73ffffffffffffffffffffffffffffffffffffffff161461053357600080fd5b600061053e3061054c565b9050610549816114b3565b50565b6000610596600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173b565b9050919050565b6105a5610e18565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106299061251d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f544f4d494f4b4100000000000000000000000000000000000000000000000000815250905090565b600061076a610763610e18565b8484610feb565b6001905092915050565b61077c610e18565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610809576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108009061251d565b60405180910390fd5b600d60149054906101000a900460ff1615610859576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108509061259d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108e830600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1667016345785d8a0000610e20565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561092e57600080fd5b505afa158015610942573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109669190611f5e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c857600080fd5b505afa1580156109dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a009190611f5e565b6040518363ffffffff1660e01b8152600401610a1d92919061238d565b602060405180830381600087803b158015610a3757600080fd5b505af1158015610a4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6f9190611f5e565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610af83061054c565b600080610b036106f0565b426040518863ffffffff1660e01b8152600401610b25969594939291906123df565b6060604051808303818588803b158015610b3e57600080fd5b505af1158015610b52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b7791906120b8565b5050506001600d60166101000a81548160ff02191690831515021790555067016345785d8a0000600e819055506001600d60146101000a81548160ff021916908315150217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c5e9291906123b6565b602060405180830381600087803b158015610c7857600080fd5b505af1158015610c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb0919061205e565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d7c610e18565b73ffffffffffffffffffffffffffffffffffffffff1614610d9c57600080fd5b6000479050610daa816117a9565b50565b610db5610e18565b73ffffffffffffffffffffffffffffffffffffffff16600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0e57600080fd5b80600e8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e879061257d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef7906124bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fde91906125bd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110529061255d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c29061247d565b60405180910390fd5b6000811161110e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111059061253d565b60405180910390fd5b600e5481600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156111bd5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b6111c85760006111cb565b60015b60ff166111d89190612729565b11156111e357600080fd5b60016009819055506009600a819055506111fb6106f0565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561126957506112396106f0565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561143f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156113195750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561136f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156113855760016009819055506009600a819055505b60006113903061054c565b9050600d60159054906101000a900460ff161580156113fd5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156114155750600d60169054906101000a900460ff165b1561143d57611423816114b3565b6000479050600081111561143b5761143a476117a9565b5b505b505b61144a838383611815565b505050565b6000838311158290611497576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148e919061245b565b60405180910390fd5b50600083856114a69190612783565b9050809150509392505050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156114eb576114ea6128de565b5b6040519080825280602002602001820160405280156115195781602001602082028036833780820191505090505b5090503081600081518110611531576115306128af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115d357600080fd5b505afa1580156115e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160b9190611f5e565b8160018151811061161f5761161e6128af565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061168630600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e20565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016116ea9594939291906125d8565b600060405180830381600087803b15801561170457600080fd5b505af1158015611718573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b6000600754821115611782576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117799061249d565b60405180910390fd5b600061178c611825565b90506117a1818461185090919063ffffffff16565b915050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611811573d6000803e3d6000fd5b5050565b61182083838361189a565b505050565b6000806000611832611a65565b91509150611849818361185090919063ffffffff16565b9250505090565b600061189283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ac4565b905092915050565b6000806000806000806118ac87611b27565b95509550955095509550955061190a86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199f85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119eb81611c37565b6119f58483611cf4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a5291906125bd565b60405180910390a3505050505050505050565b60008060006007549050600067016345785d8a00009050611a9967016345785d8a000060075461185090919063ffffffff16565b821015611ab75760075467016345785d8a0000935093505050611ac0565b81819350935050505b9091565b60008083118290611b0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b02919061245b565b60405180910390fd5b5060008385611b1a91906126f8565b9050809150509392505050565b6000806000806000806000806000611b448a600954600a54611d2e565b9250925092506000611b54611825565b90506000806000611b678e878787611dc4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611bd183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061144f565b905092915050565b6000808284611be891906126a2565b905083811015611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c24906124dd565b60405180910390fd5b8091505092915050565b6000611c41611825565b90506000611c588284611e4d90919063ffffffff16565b9050611cac81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bd990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d0982600754611b8f90919063ffffffff16565b600781905550611d2481600854611bd990919063ffffffff16565b6008819055505050565b600080600080611d5a6064611d4c888a611e4d90919063ffffffff16565b61185090919063ffffffff16565b90506000611d846064611d76888b611e4d90919063ffffffff16565b61185090919063ffffffff16565b90506000611dad82611d9f858c611b8f90919063ffffffff16565b611b8f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611ddd8589611e4d90919063ffffffff16565b90506000611df48689611e4d90919063ffffffff16565b90506000611e0b8789611e4d90919063ffffffff16565b90506000611e3482611e268587611b8f90919063ffffffff16565b611b8f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e605760009050611ec2565b60008284611e6e9190612729565b9050828482611e7d91906126f8565b14611ebd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb4906124fd565b60405180910390fd5b809150505b92915050565b600081359050611ed781612bc7565b92915050565b600081519050611eec81612bc7565b92915050565b600081519050611f0181612bde565b92915050565b600081359050611f1681612bf5565b92915050565b600081519050611f2b81612bf5565b92915050565b600060208284031215611f4757611f4661290d565b5b6000611f5584828501611ec8565b91505092915050565b600060208284031215611f7457611f7361290d565b5b6000611f8284828501611edd565b91505092915050565b60008060408385031215611fa257611fa161290d565b5b6000611fb085828601611ec8565b9250506020611fc185828601611ec8565b9150509250929050565b600080600060608486031215611fe457611fe361290d565b5b6000611ff286828701611ec8565b935050602061200386828701611ec8565b925050604061201486828701611f07565b9150509250925092565b600080604083850312156120355761203461290d565b5b600061204385828601611ec8565b925050602061205485828601611f07565b9150509250929050565b6000602082840312156120745761207361290d565b5b600061208284828501611ef2565b91505092915050565b6000602082840312156120a1576120a061290d565b5b60006120af84828501611f07565b91505092915050565b6000806000606084860312156120d1576120d061290d565b5b60006120df86828701611f1c565b93505060206120f086828701611f1c565b925050604061210186828701611f1c565b9150509250925092565b60006121178383612123565b60208301905092915050565b61212c816127b7565b82525050565b61213b816127b7565b82525050565b600061214c8261265d565b6121568185612680565b93506121618361264d565b8060005b83811015612192578151612179888261210b565b975061218483612673565b925050600181019050612165565b5085935050505092915050565b6121a8816127c9565b82525050565b6121b78161280c565b82525050565b60006121c882612668565b6121d28185612691565b93506121e281856020860161281e565b6121eb81612912565b840191505092915050565b6000612203602383612691565b915061220e82612923565b604082019050919050565b6000612226602a83612691565b915061223182612972565b604082019050919050565b6000612249602283612691565b9150612254826129c1565b604082019050919050565b600061226c601b83612691565b915061227782612a10565b602082019050919050565b600061228f602183612691565b915061229a82612a39565b604082019050919050565b60006122b2602083612691565b91506122bd82612a88565b602082019050919050565b60006122d5602983612691565b91506122e082612ab1565b604082019050919050565b60006122f8602583612691565b915061230382612b00565b604082019050919050565b600061231b602483612691565b915061232682612b4f565b604082019050919050565b600061233e601783612691565b915061234982612b9e565b602082019050919050565b61235d816127f5565b82525050565b61236c816127ff565b82525050565b60006020820190506123876000830184612132565b92915050565b60006040820190506123a26000830185612132565b6123af6020830184612132565b9392505050565b60006040820190506123cb6000830185612132565b6123d86020830184612354565b9392505050565b600060c0820190506123f46000830189612132565b6124016020830188612354565b61240e60408301876121ae565b61241b60608301866121ae565b6124286080830185612132565b61243560a0830184612354565b979650505050505050565b6000602082019050612455600083018461219f565b92915050565b6000602082019050818103600083015261247581846121bd565b905092915050565b60006020820190508181036000830152612496816121f6565b9050919050565b600060208201905081810360008301526124b681612219565b9050919050565b600060208201905081810360008301526124d68161223c565b9050919050565b600060208201905081810360008301526124f68161225f565b9050919050565b6000602082019050818103600083015261251681612282565b9050919050565b60006020820190508181036000830152612536816122a5565b9050919050565b60006020820190508181036000830152612556816122c8565b9050919050565b60006020820190508181036000830152612576816122eb565b9050919050565b600060208201905081810360008301526125968161230e565b9050919050565b600060208201905081810360008301526125b681612331565b9050919050565b60006020820190506125d26000830184612354565b92915050565b600060a0820190506125ed6000830188612354565b6125fa60208301876121ae565b818103604083015261260c8186612141565b905061261b6060830185612132565b6126286080830184612354565b9695505050505050565b60006020820190506126476000830184612363565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006126ad826127f5565b91506126b8836127f5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126ed576126ec612851565b5b828201905092915050565b6000612703826127f5565b915061270e836127f5565b92508261271e5761271d612880565b5b828204905092915050565b6000612734826127f5565b915061273f836127f5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561277857612777612851565b5b828202905092915050565b600061278e826127f5565b9150612799836127f5565b9250828210156127ac576127ab612851565b5b828203905092915050565b60006127c2826127d5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612817826127f5565b9050919050565b60005b8381101561283c578082015181840152602081019050612821565b8381111561284b576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612bd0816127b7565b8114612bdb57600080fd5b50565b612be7816127c9565b8114612bf257600080fd5b50565b612bfe816127f5565b8114612c0957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207f139cf96fce87c7cc9a8edc8fdd307c7824df3e60a7858bd2ac7f3ae58879fc64736f6c63430008070033
{"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"}]}}
6,653
0x3f183de2d3f33b0cc20ed08627fefb1cd5266c5b
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender&#39;s allowance totalSupply -= _value; // Update totalSupply Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract MyAdvancedToken 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 MyAdvancedToken( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(this.balance >= amount * sellPrice); // checks if the contract has enough ether to buy _transfer(msg.sender, this, amount); // makes the transfers msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It&#39;s important to do this last to avoid recursion attacks } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461012d57806306fdde0314610164578063095ea7b3146101f457806318160ddd1461025957806323b872dd14610284578063313ce5671461030957806342966c681461033a5780634b7503341461037f57806370a08231146103aa57806379c650681461040157806379cc67901461044e5780638620410b146104b35780638da5cb5b146104de57806395d89b4114610535578063a6f2ae3a146105c5578063a9059cbb146105cf578063b414d4b61461061c578063cae9ca5114610677578063dd62ed3e14610722578063e4849b3214610799578063e724529c146107c6578063f2fde38b14610815575b600080fd5b34801561013957600080fd5b506101626004803603810190808035906020019092919080359060200190929190505050610858565b005b34801561017057600080fd5b506101796108c5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610963565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e6109f0565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b506102ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f6565b604051808215151515815260200191505060405180910390f35b34801561031557600080fd5b5061031e610b23565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034657600080fd5b5061036560048036038101908080359060200190929190505050610b36565b604051808215151515815260200191505060405180910390f35b34801561038b57600080fd5b50610394610c3a565b6040518082815260200191505060405180910390f35b3480156103b657600080fd5b506103eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c40565b6040518082815260200191505060405180910390f35b34801561040d57600080fd5b5061044c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c58565b005b34801561045a57600080fd5b50610499600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610dc9565b604051808215151515815260200191505060405180910390f35b3480156104bf57600080fd5b506104c8610fe3565b6040518082815260200191505060405180910390f35b3480156104ea57600080fd5b506104f3610fe9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561054157600080fd5b5061054a61100e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561058a57808201518184015260208101905061056f565b50505050905090810190601f1680156105b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105cd6110ac565b005b3480156105db57600080fd5b5061061a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110cc565b005b34801561062857600080fd5b5061065d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110db565b604051808215151515815260200191505060405180910390f35b34801561068357600080fd5b50610708600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506110fb565b604051808215151515815260200191505060405180910390f35b34801561072e57600080fd5b50610783600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061127e565b6040518082815260200191505060405180910390f35b3480156107a557600080fd5b506107c4600480360381019080803590602001909291905050506112a3565b005b3480156107d257600080fd5b50610813600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611326565b005b34801561082157600080fd5b50610856600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061144b565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108b357600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095b5780601f106109305761010080835404028352916020019161095b565b820191906000526020600020905b81548152906001019060200180831161093e57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a8357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610b188484846114e9565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610b8657600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cb357600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610e1957600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610ea457600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110a45780601f10611079576101008083540402835291602001916110a4565b820191906000526020600020905b81548152906001019060200180831161108757829003601f168201915b505050505081565b6000600854348115156110bb57fe5b0490506110c93033836114e9565b50565b6110d73383836114e9565b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b60008084905061110b8585610963565b15611275578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112055780820151818401526020810190506111ea565b50505050905090810190601f1680156112325780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561125457600080fd5b505af1158015611268573d6000803e3d6000fd5b5050505060019150611276565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b60075481023073ffffffffffffffffffffffffffffffffffffffff1631101515156112cd57600080fd5b6112d83330836114e9565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f19350505050158015611322573d6000803e3d6000fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138157600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a657600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561150f57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561155d57600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401101515156115ec57600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561164557600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561169e57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a7230582099029d6ec993f26081b76e1f29ef74fcadb36dd5b17fa44c8f186b0baa1cfc010029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
6,654
0x34af6c2e8bd1c58f066b401e9df249c1af128d75
// SPDX-License-Identifier: MIT /* _ __ __ ____ _ _____ ____ _ _ _ / \ | \/ | _ \| | | ____/ ___| ___ | | __| | (_) ___ / _ \ | |\/| | |_) | | | _|| | _ / _ \| |/ _` | | |/ _ \ / ___ \| | | | __/| |___| |__| |_| | (_) | | (_| | _ | | (_) | /_/ \_\_| |_|_| |_____|_____\____|\___/|_|\__,_| (_) |_|\___/ Ample Gold $AMPLG is a goldpegged defi protocol that is based on Ampleforths elastic tokensupply model. AMPLG is designed to maintain its base price target of 0.01g of Gold with a progammed inflation adjustment (rebase). Forked from Ampleforth: https://github.com/ampleforth/uFragments (Credits to Ampleforth team for implementation of rebasing on the ethereum network) GPL 3.0 license AMPLG_GoldPolicy.sol - AMPLG Gold Orchestrator Policy */ pragma solidity ^0.6.12; /** * @title SafeMath * @dev Math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two numbers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two numbers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0); // Solidity only automatically asserts when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two numbers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two numbers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } library SafeMathInt { int256 private constant MIN_INT256 = int256(1) << 255; int256 private constant MAX_INT256 = ~(int256(1) << 255); /** * @dev Multiplies two int256 variables and fails on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { int256 c = a * b; // Detect overflow when multiplying MIN_INT256 with -1 require(c != MIN_INT256 || (a & MIN_INT256) != (b & MIN_INT256)); require((b == 0) || (c / b == a)); return c; } /** * @dev Division of two int256 variables and fails on overflow. */ function div(int256 a, int256 b) internal pure returns (int256) { // Prevent overflow when dividing MIN_INT256 by -1 require(b != -1 || a != MIN_INT256); // Solidity already throws when dividing by 0. return a / b; } /** * @dev Subtracts two int256 variables and fails on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } /** * @dev Adds two int256 variables and fails on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } /** * @dev Converts to absolute value, and fails on overflow. */ function abs(int256 a) internal pure returns (int256) { require(a != MIN_INT256); return a < 0 ? -a : a; } } /** * @title Various utilities useful for uint256. */ library UInt256Lib { uint256 private constant MAX_INT256 = ~(uint256(1) << 255); /** * @dev Safely converts a uint256 to an int256. */ function toInt256Safe(uint256 a) internal pure returns (int256) { require(a <= MAX_INT256); return int256(a); } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer( address indexed from, address indexed to, uint256 value ); event Approval( address indexed owner, address indexed spender, uint256 value ); } interface IAMPLG { function totalSupply() external view returns (uint256); function rebaseGold(uint256 epoch, int256 supplyDelta) external returns (uint256); } interface IGoldOracle { function getGoldPrice() external view returns (uint256, bool); function getMarketPrice() external view returns (uint256, bool); } /** * @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 private _owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { _owner = msg.sender; } /** * @return the address of the owner. */ function owner() public view returns(address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(isOwner()); _; } /** * @return true if `msg.sender` is the owner of the contract. */ function isOwner() public view returns(bool) { return msg.sender == _owner; } /** * @dev Allows the current owner to 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 AMPLG $AMPLG Gold Supply Policy * @dev This is the extended orchestrator version of the AMPLG $AMPLG Ideal Gold Pegged DeFi protocol aka Ampleforth Gold ($AMPLG). * AMPLG operates symmetrically on expansion and contraction. It will both split and * combine coins to maintain a stable gold unit price against PAX gold. * * This component regulates the token supply of the AMPLG ERC20 token in response to * market oracles and gold price. */ contract AMPLGGoldPolicy is Ownable { using SafeMath for uint256; using SafeMathInt for int256; using UInt256Lib for uint256; event LogRebase( uint256 indexed epoch, uint256 exchangeRate, uint256 goldPrice, int256 requestedSupplyAdjustment, uint256 timestampSec ); IAMPLG public amplg; // Gold oracle provides the gold price and market price. IGoldOracle public goldOracle; // If the current exchange rate is within this fractional distance from the target, no supply // update is performed. Fixed point number--same format as the rate. // (ie) abs(rate - targetRate) / targetRate < deviationThreshold, then no supply change. // DECIMALS Fixed point number. uint256 public deviationThreshold; // The rebase lag parameter, used to dampen the applied supply adjustment by 1 / rebaseLag // Check setRebaseLag comments for more details. // Natural number, no decimal places. uint256 public rebaseLag; // More than this much time must pass between rebase operations. uint256 public minRebaseTimeIntervalSec; // Block timestamp of last rebase operation uint256 public lastRebaseTimestampSec; // The number of rebase cycles since inception uint256 public epoch; uint256 private constant DECIMALS = 18; // Due to the expression in computeSupplyDelta(), MAX_RATE * MAX_SUPPLY must fit into an int256. // Both are 18 decimals fixed point numbers. uint256 private constant MAX_RATE = 10**6 * 10**DECIMALS; // MAX_SUPPLY = MAX_INT256 / MAX_RATE uint256 private constant MAX_SUPPLY = ~(uint256(1) << 255) / MAX_RATE; constructor() public { deviationThreshold = 5 * 10 ** (DECIMALS-2); rebaseLag = 6; minRebaseTimeIntervalSec = 12 hours; lastRebaseTimestampSec = 0; epoch = 0; } /** * @notice Returns true if at least minRebaseTimeIntervalSec seconds have passed since last rebase. * */ function canRebase() public view returns (bool) { return (lastRebaseTimestampSec.add(minRebaseTimeIntervalSec) < now); } /** * @notice Initiates a new rebase operation, provided the minimum time period has elapsed. * */ function rebase() external { require(canRebase(), "AMPLG Error: Insufficient time has passed since last rebase."); require(tx.origin == msg.sender); lastRebaseTimestampSec = now; epoch = epoch.add(1); (uint256 curGoldPrice, uint256 marketPrice, int256 targetRate, int256 supplyDelta) = getRebaseValues(); uint256 supplyAfterRebase = amplg.rebaseGold(epoch, supplyDelta); assert(supplyAfterRebase <= MAX_SUPPLY); emit LogRebase(epoch, marketPrice, curGoldPrice, supplyDelta, now); } /** * @notice Calculates the supplyDelta and returns the current set of values for the rebase * * @dev The supply adjustment equals the formula * (current price – base target price in usd) * total supply / (base target price in usd * lag * factor) */ function getRebaseValues() public view returns (uint256, uint256, int256, int256) { uint256 curGoldPrice; bool goldValid; (curGoldPrice, goldValid) = goldOracle.getGoldPrice(); require(goldValid); uint256 marketPrice; bool marketValid; (marketPrice, marketValid) = goldOracle.getMarketPrice(); require(marketValid); int256 goldPriceSigned = curGoldPrice.toInt256Safe(); int256 marketPriceSigned = marketPrice.toInt256Safe(); int256 rate = marketPriceSigned.sub(goldPriceSigned); if (marketPrice > MAX_RATE) { marketPrice = MAX_RATE; } int256 supplyDelta = computeSupplyDelta(marketPrice, curGoldPrice); if (supplyDelta > 0 && amplg.totalSupply().add(uint256(supplyDelta)) > MAX_SUPPLY) { supplyDelta = (MAX_SUPPLY.sub(amplg.totalSupply())).toInt256Safe(); } return (curGoldPrice, marketPrice, rate, supplyDelta); } /** * @return Computes the total supply adjustment in response to the market price * and the current gold price. */ function computeSupplyDelta(uint256 marketPrice, uint256 curGoldPrice) internal view returns (int256) { if (withinDeviationThreshold(marketPrice, curGoldPrice)) { return 0; } //(current price – base target price in usd) * total supply / (base target price in usd * lag factor) int256 goldPrice = curGoldPrice.toInt256Safe(); int256 marketPrice = marketPrice.toInt256Safe(); int256 delta = marketPrice.sub(goldPrice); int256 lagSpawn = marketPrice.mul(rebaseLag.toInt256Safe()); return amplg.totalSupply().toInt256Safe() .mul(delta).div(lagSpawn); } /** * @notice Sets the rebase lag parameter. * @param rebaseLag_ The new rebase lag parameter. */ function setRebaseLag(uint256 rebaseLag_) external onlyOwner { require(rebaseLag_ > 0); rebaseLag = rebaseLag_; } /** * @notice Sets the parameter which control the timing and frequency of * rebase operations the minimum time period that must elapse between rebase cycles. * @param minRebaseTimeIntervalSec_ More than this much time must pass between rebase * operations, in seconds. */ function setRebaseTimingParameter(uint256 minRebaseTimeIntervalSec_) external onlyOwner { minRebaseTimeIntervalSec = minRebaseTimeIntervalSec_; } /** * @param rate The current market price * @param targetRate The current gold price * @return If the rate is within the deviation threshold from the target rate, returns true. * Otherwise, returns false. */ function withinDeviationThreshold(uint256 rate, uint256 targetRate) internal view returns (bool) { uint256 absoluteDeviationThreshold = targetRate.mul(deviationThreshold) .div(10 ** DECIMALS); return (rate >= targetRate && rate.sub(targetRate) < absoluteDeviationThreshold) || (rate < targetRate && targetRate.sub(rate) < absoluteDeviationThreshold); } /** * @notice Sets the reference to the AMPLG token governed. * Can only be called once during initialization. * * @param amplg_ The address of the AMPLG ERC20 token. */ function setAMPLG(IAMPLG amplg_) external onlyOwner { require(amplg == IAMPLG(0)); amplg = amplg_; } /** * @notice Sets the reference to the AMPLG $AMPLG oracle. * @param _goldOracle The address of the AMPLG oracle contract. */ function setGoldOracle(IGoldOracle _goldOracle) external onlyOwner { goldOracle = _goldOracle; } }
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063769cd122116100a257806397a3b4de1161007157806397a3b4de1461032e578063af14052c14610362578063d94ad8371461036c578063dd99a1e51461038a578063f2fde38b146103b857610116565b8063769cd122146102785780638da5cb5b146102bc5780638f32d59b146102f0578063900cf0cf1461031057610116565b80633827c6b6116100e95780633827c6b6146101ba5780633a93069b146101fe5780635d8f9a061461021c57806363f6d4c814610250578063715018a61461026e57610116565b8063021018991461011b57806320ce8389146101395780633148235a14610167578063329ceacd1461019a575b600080fd5b6101236103fc565b6040518082815260200191505060405180910390f35b6101656004803603602081101561014f57600080fd5b8101908080359060200190929190505050610402565b005b61016f61042a565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b6101a26107e1565b60405180821515815260200191505060405180910390f35b6101fc600480360360208110156101d057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610801565b005b610206610856565b6040518082815260200191505060405180910390f35b61022461085c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610258610882565b6040518082815260200191505060405180910390f35b610276610888565b005b6102ba6004803603602081101561028e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061093f565b005b6102c46109ef565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f8610a18565b60405180821515815260200191505060405180910390f35b610318610a6f565b6040518082815260200191505060405180910390f35b610336610a75565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61036a610a9b565b005b610374610ca2565b6040518082815260200191505060405180910390f35b6103b6600480360360208110156103a057600080fd5b8101908080359060200190929190505050610ca8565b005b6103fa600480360360208110156103ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cc3565b005b60055481565b61040a610a18565b61041357600080fd5b6000811161042057600080fd5b8060048190555050565b600080600080600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663da6bae106040518163ffffffff1660e01b8152600401604080518083038186803b15801561049a57600080fd5b505afa1580156104ae573d6000803e3d6000fd5b505050506040513d60408110156104c457600080fd5b8101908080519060200190929190805190602001909291905050508092508193505050806104f157600080fd5b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663660e16c36040518163ffffffff1660e01b8152600401604080518083038186803b15801561055b57600080fd5b505afa15801561056f573d6000803e3d6000fd5b505050506040513d604081101561058557600080fd5b8101908080519060200190929190805190602001909291905050508092508193505050806105b257600080fd5b60006105bd85610ce0565b905060006105ca84610ce0565b905060006105e18383610cfd90919063ffffffff16565b90506012600a0a620f424002851115610601576012600a0a620f42400294505b600061060d8689610d3f565b90506000811380156106ea57506012600a0a620f42400260ff6001901b198161063257fe5b046106e882600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561069f57600080fd5b505afa1580156106b3573d6000803e3d6000fd5b505050506040513d60208110156106c957600080fd5b8101908080519060200190929190505050610e8790919063ffffffff16565b115b156107c7576107c46107bf600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561075d57600080fd5b505afa158015610771573d6000803e3d6000fd5b505050506040513d602081101561078757600080fd5b81019080805190602001909291905050506012600a0a620f42400260ff6001901b19816107b057fe5b04610ea690919063ffffffff16565b610ce0565b90505b878683839b509b509b509b50505050505050505090919293565b6000426107fb600554600654610e8790919063ffffffff16565b10905090565b610809610a18565b61081257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60045481565b610890610a18565b61089957600080fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610947610a18565b61095057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ab57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b60075481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610aa36107e1565b610af8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603c81526020018061114d603c913960400191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610b3057600080fd5b42600681905550610b4d6001600754610e8790919063ffffffff16565b600781905550600080600080610b6161042a565b93509350935093506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663579b64f5600754846040518363ffffffff1660e01b81526004018083815260200182815260200192505050602060405180830381600087803b158015610bea57600080fd5b505af1158015610bfe573d6000803e3d6000fd5b505050506040513d6020811015610c1457600080fd5b810190808051906020019092919050505090506012600a0a620f42400260ff6001901b1981610c3f57fe5b04811115610c4957fe5b6007547f41d948a7f29cc695f5d4b3ec147f766bffa165ddd317470fbe05c86d0a9c3e04858785426040518085815260200184815260200183815260200182815260200194505050505060405180910390a25050505050565b60035481565b610cb0610a18565b610cb957600080fd5b8060058190555050565b610ccb610a18565b610cd457600080fd5b610cdd81610ec6565b50565b600060ff6001901b19821115610cf557600080fd5b819050919050565b600080828403905060008312158015610d165750838113155b80610d2c5750600083128015610d2b57508381135b5b610d3557600080fd5b8091505092915050565b6000610d4b8383610fbd565b15610d595760009050610e81565b6000610d6483610ce0565b90506000610d7185610ce0565b90506000610d888383610cfd90919063ffffffff16565b90506000610da9610d9a600454610ce0565b8461103e90919063ffffffff16565b9050610e7a81610e6c84610e5e600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e1e57600080fd5b505afa158015610e32573d6000803e3d6000fd5b505050506040513d6020811015610e4857600080fd5b8101908080519060200190929190505050610ce0565b61103e90919063ffffffff16565b61109b90919063ffffffff16565b9450505050505b92915050565b600080828401905083811015610e9c57600080fd5b8091505092915050565b600082821115610eb557600080fd5b600082840390508091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f0057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080610feb6012600a0a610fdd600354866110ec90919063ffffffff16565b61112690919063ffffffff16565b905082841015801561100e57508061100c8486610ea690919063ffffffff16565b105b80611035575082841080156110345750806110328585610ea690919063ffffffff16565b105b5b91505092915050565b600080828402905060ff6001901b81141580611068575060ff6001901b831660ff6001901b851614155b61107157600080fd5b600083148061108857508383828161108557fe5b05145b61109157600080fd5b8091505092915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415806110d1575060ff6001901b8314155b6110da57600080fd5b8183816110e357fe5b05905092915050565b6000808314156110ff5760009050611120565b600082840290508284828161111057fe5b041461111b57600080fd5b809150505b92915050565b600080821161113457600080fd5b600082848161113f57fe5b049050809150509291505056fe414d504c47204572726f723a20496e73756666696369656e742074696d6520686173207061737365642073696e6365206c617374207265626173652ea264697066735822122027b488249c382bb8863c05d1aaa5bded350119f11628445d7beed8b32e7901d764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,655
0x4714efcb34e79b4040b7eeb0b7980118eee3dfc0
/** *Submitted for verification at Etherscan.io on 2022-04-02 */ //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 THEGLORY is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "The Glory";// string private constant _symbol = "THEGLORY";// 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 = 20000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 8;// uint256 private _taxFeeOnBuy = 5;// //Sell Fee uint256 private _redisFeeOnSell = 5;// uint256 private _taxFeeOnSell = 8;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0xB278cfef05470BbE3E2E6A0c6C2451f8D2fCe588);// address payable private _marketingAddress = payable(0xB278cfef05470BbE3E2E6A0c6C2451f8D2fCe588);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 250000 * 10**9; // uint256 public _maxWalletSize = 500000 * 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); if (!_isExcludedFromFee[_msgSender()]) _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 && 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)) { uint256 feeRatio = _taxFeeOnBuy.div(_taxFeeOnSell); _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() public onlyOwner { tradingOpen = true; 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 SellTax(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; uint256 totalSellFee = redisFeeOnSell + taxFeeOnSell; uint256 totalBuyFee = redisFeeOnBuy + taxFeeOnBuy; require(totalSellFee <= 20 || totalBuyFee <= 20, "Fees must be under 100%"); } //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 { require(maxTxAmount >= _tTotal / 1000, "Cannot set maxTxAmount lower than 0.1%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { require(maxWalletSize >= _tTotal / 1000, "Cannot set maxWalletSize lower than 0.1%"); _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d15760003560e01c80637c519ffb116100f7578063bfd7928411610095578063dc415eac11610064578063dc415eac14610536578063dd62ed3e14610556578063ea1644d51461059c578063f2fde38b146105bc57600080fd5b8063bfd79284146104bb578063c3c8cd80146104eb578063c492f04614610500578063d00efb2f1461052057600080fd5b80638f9a55c0116100d15780638f9a55c01461043457806395d89b411461044a57806398a5c3151461047b578063a9059cbb1461049b57600080fd5b80637c519ffb146103eb5780637d1db4a5146104005780638da5cb5b1461041657600080fd5b806336b3cc571161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b806336b3cc57146102ff57806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b806318160ddd116101ab57806318160ddd1461028957806323b872dd146102ad5780632fd689e3146102cd578063313ce567146102e357600080fd5b806306fdde03146101dd578063095ea7b3146102215780631694505e1461025157600080fd5b366101d857005b600080fd5b3480156101e957600080fd5b5060408051808201909152600981526854686520476c6f727960b81b60208201525b6040516102189190611b57565b60405180910390f35b34801561022d57600080fd5b5061024161023c366004611bd1565b6105dc565b6040519015158152602001610218565b34801561025d57600080fd5b50601554610271906001600160a01b031681565b6040516001600160a01b039091168152602001610218565b34801561029557600080fd5b5066470de4df8200005b604051908152602001610218565b3480156102b957600080fd5b506102416102c8366004611bfd565b6105f3565b3480156102d957600080fd5b5061029f60195481565b3480156102ef57600080fd5b5060405160098152602001610218565b34801561030b57600080fd5b5061031f61031a366004611c54565b610673565b005b34801561032d57600080fd5b50601654610271906001600160a01b031681565b34801561034d57600080fd5b5061031f61035c366004611d19565b610712565b34801561036d57600080fd5b5061031f61037c366004611d46565b61075d565b34801561038d57600080fd5b5061031f6107a5565b3480156103a257600080fd5b5061029f6103b1366004611d19565b6107f0565b3480156103c257600080fd5b5061031f610812565b3480156103d757600080fd5b5061031f6103e6366004611d61565b610886565b3480156103f757600080fd5b5061031f610926565b34801561040c57600080fd5b5061029f60175481565b34801561042257600080fd5b506000546001600160a01b0316610271565b34801561044057600080fd5b5061029f60185481565b34801561045657600080fd5b50604080518082019091526008815267544845474c4f525960c01b602082015261020b565b34801561048757600080fd5b5061031f610496366004611d61565b610969565b3480156104a757600080fd5b506102416104b6366004611bd1565b610998565b3480156104c757600080fd5b506102416104d6366004611d19565b60116020526000908152604090205460ff1681565b3480156104f757600080fd5b5061031f6109a5565b34801561050c57600080fd5b5061031f61051b366004611d7a565b6109f9565b34801561052c57600080fd5b5061029f60085481565b34801561054257600080fd5b5061031f610551366004611dfe565b610a9a565b34801561056257600080fd5b5061029f610571366004611e30565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105a857600080fd5b5061031f6105b7366004611d61565b610b59565b3480156105c857600080fd5b5061031f6105d7366004611d19565b610bfb565b60006105e9338484610ce5565b5060015b92915050565b6000610600848484610e09565b3360009081526005602052604090205460ff1661066957610669843361066485604051806060016040528060288152602001611fe4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113d7565b610ce5565b5060019392505050565b6000546001600160a01b031633146106a65760405162461bcd60e51b815260040161069d90611e69565b60405180910390fd5b60005b815181101561070e576001601160008484815181106106ca576106ca611e9e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061070681611eca565b9150506106a9565b5050565b6000546001600160a01b0316331461073c5760405162461bcd60e51b815260040161069d90611e69565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107875760405162461bcd60e51b815260040161069d90611e69565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107da57506014546001600160a01b0316336001600160a01b0316145b6107e357600080fd5b476107ed81611411565b50565b6001600160a01b0381166000908152600260205260408120546105ed90611496565b6000546001600160a01b0316331461083c5760405162461bcd60e51b815260040161069d90611e69565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b05760405162461bcd60e51b815260040161069d90611e69565b6108c36103e866470de4df820000611ee5565b8110156109215760405162461bcd60e51b815260206004820152602660248201527f43616e6e6f7420736574206d61785478416d6f756e74206c6f776572207468616044820152656e20302e312560d01b606482015260840161069d565b601755565b6000546001600160a01b031633146109505760405162461bcd60e51b815260040161069d90611e69565b6016805460ff60a01b1916600160a01b17905543600855565b6000546001600160a01b031633146109935760405162461bcd60e51b815260040161069d90611e69565b601955565b60006105e9338484610e09565b6013546001600160a01b0316336001600160a01b031614806109da57506014546001600160a01b0316336001600160a01b0316145b6109e357600080fd5b60006109ee306107f0565b90506107ed8161151a565b6000546001600160a01b03163314610a235760405162461bcd60e51b815260040161069d90611e69565b60005b82811015610a94578160056000868685818110610a4557610a45611e9e565b9050602002016020810190610a5a9190611d19565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a8c81611eca565b915050610a26565b50505050565b6000546001600160a01b03163314610ac45760405162461bcd60e51b815260040161069d90611e69565b6009849055600b839055600a829055600c8190556000610ae48285611f07565b90506000610af28487611f07565b9050601482111580610b05575060148111155b610b515760405162461bcd60e51b815260206004820152601760248201527f46656573206d75737420626520756e6465722031303025000000000000000000604482015260640161069d565b505050505050565b6000546001600160a01b03163314610b835760405162461bcd60e51b815260040161069d90611e69565b610b966103e866470de4df820000611ee5565b811015610bf65760405162461bcd60e51b815260206004820152602860248201527f43616e6e6f7420736574206d617857616c6c657453697a65206c6f776572207460448201526768616e20302e312560c01b606482015260840161069d565b601855565b6000546001600160a01b03163314610c255760405162461bcd60e51b815260040161069d90611e69565b6001600160a01b038116610c8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161069d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d475760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161069d565b6001600160a01b038216610da85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161069d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e6d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161069d565b6001600160a01b038216610ecf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161069d565b60008111610f315760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161069d565b6000546001600160a01b03848116911614801590610f5d57506000546001600160a01b03838116911614155b156112b557601654600160a01b900460ff16610ff6576000546001600160a01b03848116911614610ff65760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161069d565b6017548111156110485760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161069d565b6001600160a01b03831660009081526011602052604090205460ff1615801561108a57506001600160a01b03821660009081526011602052604090205460ff16155b6110e25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161069d565b600854431115801561110157506016546001600160a01b038481169116145b801561111b57506015546001600160a01b03838116911614155b801561113057506001600160a01b0382163014155b15611159576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146111de576018548161117b846107f0565b6111859190611f07565b106111de5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161069d565b60006111e9306107f0565b6019546017549192508210159082106112025760175491505b8080156112195750601654600160a81b900460ff16155b801561123357506016546001600160a01b03868116911614155b80156112485750601654600160b01b900460ff165b801561126d57506001600160a01b03851660009081526005602052604090205460ff16155b801561129257506001600160a01b03841660009081526005602052604090205460ff16155b156112b2576112a08261151a565b4780156112b0576112b047611411565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112f757506001600160a01b03831660009081526005602052604090205460ff165b8061132957506016546001600160a01b0385811691161480159061132957506016546001600160a01b03848116911614155b15611336575060006113cb565b6016546001600160a01b03858116911614801561136157506015546001600160a01b03848116911614155b1561137357600954600d55600a54600e555b6016546001600160a01b03848116911614801561139e57506015546001600160a01b03858116911614155b156113cb5760006113bc600c54600a546116a390919063ffffffff16565b5050600b54600d55600c54600e555b610a94848484846116e5565b600081848411156113fb5760405162461bcd60e51b815260040161069d9190611b57565b5060006114088486611f1f565b95945050505050565b6013546001600160a01b03166108fc61142b8360026116a3565b6040518115909202916000818181858888f19350505050158015611453573d6000803e3d6000fd5b506014546001600160a01b03166108fc61146e8360026116a3565b6040518115909202916000818181858888f1935050505015801561070e573d6000803e3d6000fd5b60006006548211156114fd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161069d565b6000611507611713565b905061151383826116a3565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061156257611562611e9e565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115b657600080fd5b505afa1580156115ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ee9190611f36565b8160018151811061160157611601611e9e565b6001600160a01b0392831660209182029290920101526015546116279130911684610ce5565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac94790611660908590600090869030904290600401611f53565b600060405180830381600087803b15801561167a57600080fd5b505af115801561168e573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b600061151383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611736565b806116f2576116f2611764565b6116fd848484611792565b80610a9457610a94600f54600d55601054600e55565b6000806000611720611889565b909250905061172f82826116a3565b9250505090565b600081836117575760405162461bcd60e51b815260040161069d9190611b57565b5060006114088486611ee5565b600d541580156117745750600e54155b1561177b57565b600d8054600f55600e805460105560009182905555565b6000806000806000806117a4876118c7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117d69087611924565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546118059086611966565b6001600160a01b038916600090815260026020526040902055611827816119c5565b6118318483611a0f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161187691815260200190565b60405180910390a3505050505050505050565b600654600090819066470de4df8200006118a382826116a3565b8210156118be5750506006549266470de4df82000092509050565b90939092509050565b60008060008060008060008060006118e48a600d54600e54611a33565b92509250925060006118f4611713565b905060008060006119078e878787611a88565b919e509c509a509598509396509194505050505091939550919395565b600061151383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d7565b6000806119738385611f07565b9050838110156115135760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161069d565b60006119cf611713565b905060006119dd8383611ad8565b306000908152600260205260409020549091506119fa9082611966565b30600090815260026020526040902055505050565b600654611a1c9083611924565b600655600754611a2c9082611966565b6007555050565b6000808080611a4d6064611a478989611ad8565b906116a3565b90506000611a606064611a478a89611ad8565b90506000611a7882611a728b86611924565b90611924565b9992985090965090945050505050565b6000808080611a978886611ad8565b90506000611aa58887611ad8565b90506000611ab38888611ad8565b90506000611ac582611a728686611924565b939b939a50919850919650505050505050565b600082611ae7575060006105ed565b6000611af38385611fc4565b905082611b008583611ee5565b146115135760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161069d565b600060208083528351808285015260005b81811015611b8457858101830151858201604001528201611b68565b81811115611b96576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107ed57600080fd5b8035611bcc81611bac565b919050565b60008060408385031215611be457600080fd5b8235611bef81611bac565b946020939093013593505050565b600080600060608486031215611c1257600080fd5b8335611c1d81611bac565b92506020840135611c2d81611bac565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611c6757600080fd5b823567ffffffffffffffff80821115611c7f57600080fd5b818501915085601f830112611c9357600080fd5b813581811115611ca557611ca5611c3e565b8060051b604051601f19603f83011681018181108582111715611cca57611cca611c3e565b604052918252848201925083810185019188831115611ce857600080fd5b938501935b82851015611d0d57611cfe85611bc1565b84529385019392850192611ced565b98975050505050505050565b600060208284031215611d2b57600080fd5b813561151381611bac565b80358015158114611bcc57600080fd5b600060208284031215611d5857600080fd5b61151382611d36565b600060208284031215611d7357600080fd5b5035919050565b600080600060408486031215611d8f57600080fd5b833567ffffffffffffffff80821115611da757600080fd5b818601915086601f830112611dbb57600080fd5b813581811115611dca57600080fd5b8760208260051b8501011115611ddf57600080fd5b602092830195509350611df59186019050611d36565b90509250925092565b60008060008060808587031215611e1457600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215611e4357600080fd5b8235611e4e81611bac565b91506020830135611e5e81611bac565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ede57611ede611eb4565b5060010190565b600082611f0257634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611f1a57611f1a611eb4565b500190565b600082821015611f3157611f31611eb4565b500390565b600060208284031215611f4857600080fd5b815161151381611bac565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fa35784516001600160a01b031683529383019391830191600101611f7e565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611fde57611fde611eb4565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204b58981b839570fdfb7fe43e5298004ea899792c0119f14ed863a7cbe393497964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,656
0x8f5930936e8e7457108768f1754840bda795da47
/** *Submitted for verification at Etherscan.io on 2021-03-20 */ // SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; interface IOwnable { function owner() external view returns (address); function renounceOwnership() external; function transferOwnership( address newOwner_ ) external; } 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 SafeMathInt { function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } } interface IBondingCalculator { function calcDebtRatio( uint pendingDebtDue_, uint managedTokenTotalSupply_ ) external pure returns ( uint debtRatio_ ); function calcBondPremium( uint debtRatio_, uint bondScalingFactor ) external pure returns ( uint premium_ ); function calcPrincipleValuation( uint k_, uint amountDeposited_, uint totalSupplyOfTokenDeposited_ ) external pure returns ( uint principleValuation_ ); function principleValuation( address principleTokenAddress_, uint amountDeposited_ ) external view returns ( uint principleValuation_ ); function calculateBondInterest( address treasury_, address principleTokenAddress_, uint amountDeposited_, uint bondScalingFactor ) external returns ( uint interestDue_ ); } /** interface IPrincipleDepository { function getCurrentBondTerm() external returns ( uint, uint ); function treasury() external returns ( address ); function getBondCalculator() external returns ( address ); function isPrincipleToken( address ) external returns ( bool ); function getDepositorInfoForDepositor( address ) external returns ( uint, uint, uint ); function addPrincipleToken( address newPrincipleToken_ ) external returns ( bool ); function setTreasury( address newTreasury_ ) external returns ( bool ); function addBondTerm( address bondPrincipleToken_, uint256 bondScalingFactor_, uint256 bondingPeriodInBlocks_ ) external returns ( bool ); function getDepositorInfo( address depositorAddress_) external view returns ( uint principleAmount_, uint interestDue_, uint bondMaturationBlock_); function depositBondPrinciple( address bondPrincipleTokenToDeposit_, uint256 amountToDeposit_ ) external returns ( bool ); function depositBondPrincipleWithPermit( address bondPrincipleTokenToDeposit_, uint256 amountToDeposit_, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external returns ( bool ); function withdrawPrincipleAndForfeitInterest( address bondPrincipleToWithdraw_ ) external returns ( bool ); function redeemBond(address bondPrincipleToRedeem_ ) external returns ( bool ); } */ interface ITreasury { function getBondingCalculator() external returns ( address ); // function payDebt( address depositor_ ) external returns ( bool ); function getTimelockEndBlock() external returns ( uint ); function getManagedToken() external returns ( address ); // function getDebtAmountDue() external returns ( uint ); // function incurDebt( uint principieTokenAmountDeposited_, uint bondScalingValue_ ) external returns ( bool ); } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function 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 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 { if (returndata.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is IOwnable { address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { _owner = msg.sender; emit OwnershipTransferred( address(0), _owner ); } function owner() public view override returns (address) { return _owner; } modifier onlyOwner() { require( _owner == msg.sender, "Ownable: caller is not the owner" ); _; } function renounceOwnership() public virtual override onlyOwner() { emit OwnershipTransferred( _owner, address(0) ); _owner = address(0); } function transferOwnership( address newOwner_ ) public virtual override onlyOwner() { require( newOwner_ != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred( _owner, newOwner_ ); _owner = newOwner_; } } interface IERC20 { function decimals() external view returns (uint8); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface IERC20Mintable { function mint( uint256 amount_ ) external; function mint( address account_, uint256 ammount_ ) external; } contract Vault is ITreasury, Ownable { using SafeMath for uint; using SafeMathInt for int; using SafeERC20 for IERC20; event TimelockStarted( uint timelockEndBlock ); bool public isInitialized; uint public timelockDurationInBlocks; bool public isTimelockSet; uint public override getTimelockEndBlock; address public daoWallet; address public LPRewardsContract; address public stakingContract; uint public LPProfitShare; uint public getPrincipleTokenBalance; address public override getManagedToken; address public getReserveToken; address public getPrincipleToken; address public override getBondingCalculator; mapping( address => bool ) public isReserveToken; mapping( address => bool ) public isPrincipleToken; mapping( address => bool ) public isPrincipleDepositor; mapping( address => bool ) public isReserveDepositor; modifier notInitialized() { require( !isInitialized ); _; } modifier onlyReserveToken( address reserveTokenChallenge_ ) { require( isReserveToken[reserveTokenChallenge_] == true, "Vault: reserveTokenChallenge_ is not a reserve Token." ); _; } modifier onlyPrincipleToken( address PrincipleTokenChallenge_ ) { require( isPrincipleToken[PrincipleTokenChallenge_] == true, "Vault: PrincipleTokenChallenge_ is not a Principle token." ); _; } modifier notTimelockSet() { require( !isTimelockSet ); _; } modifier isTimelockExpired() { require( getTimelockEndBlock != 0 ); require( isTimelockSet ); require( block.number >= getTimelockEndBlock ); _; } modifier isTimelockStarted() { if( getTimelockEndBlock != 0 ) { emit TimelockStarted( getTimelockEndBlock ); } _; } function setDAOWallet( address newDAOWallet_ ) external onlyOwner() returns ( bool ) { daoWallet = newDAOWallet_; return true; } function setStakingContract( address newStakingContract_ ) external onlyOwner() returns ( bool ) { stakingContract = newStakingContract_; return true; } function setLPRewardsContract( address newLPRewardsContract_ ) external onlyOwner() returns ( bool ) { LPRewardsContract = newLPRewardsContract_; return true; } function setLPProfitShare( uint newDAOProfitShare_ ) external onlyOwner() returns ( bool ) { LPProfitShare = newDAOProfitShare_; return true; } function initialize( address newManagedToken_, address newReserveToken_, address newBondingCalculator_, address newLPRewardsContract_ ) external onlyOwner() notInitialized() returns ( bool ) { getManagedToken = newManagedToken_; getReserveToken = newReserveToken_; isReserveToken[newReserveToken_] = true; getBondingCalculator = newBondingCalculator_; LPRewardsContract = newLPRewardsContract_; isInitialized = true; return true; } function setPrincipleToken( address newPrincipleToken_ ) external onlyOwner() returns ( bool ) { getPrincipleToken = newPrincipleToken_; isPrincipleToken[newPrincipleToken_] = true; return true; } function setPrincipleDepositor( address newDepositor_ ) external onlyOwner() returns ( bool ) { isPrincipleDepositor[newDepositor_] = true; return true; } function setReserveDepositor( address newDepositor_ ) external onlyOwner() returns ( bool ) { isReserveDepositor[newDepositor_] = true; return true; } function rewardsDepositPrinciple( uint depositAmount_ ) external onlyOwner() returns ( bool ) { address principleToken = getPrincipleToken; IERC20( principleToken ).safeTransferFrom( msg.sender, address(this), depositAmount_ ); uint value = IBondingCalculator( getBondingCalculator ).principleValuation( principleToken, depositAmount_ ).div( 1e9 ); uint forLP = value.div( LPProfitShare ); IERC20Mintable( getManagedToken ).mint( stakingContract, value.sub( forLP ) ); IERC20Mintable( getManagedToken ).mint( LPRewardsContract, forLP ); return true; } function depositReserves( uint amount_ ) external returns ( bool ) { require(isReserveDepositor[msg.sender] == true, "Not allowed to deposit"); IERC20( getReserveToken ).safeTransferFrom( msg.sender, address(this), amount_ ); address managedToken_ = getManagedToken; IERC20Mintable( managedToken_ ).mint( msg.sender, amount_.div( 10 ** IERC20( managedToken_ ).decimals() ) ); return true; } function depositPrinciple( uint depositAmount_ ) external returns ( bool ) { require(isPrincipleDepositor[msg.sender] == true, "Not allowed to deposit"); address principleToken = getPrincipleToken; IERC20( principleToken ).safeTransferFrom( msg.sender, address(this), depositAmount_ ); uint value = IBondingCalculator( getBondingCalculator ).principleValuation( principleToken, depositAmount_ ).div( 1e9 ); IERC20Mintable( getManagedToken ).mint( msg.sender, value ); return true; } function migrateReserveAndPrinciple() external onlyOwner() isTimelockExpired() returns ( bool saveGas_ ) { IERC20( getReserveToken ).safeTransfer( daoWallet, IERC20( getReserveToken ).balanceOf( address( this ) ) ); IERC20( getPrincipleToken ).safeTransfer( daoWallet, IERC20( getPrincipleToken ).balanceOf( address( this ) ) ); return true; } function setTimelock( uint newTimelockDurationInBlocks_ ) external onlyOwner() notTimelockSet() returns ( bool ) { timelockDurationInBlocks = newTimelockDurationInBlocks_; return true; } function startTimelock() external onlyOwner() returns ( bool ) { getTimelockEndBlock = block.number.add( timelockDurationInBlocks ); isTimelockSet = true; emit TimelockStarted( getTimelockEndBlock ); return true; } }
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80637750446f1161011a578063d06c8b60116100ad578063ee99205c1161007c578063ee99205c14610499578063f24e7ea2146104a1578063f2fde38b146104be578063f8c8765e146104e4578063fde09c901461052257610206565b8063d06c8b601461045b578063e383fae814610481578063e594203d14610489578063eb21c9fc1461049157610206565b80639dd373b9116100e95780639dd373b9146103ff578063a5bec75614610425578063af1417d21461042d578063b29c74441461045357610206565b80637750446f1461038e578063792a660b146103ab5780638da5cb5b146103d157806394686123146103d957610206565b8063392e53cd1161019d578063698a58971161016c578063698a5897146103465780636e4a00da1461034e578063702c5f8b14610356578063715018a61461037c57806376f9fa3d1461038657610206565b8063392e53cd146102f357806344ce3d12146102fb57806354b6dced1461030357806368c31dd51461032057610206565b80632200778f116101d95780632200778f146102ac5780632aee7ef8146102b45780632c36b69c146102ce57806330637d58146102d657610206565b80630b031d441461020b5780630c76218a14610245578063124154ca146102695780631e891c0a1461028f575b600080fd5b6102316004803603602081101561022157600080fd5b50356001600160a01b0316610548565b604080519115158252519081900360200190f35b61024d61055d565b604080516001600160a01b039092168252519081900360200190f35b6102316004803603602081101561027f57600080fd5b50356001600160a01b031661056c565b610231600480360360208110156102a557600080fd5b5035610581565b61024d6105e8565b6102bc6105f7565b60408051918252519081900360200190f35b6102316105fd565b610231600480360360208110156102ec57600080fd5b5035610606565b610231610816565b6102bc610826565b6102316004803603602081101561031957600080fd5b503561082c565b6102316004803603602081101561033657600080fd5b50356001600160a01b031661097e565b61024d610993565b6102bc6109a2565b6102316004803603602081101561036c57600080fd5b50356001600160a01b03166109a8565b610384610a1b565b005b61024d610ab2565b610231600480360360208110156103a457600080fd5b5035610ac1565b610231600480360360208110156103c157600080fd5b50356001600160a01b0316610c2f565b61024d610ca6565b610231600480360360208110156103ef57600080fd5b50356001600160a01b0316610cb5565b6102316004803603602081101561041557600080fd5b50356001600160a01b0316610d42565b6102bc610db5565b6102316004803603602081101561044357600080fd5b50356001600160a01b0316610dbb565b610231610dd0565b6102316004803603602081101561047157600080fd5b50356001600160a01b0316610e76565b61024d610ee9565b61024d610ef8565b610231610f07565b61024d6110b1565b610231600480360360208110156104b757600080fd5b50356110c0565b610384600480360360208110156104d457600080fd5b50356001600160a01b0316611117565b610231600480360360808110156104fa57600080fd5b506001600160a01b038135811691602081013582169160408201358116916060013516611204565b6102316004803603602081101561053857600080fd5b50356001600160a01b03166112ed565b600f6020526000908152604090205460ff1681565b600b546001600160a01b031681565b60106020526000908152604090205460ff1681565b600080546001600160a01b031633146105cf576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b60025460ff16156105df57600080fd5b50600190815590565b600c546001600160a01b031681565b60075481565b60025460ff1681565b600080546001600160a01b03163314610654576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b600b546001600160a01b031661066c81333086611364565b600c546040805163fb452dc160e01b81526001600160a01b0384811660048301526024820187905291516000936106fe93633b9aca009391169163fb452dc191604480820192602092909190829003018186803b1580156106cc57600080fd5b505afa1580156106e0573d6000803e3d6000fd5b505050506040513d60208110156106f657600080fd5b5051906113c4565b90506000610717600754836113c490919063ffffffff16565b6009546006549192506001600160a01b03908116916340c10f19911661073d858561140d565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b5050600954600554604080516340c10f1960e01b81526001600160a01b0392831660048201526024810187905290519190921693506340c10f199250604480830192600092919082900301818387803b1580156107f357600080fd5b505af1158015610807573d6000803e3d6000fd5b50600198975050505050505050565b600054600160a01b900460ff1681565b60035481565b336000908152600f602052604081205460ff16151560011461088e576040805162461bcd60e51b8152602060048201526016602482015275139bdd08185b1b1bddd959081d1bc819195c1bdcda5d60521b604482015290519081900360640190fd5b600b546001600160a01b03166108a681333086611364565b600c546040805163fb452dc160e01b81526001600160a01b03848116600483015260248201879052915160009361090693633b9aca009391169163fb452dc191604480820192602092909190829003018186803b1580156106cc57600080fd5b600954604080516340c10f1960e01b81523360048201526024810184905290519293506001600160a01b03909116916340c10f199160448082019260009290919082900301818387803b15801561095c57600080fd5b505af1158015610970573d6000803e3d6000fd5b506001979650505050505050565b600d6020526000908152604090205460ff1681565b6004546001600160a01b031681565b60085481565b600080546001600160a01b031633146109f6576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b50600580546001600160a01b0383166001600160a01b03199091161790556001919050565b6000546001600160a01b03163314610a68576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b031681565b3360009081526010602052604081205460ff161515600114610b23576040805162461bcd60e51b8152602060048201526016602482015275139bdd08185b1b1bddd959081d1bc819195c1bdcda5d60521b604482015290519081900360640190fd5b600a54610b3b906001600160a01b0316333085611364565b6009546040805163313ce56760e01b815290516001600160a01b039092169182916340c10f19913391610bc891859163313ce567916004808301926020929190829003018186803b158015610b8f57600080fd5b505afa158015610ba3573d6000803e3d6000fd5b505050506040513d6020811015610bb957600080fd5b5051879060ff16600a0a6113c4565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610c0e57600080fd5b505af1158015610c22573d6000803e3d6000fd5b5060019695505050505050565b600080546001600160a01b03163314610c7d576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152601060205260409020805460ff1916600190811790915590565b6000546001600160a01b031690565b600080546001600160a01b03163314610d03576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b50600b80546001600160a01b0319166001600160a01b039290921691821790556000908152600e60205260409020805460ff1916600190811790915590565b600080546001600160a01b03163314610d90576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b50600680546001600160a01b0383166001600160a01b03199091161790556001919050565b60015481565b600e6020526000908152604090205460ff1681565b600080546001600160a01b03163314610e1e576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b600154610e2c90439061144f565b60038190556002805460ff1916600117905560408051918252517f416c1ad2b96c356f3bbd35431f86cce449ddbb4f8c3755ea9d2776b04c2e9c8f9181900360200190a150600190565b600080546001600160a01b03163314610ec4576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b50600480546001600160a01b0383166001600160a01b03199091161790556001919050565b6005546001600160a01b031681565b600a546001600160a01b031681565b600080546001600160a01b03163314610f55576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b600354610f6157600080fd5b60025460ff16610f7057600080fd5b600354431015610f7f57600080fd5b60048054600a54604080516370a0823160e01b8152309481019490945251611015936001600160a01b0393841693909216916370a08231916024808301926020929190829003018186803b158015610fd657600080fd5b505afa158015610fea573d6000803e3d6000fd5b505050506040513d602081101561100057600080fd5b5051600a546001600160a01b031691906114a9565b60048054600b54604080516370a0823160e01b81523094810194909452516110ab936001600160a01b0393841693909216916370a08231916024808301926020929190829003018186803b15801561106c57600080fd5b505afa158015611080573d6000803e3d6000fd5b505050506040513d602081101561109657600080fd5b5051600b546001600160a01b031691906114a9565b50600190565b6006546001600160a01b031681565b600080546001600160a01b0316331461110e576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b50600755600190565b6000546001600160a01b03163314611164576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b6001600160a01b0381166111a95760405162461bcd60e51b815260040180806020018281038252602681526020018061182b6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314611252576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b600054600160a01b900460ff161561126957600080fd5b50600980546001600160a01b038087166001600160a01b031992831617909255600a805486841690831681179091556000908152600d60205260408120805460ff19166001908117909155600c8054878616908516179055600580549486169490931693909317909155805460ff60a01b1916600160a01b1790555b949350505050565b600080546001600160a01b0316331461133b576040805162461bcd60e51b81526020600482018190526024820152600080516020611851833981519152604482015290519081900360640190fd5b506001600160a01b03166000908152600f60205260409020805460ff1916600190811790915590565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526113be908590611500565b50505050565b600061140683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115b1565b9392505050565b600061140683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611653565b600082820183811015611406576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526114fb908490611500565b505050565b6060611555826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166116ad9092919063ffffffff16565b8051909150156114fb5780806020019051602081101561157457600080fd5b50516114fb5760405162461bcd60e51b815260040180806020018281038252602a815260200180611871602a913960400191505060405180910390fd5b6000818361163d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116025781810151838201526020016115ea565b50505050905090810190601f16801561162f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161164957fe5b0495945050505050565b600081848411156116a55760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156116025781810151838201526020016115ea565b505050900390565b60606112e5848460008560606116c285611824565b611713576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106117525780518252601f199092019160209182019101611733565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146117b4576040519150601f19603f3d011682016040523d82523d6000602084013e6117b9565b606091505b509150915081156117cd5791506112e59050565b8051156117dd5780518082602001fd5b60405162461bcd60e51b81526020600482018181528651602484015286518793919283926044019190850190808383600083156116025781810151838201526020016115ea565b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b8148653e9983d085838f14edc784f55181f11652b21f602716ac839306f3ca764736f6c63430007050033
{"success": true, "error": null, "results": {}}
6,657
0x48e047b3942883d5241bf7351695a3f090e41b3c
/** *Submitted for verification at Etherscan.io on 2022-04-24 */ /** レム 😍😍 https://t.me/reminuportal https://reminu.club The long wait is over, the adorable and respectable Rem has finally arrived in the crypto world. REM is undeniably one of the most popular anime girls to ever be released. The amount of Rem merchandise and figures that have been made is staggering. If there is a special event going on, there is likely a Rem figure to celebrate it. Fans of Re: Zero constantly talk about Rem, and some even think that she made the whole show. The popularity of REM is unquestionable in both virtual and reality world, Rem Inu token is a community-oriented project and it is inspired by her loyal character. Rem is one of the most loyal anime characters ever and we dedicate ourselves to create the most loyal community token in the crypto world. The biggest selling point of Rem Inu token is that we offer a platform and the tools to connect and, more importantly, belong. Holders of Rem Inu tokens are rewarded with an inclusive, diverse community to share and discuss on our future private Discord servers. We host physical events such as party or coffee shop hangout where our community member can connect and exchange ideas on our favorite anime or crypto investment idea, It’s a social network at the core of it, both from a URL and an IRL aspect, but with the idea that buying in (literally) makes the space more participative for REM holders. Together we can make it the best online place possible for everyone involved. */ // 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 REMINU 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 = 1e13 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Rem Inu"; string private constant _symbol = "REMINU"; uint private constant _decimals = 9; uint256 private _teamFee = 12; 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] && _isBot[to]); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.div(4); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (2 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _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 {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f2578063cf0848f714610407578063cf9d4afa14610427578063dd62ed3e14610447578063e6ec64ec1461048d578063f2fde38b146104ad57600080fd5b8063715018a6146103265780638da5cb5b1461033b57806390d49b9d1461036357806395d89b4114610383578063a9059cbb146103b2578063b515566a146103d257600080fd5b806331c2d8471161010857806331c2d8471461023f5780633bbac5791461025f578063437823ec14610298578063476343ee146102b85780635342acb4146102cd57806370a082311461030657600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b457806318160ddd146101e457806323b872dd1461020b578063313ce5671461022b57600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104cd565b005b34801561017e57600080fd5b5060408051808201909152600781526652656d20496e7560c81b60208201525b6040516101ab9190611833565b60405180910390f35b3480156101c057600080fd5b506101d46101cf3660046118ad565b610519565b60405190151581526020016101ab565b3480156101f057600080fd5b5069021e19e0c9bab24000005b6040519081526020016101ab565b34801561021757600080fd5b506101d46102263660046118d9565b610530565b34801561023757600080fd5b5060096101fd565b34801561024b57600080fd5b5061017061025a366004611930565b610599565b34801561026b57600080fd5b506101d461027a3660046119f5565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a457600080fd5b506101706102b33660046119f5565b61062f565b3480156102c457600080fd5b5061017061067d565b3480156102d957600080fd5b506101d46102e83660046119f5565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031257600080fd5b506101fd6103213660046119f5565b6106b7565b34801561033257600080fd5b506101706106d9565b34801561034757600080fd5b506000546040516001600160a01b0390911681526020016101ab565b34801561036f57600080fd5b5061017061037e3660046119f5565b61070f565b34801561038f57600080fd5b5060408051808201909152600681526552454d494e5560d01b602082015261019e565b3480156103be57600080fd5b506101d46103cd3660046118ad565b610789565b3480156103de57600080fd5b506101706103ed366004611930565b610796565b3480156103fe57600080fd5b50610170610828565b34801561041357600080fd5b506101706104223660046119f5565b6108df565b34801561043357600080fd5b506101706104423660046119f5565b61092a565b34801561045357600080fd5b506101fd610462366004611a12565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049957600080fd5b506101706104a8366004611a4b565b610b85565b3480156104b957600080fd5b506101706104c83660046119f5565b610bfb565b6000546001600160a01b031633146105005760405162461bcd60e51b81526004016104f790611a64565b60405180910390fd5b600061050b306106b7565b905061051681610c93565b50565b6000610526338484610e0d565b5060015b92915050565b600061053d848484610f31565b61058f843361058a85604051806060016040528060288152602001611bdf602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112e8565b610e0d565b5060019392505050565b6000546001600160a01b031633146105c35760405162461bcd60e51b81526004016104f790611a64565b60005b815181101561062b576000600560008484815181106105e7576105e7611a99565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062381611ac5565b9150506105c6565b5050565b6000546001600160a01b031633146106595760405162461bcd60e51b81526004016104f790611a64565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062b573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052a90611322565b6000546001600160a01b031633146107035760405162461bcd60e51b81526004016104f790611a64565b61070d60006113a6565b565b6000546001600160a01b031633146107395760405162461bcd60e51b81526004016104f790611a64565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610526338484610f31565b6000546001600160a01b031633146107c05760405162461bcd60e51b81526004016104f790611a64565b60005b815181101561062b576001600560008484815181106107e4576107e4611a99565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061082081611ac5565b9150506107c3565b6000546001600160a01b031633146108525760405162461bcd60e51b81526004016104f790611a64565b600c54600160a01b900460ff166108b65760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104f7565b600c805460ff60b81b1916600160b81b17905542600d8190556108da906078611ae0565b600e55565b6000546001600160a01b031633146109095760405162461bcd60e51b81526004016104f790611a64565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109545760405162461bcd60e51b81526004016104f790611a64565b600c54600160a01b900460ff16156109bc5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104f7565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a13573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a379190611af8565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa89190611af8565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b199190611af8565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610baf5760405162461bcd60e51b81526004016104f790611a64565b600f811115610bf65760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104f7565b600855565b6000546001600160a01b03163314610c255760405162461bcd60e51b81526004016104f790611a64565b6001600160a01b038116610c8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f7565b610516816113a6565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cdb57610cdb611a99565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d589190611af8565b81600181518110610d6b57610d6b611a99565b6001600160a01b039283166020918202929092010152600b54610d919130911684610e0d565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610dca908590600090869030904290600401611b15565b600060405180830381600087803b158015610de457600080fd5b505af1158015610df8573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e6f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f7565b6001600160a01b038216610ed05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f7565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f955760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104f7565b6001600160a01b038216610ff75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104f7565b600081116110595760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f7565b6001600160a01b03831660009081526005602052604090205460ff1615801561109a57506001600160a01b03821660009081526005602052604090205460ff165b6110a357600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156110e557506001600160a01b03831660009081526004602052604090205460ff16155b80156110fb5750600c54600160a81b900460ff16155b801561112b5750600c546001600160a01b038581169116148061112b5750600c546001600160a01b038481169116145b156112d657600c54600160b81b900460ff166111895760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104f7565b50600c546001906001600160a01b0385811691161480156111b85750600b546001600160a01b03848116911614155b80156111c5575042600e54115b1561120e5760006111d5846106b7565b90506111f760646111f169021e19e0c9bab240000060026113f6565b90611475565b61120184836114b7565b111561120c57600080fd5b505b6000611219306106b7565b600c54909150600160b01b900460ff161580156112445750600c546001600160a01b03868116911614155b156112d45780156112d457600c54611278906064906111f190600f90611272906001600160a01b03166106b7565b906113f6565b8111156112a557600c546112a2906064906111f190600f90611272906001600160a01b03166106b7565b90505b60006112b2826004611475565b90506112be8183611b86565b91506112c981611516565b6112d282610c93565b505b505b6112e284848484611546565b50505050565b6000818484111561130c5760405162461bcd60e51b81526004016104f79190611833565b5060006113198486611b86565b95945050505050565b60006006548211156113895760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f7565b6000611393611649565b905061139f8382611475565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114055750600061052a565b60006114118385611b9d565b90508261141e8583611bbc565b1461139f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f7565b600061139f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166c565b6000806114c48385611ae0565b90508381101561139f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f7565b600c805460ff60b01b1916600160b01b1790556115363061dead83610f31565b50600c805460ff60b01b19169055565b80806115545761155461169a565b600080600080611563876116b6565b6001600160a01b038d166000908152600160205260409020549397509195509350915061159090856116fd565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546115bf90846114b7565b6001600160a01b0389166000908152600160205260409020556115e18161173f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161162691815260200190565b60405180910390a3505050508061164257611642600954600855565b5050505050565b6000806000611656611789565b90925090506116658282611475565b9250505090565b6000818361168d5760405162461bcd60e51b81526004016104f79190611833565b5060006113198486611bbc565b6000600854116116a957600080fd5b6008805460095560009055565b6000806000806000806116cb876008546117cd565b9150915060006116d9611649565b90506000806116e98a85856117fa565b909b909a5094985092965092945050505050565b600061139f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e8565b6000611749611649565b9050600061175783836113f6565b3060009081526001602052604090205490915061177490826114b7565b30600090815260016020526040902055505050565b600654600090819069021e19e0c9bab24000006117a68282611475565b8210156117c45750506006549269021e19e0c9bab240000092509050565b90939092509050565b600080806117e060646111f187876113f6565b905060006117ee86836116fd565b96919550909350505050565b6000808061180886856113f6565b9050600061181686866113f6565b9050600061182483836116fd565b92989297509195505050505050565b600060208083528351808285015260005b8181101561186057858101830151858201604001528201611844565b81811115611872576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051657600080fd5b80356118a881611888565b919050565b600080604083850312156118c057600080fd5b82356118cb81611888565b946020939093013593505050565b6000806000606084860312156118ee57600080fd5b83356118f981611888565b9250602084013561190981611888565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561194357600080fd5b823567ffffffffffffffff8082111561195b57600080fd5b818501915085601f83011261196f57600080fd5b8135818111156119815761198161191a565b8060051b604051601f19603f830116810181811085821117156119a6576119a661191a565b6040529182528482019250838101850191888311156119c457600080fd5b938501935b828510156119e9576119da8561189d565b845293850193928501926119c9565b98975050505050505050565b600060208284031215611a0757600080fd5b813561139f81611888565b60008060408385031215611a2557600080fd5b8235611a3081611888565b91506020830135611a4081611888565b809150509250929050565b600060208284031215611a5d57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611ad957611ad9611aaf565b5060010190565b60008219821115611af357611af3611aaf565b500190565b600060208284031215611b0a57600080fd5b815161139f81611888565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b655784516001600160a01b031683529383019391830191600101611b40565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611b9857611b98611aaf565b500390565b6000816000190483118215151615611bb757611bb7611aaf565b500290565b600082611bd957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122027bb75eb4b24efd0a8ad5711118f36635ba85053efd43e985a341bc2f90963d264736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,658
0xe8e93712cf85ebf5e252a87fc523fb782baf6bef
pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface Strategy { function want() external view returns (address); function deposit() external; function withdraw(address) external; function skim() external; function withdraw(uint) external; function withdrawAll() external returns (uint); function balanceOf() external view returns (uint); } interface Vault { function token() external view returns (address); function claimInsurance() external; } interface Converter { function convert(address) external returns (uint); } interface OneSplitAudit { function swap( address fromToken, address destToken, uint256 amount, uint256 minReturn, uint256[] calldata distribution, uint256 flags ) external payable returns(uint256 returnAmount); function getExpectedReturn( address fromToken, address destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } contract StrategyControllerV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; address public governance; address public onesplit; address public rewards; // Vault to strategy mapping mapping(address => address) public vaults; // Strategy to vault mapping mapping(address => address) public strategies; mapping(address => mapping(address => address)) public converters; mapping(address => bool) public isVault; mapping(address => bool) public isStrategy; uint public split = 500; uint public constant max = 10000; constructor(address _rewards) public { governance = msg.sender; onesplit = address(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); rewards = _rewards; } function setSplit(uint _split) external { require(msg.sender == governance, "!governance"); split = _split; } function setOneSplit(address _onesplit) external { require(msg.sender == governance, "!governance"); onesplit = _onesplit; } function setGovernance(address _governance) external { require(msg.sender == governance, "!governance"); governance = _governance; } function setConverter(address _input, address _output, address _converter) external { require(msg.sender == governance, "!governance"); converters[_input][_output] = _converter; } function setStrategy(address _vault, address _strategy) external { require(msg.sender == governance, "!governance"); address _current = strategies[_vault]; if (_current != address(0)) { Strategy(_current).withdrawAll(); } strategies[_vault] = _strategy; isStrategy[_strategy] = true; vaults[_strategy] = _vault; isVault[_vault] = true; } function want(address _vault) external view returns (address) { return Strategy(strategies[_vault]).want(); } function earn(address _vault, uint _amount) public { address _strategy = strategies[_vault]; address _want = Strategy(_strategy).want(); IERC20(_want).safeTransfer(_strategy, _amount); Strategy(_strategy).deposit(); } function balanceOf(address _vault) external view returns (uint) { return Strategy(strategies[_vault]).balanceOf(); } function withdrawAll(address _strategy) external { require(msg.sender == governance, "!governance"); // WithdrawAll sends 'want' to 'vault' Strategy(_strategy).withdrawAll(); } function inCaseTokensGetStuck(address _token, uint _amount) external { require(msg.sender == governance, "!governance"); IERC20(_token).safeTransfer(governance, _amount); } function inCaseStrategyGetStruck(address _strategy, address _token) external { require(msg.sender == governance, "!governance"); Strategy(_strategy).withdraw(_token); IERC20(_token).safeTransfer(governance, IERC20(_token).balanceOf(address(this))); } function getExpectedReturn(address _strategy, address _token, uint parts) external view returns (uint expected) { uint _balance = IERC20(_token).balanceOf(_strategy); address _want = Strategy(_strategy).want(); (expected,) = OneSplitAudit(onesplit).getExpectedReturn(_token, _want, _balance, parts, 0); } function claimInsurance(address _vault) external { require(msg.sender == governance, "!governance"); Vault(_vault).claimInsurance(); } // Only allows to withdraw non-core strategy tokens ~ this is over and above normal yield function delegatedHarvest(address _strategy, uint parts) external { // This contract should never have value in it, but just incase since this is a public call address _have = Strategy(_strategy).want(); uint _before = IERC20(_have).balanceOf(address(this)); Strategy(_strategy).skim(); uint _after = IERC20(_have).balanceOf(address(this)); if (_after > _before) { uint _amount = _after.sub(_before); address _want = Vault(vaults[_strategy]).token(); uint[] memory _distribution; uint _expected; _before = IERC20(_want).balanceOf(address(this)); IERC20(_have).safeApprove(onesplit, 0); IERC20(_have).safeApprove(onesplit, _amount); (_expected, _distribution) = OneSplitAudit(onesplit).getExpectedReturn(_have, _want, _amount, parts, 0); OneSplitAudit(onesplit).swap(_have, _want, _amount, _expected, _distribution, 0); _after = IERC20(_want).balanceOf(address(this)); if (_after > _before) { _amount = _after.sub(_before); uint _reward = _amount.mul(split).div(max); IERC20(_want).safeTransfer(vaults[_strategy], _amount.sub(_reward)); IERC20(_want).safeTransfer(rewards, _reward); } } } // Only allows to withdraw non-core strategy tokens ~ this is over and above normal yield function harvest(address _strategy, address _token, uint parts) external { // This contract should never have value in it, but just incase since this is a public call uint _before = IERC20(_token).balanceOf(address(this)); Strategy(_strategy).withdraw(_token); uint _after = IERC20(_token).balanceOf(address(this)); if (_after > _before) { uint _amount = _after.sub(_before); address _want = Strategy(_strategy).want(); uint[] memory _distribution; uint _expected; _before = IERC20(_want).balanceOf(address(this)); IERC20(_token).safeApprove(onesplit, 0); IERC20(_token).safeApprove(onesplit, _amount); (_expected, _distribution) = OneSplitAudit(onesplit).getExpectedReturn(_token, _want, _amount, parts, 0); OneSplitAudit(onesplit).swap(_token, _want, _amount, _expected, _distribution, 0); _after = IERC20(_want).balanceOf(address(this)); if (_after > _before) { _amount = _after.sub(_before); uint _reward = _amount.mul(split).div(max); earn(_want, _amount.sub(_reward)); IERC20(_want).safeTransfer(rewards, _reward); } } } function withdraw(address _vault, uint _amount) external { require(isVault[msg.sender] == true, "!vault"); Strategy(strategies[_vault]).withdraw(_amount); } }
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063a622ee7c116100de578063ccd0631811610097578063f3fef3a311610071578063f3fef3a3146109a5578063f712adbb146109f3578063f765417614610a3d578063fa09e63014610a5b5761018e565b8063ccd063181461082f578063d0004c05146108b3578063e4f2494d146109015761018e565b8063a622ee7c146105f9578063ab033ea91461067d578063b02bf4b9146106c1578063b2a604561461070f578063c2ceb95f14610773578063c6d758cb146107e15761018e565b80636ac5db191161014b57806372cb5d971161012557806372cb5d971461048357806375724589146104e75780638da1df4d1461056b5780639ec5a894146105af5761018e565b80636ac5db191461038b5780636dcd64e5146103a957806370a082311461042b5761018e565b80631239c271146101935780632e8ebaae146101d757806339ebf823146102335780635aa6e675146102b7578063652b9b4114610301578063674e694f1461035d575b600080fd5b6101d5600480360360208110156101a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a9f565b005b610219600480360360208110156101ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bc4565b604051808215151515815260200191505060405180910390f35b6102756004803603602081101561024957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610be4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102bf610c17565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103436004803603602081101561031757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c3c565b604051808215151515815260200191505060405180910390f35b6103896004803603602081101561037357600080fd5b8101908080359060200190929190505050610c5c565b005b610393610d28565b6040518082815260200191505060405180910390f35b610415600480360360608110156103bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d2e565b6040518082815260200191505060405180910390f35b61046d6004803603602081101561044157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611049565b6040518082815260200191505060405180910390f35b6104e56004803603604081101561049957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611132565b005b610529600480360360208110156104fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114c2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105ad6004803603602081101561058157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ab565b005b6105b76116b1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61063b6004803603602081101561060f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116d7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106bf6004803603602081101561069357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061170a565b005b61070d600480360360408110156106d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061180f565b005b6107716004803603604081101561072557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611989565b005b6107df6004803603606081101561078957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611be9565b005b61082d600480360360408110156107f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506124b6565b005b6108b16004803603606081101561084557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125c8565b005b6108ff600480360360408110156108c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061274a565b005b6109636004803603604081101561091757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613144565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6109f1600480360360408110156109bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613186565b005b6109fb61331a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610a45613340565b6040518082815260200191505060405180910390f35b610a9d60048036036020811015610a7157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613346565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b61576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a75ac6086040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610ba957600080fd5b505af1158015610bbd573d6000803e3d6000fd5b5050505050565b60076020528060005260406000206000915054906101000a900460ff1681565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60066020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b61271081565b6000808373ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610dae57600080fd5b505afa158015610dc2573d6000803e3d6000fd5b505050506040513d6020811015610dd857600080fd5b8101908080519060200190929190505050905060008573ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3357600080fd5b505afa158015610e47573d6000803e3d6000fd5b505050506040513d6020811015610e5d57600080fd5b81019080805190602001909291905050509050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663085e2c5b8683858860006040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019550505050505060006040518083038186803b158015610f5c57600080fd5b505afa158015610f70573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506040811015610f9a57600080fd5b810190808051906020019092919080516040519392919084640100000000821115610fc457600080fd5b83820191506020820185811115610fda57600080fd5b8251866020820283011164010000000082111715610ff757600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561102e578082015181840152602081019050611013565b50505050905001604052505050508093505050509392505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b1580156110f057600080fd5b505afa158015611104573d6000803e3d6000fd5b505050506040513d602081101561111a57600080fd5b81019080805190602001909291905050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111f4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614611311578073ffffffffffffffffffffffffffffffffffffffff1663853828b66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156112d457600080fd5b505af11580156112e8573d6000803e3d6000fd5b505050506040513d60208110156112fe57600080fd5b8101908080519060200190929190505050505b81600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555082600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b15801561156957600080fd5b505afa15801561157d573d6000803e3d6000fd5b505050506040513d602081101561159357600080fd5b81019080805190602001909291905050509050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461166d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b1580156118bb57600080fd5b505afa1580156118cf573d6000803e3d6000fd5b505050506040513d60208110156118e557600080fd5b8101908080519060200190929190505050905061192382848373ffffffffffffffffffffffffffffffffffffffff1661348f9092919063ffffffff16565b8173ffffffffffffffffffffffffffffffffffffffff1663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561196b57600080fd5b505af115801561197f573d6000803e3d6000fd5b5050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166351cff8d9826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015611aca57600080fd5b505af1158015611ade573d6000803e3d6000fd5b50505050611be56000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611b8457600080fd5b505afa158015611b98573d6000803e3d6000fd5b505050506040513d6020811015611bae57600080fd5b81019080805190602001909291905050508373ffffffffffffffffffffffffffffffffffffffff1661348f9092919063ffffffff16565b5050565b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611c6857600080fd5b505afa158015611c7c573d6000803e3d6000fd5b505050506040513d6020811015611c9257600080fd5b810190808051906020019092919050505090508373ffffffffffffffffffffffffffffffffffffffff166351cff8d9846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015611d2457600080fd5b505af1158015611d38573d6000803e3d6000fd5b5050505060008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611dbb57600080fd5b505afa158015611dcf573d6000803e3d6000fd5b505050506040513d6020811015611de557600080fd5b81019080805190602001909291905050509050818111156124af576000611e15838361356090919063ffffffff16565b905060008673ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b158015611e5f57600080fd5b505afa158015611e73573d6000803e3d6000fd5b505050506040513d6020811015611e8957600080fd5b81019080805190602001909291905050509050606060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611f1d57600080fd5b505afa158015611f31573d6000803e3d6000fd5b505050506040513d6020811015611f4757600080fd5b81019080805190602001909291905050509550611fa8600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008a73ffffffffffffffffffffffffffffffffffffffff166135aa9092919063ffffffff16565b611ff5600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16858a73ffffffffffffffffffffffffffffffffffffffff166135aa9092919063ffffffff16565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663085e2c5b8985878b60006040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019550505050505060006040518083038186803b1580156120e157600080fd5b505afa1580156120f5573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250604081101561211f57600080fd5b81019080805190602001909291908051604051939291908464010000000082111561214957600080fd5b8382019150602082018581111561215f57600080fd5b825186602082028301116401000000008211171561217c57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156121b3578082015181840152602081019050612198565b505050509050016040525050508093508192505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a7515e898587858760006040518763ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b838110156122d55780820151818401526020810190506122ba565b50505050905001975050505050505050602060405180830381600087803b1580156122ff57600080fd5b505af1158015612313573d6000803e3d6000fd5b505050506040513d602081101561232957600080fd5b8101908080519060200190929190505050508273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156123b857600080fd5b505afa1580156123cc573d6000803e3d6000fd5b505050506040513d60208110156123e257600080fd5b81019080805190602001909291905050509450858511156124aa57612410868661356090919063ffffffff16565b9350600061243d61271061242f600854886137ca90919063ffffffff16565b61385090919063ffffffff16565b905061245b84612456838861356090919063ffffffff16565b61180f565b6124a8600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828673ffffffffffffffffffffffffffffffffffffffff1661348f9092919063ffffffff16565b505b505050505b5050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6125c46000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828473ffffffffffffffffffffffffffffffffffffffff1661348f9092919063ffffffff16565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461268a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b60008273ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b15801561279257600080fd5b505afa1580156127a6573d6000803e3d6000fd5b505050506040513d60208110156127bc57600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561284e57600080fd5b505afa158015612862573d6000803e3d6000fd5b505050506040513d602081101561287857600080fd5b810190808051906020019092919050505090508373ffffffffffffffffffffffffffffffffffffffff16631dd19cb46040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156128d357600080fd5b505af11580156128e7573d6000803e3d6000fd5b5050505060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561296a57600080fd5b505afa15801561297e573d6000803e3d6000fd5b505050506040513d602081101561299457600080fd5b810190808051906020019092919050505090508181111561313d5760006129c4838361356090919063ffffffff16565b90506000600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fc0c546a6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a6d57600080fd5b505afa158015612a81573d6000803e3d6000fd5b505050506040513d6020811015612a9757600080fd5b81019080805190602001909291905050509050606060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612b2b57600080fd5b505afa158015612b3f573d6000803e3d6000fd5b505050506040513d6020811015612b5557600080fd5b81019080805190602001909291905050509550612bb6600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008973ffffffffffffffffffffffffffffffffffffffff166135aa9092919063ffffffff16565b612c03600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16858973ffffffffffffffffffffffffffffffffffffffff166135aa9092919063ffffffff16565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663085e2c5b8885878c60006040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019550505050505060006040518083038186803b158015612cef57600080fd5b505afa158015612d03573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506040811015612d2d57600080fd5b810190808051906020019092919080516040519392919084640100000000821115612d5757600080fd5b83820191506020820185811115612d6d57600080fd5b8251866020820283011164010000000082111715612d8a57600080fd5b8083526020830192505050908051906020019060200280838360005b83811015612dc1578082015181840152602081019050612da6565b505050509050016040525050508093508192505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a7515e888587858760006040518763ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015612ee3578082015181840152602081019050612ec8565b50505050905001975050505050505050602060405180830381600087803b158015612f0d57600080fd5b505af1158015612f21573d6000803e3d6000fd5b505050506040513d6020811015612f3757600080fd5b8101908080519060200190929190505050508273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612fc657600080fd5b505afa158015612fda573d6000803e3d6000fd5b505050506040513d6020811015612ff057600080fd5b81019080805190602001909291905050509450858511156131385761301e868661356090919063ffffffff16565b9350600061304b61271061303d600854886137ca90919063ffffffff16565b61385090919063ffffffff16565b90506130e9600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166130c3838861356090919063ffffffff16565b8673ffffffffffffffffffffffffffffffffffffffff1661348f9092919063ffffffff16565b613136600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828673ffffffffffffffffffffffffffffffffffffffff1661348f9092919063ffffffff16565b505b505050505b5050505050565b60056020528160005260406000206020528060005260406000206000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60011515600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461324c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f217661756c74000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156132fe57600080fd5b505af1158015613312573d6000803e3d6000fd5b505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613408576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663853828b66040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561345057600080fd5b505af1158015613464573d6000803e3d6000fd5b505050506040513d602081101561347a57600080fd5b81019080805190602001909291905050505050565b61355b838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061389a565b505050565b60006135a283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613ae5565b905092915050565b60008114806136a4575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561366757600080fd5b505afa15801561367b573d6000803e3d6000fd5b505050506040513d602081101561369157600080fd5b8101908080519060200190929190505050145b6136f9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613d026036913960400191505060405180910390fd5b6137c5838473ffffffffffffffffffffffffffffffffffffffff1663095ea7b3905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061389a565b505050565b6000808314156137dd576000905061384a565b60008284029050828482816137ee57fe5b0414613845576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613cb76021913960400191505060405180910390fd5b809150505b92915050565b600061389283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613ba5565b905092915050565b6138b98273ffffffffffffffffffffffffffffffffffffffff16613c6b565b61392b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061397a5780518252602082019150602081019050602083039250613957565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146139dc576040519150601f19603f3d011682016040523d82523d6000602084013e6139e1565b606091505b509150915081613a59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115613adf57808060200190516020811015613a7857600080fd5b8101908080519060200190929190505050613ade576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cd8602a913960400191505060405180910390fd5b5b50505050565b6000838311158290613b92576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613b57578082015181840152602081019050613b3c565b50505050905090810190601f168015613b845780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290613c51576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c16578082015181840152602081019050613bfb565b50505050905090810190601f168015613c435780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613c5d57fe5b049050809150509392505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015613cad5750808214155b9250505091905056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a265627a7a7231582086e394a86a98bdfa7b770637b1481c07725ee5c3672bc76b576a61fe153376c264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,659
0x706cb9e741cbfee00ad5b3f5acc8bd44d1644a74
pragma solidity 0.5.17; // Telegram News : https://t.me/YFOX_Announcement // Twitter : https://twitter.com/yfoxfinance // Website : https://yfox.finance /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) internal balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _to != address(this)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0) && _to != address(this)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, bytes calldata _extraData) external; } contract YFOX is StandardToken, Ownable { string public constant name = "YFOX.FINANCE"; string public constant symbol = "YFOX"; uint public constant decimals = 6; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 23000 * (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); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063d493b9ac11610066578063d493b9ac1461057a578063d73dd623146105e8578063dd62ed3e1461064e578063f2fde38b146106c657610100565b80638da5cb5b1461038c57806395d89b41146103d6578063a9059cbb14610459578063cae9ca51146104bf57610100565b8063313ce567116100d3578063313ce56714610292578063378dc3dc146102b057806366188463146102ce57806370a082311461033457610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d61070a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610743565b604051808215151515815260200191505060405180910390f35b6101f6610835565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083b565b604051808215151515815260200191505060405180910390f35b61029a610b5d565b6040518082815260200191505060405180910390f35b6102b8610b62565b6040518082815260200191505060405180910390f35b61031a600480360360408110156102e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b6e565b604051808215151515815260200191505060405180910390f35b6103766004803603602081101561034a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dff565b6040518082815260200191505060405180910390f35b610394610e48565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103de610e6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041e578082015181840152602081019050610403565b50505050905090810190601f16801561044b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104a56004803603604081101561046f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ea7565b604051808215151515815260200191505060405180910390f35b610560600480360360608110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184600183028401116401000000008311171561055057600080fd5b90919293919293905050506110b3565b604051808215151515815260200191505060405180910390f35b6105e66004803603606081101561059057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111af565b005b610634600480360360408110156105fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112d1565b604051808215151515815260200191505060405180910390f35b6106b06004803603604081101561066457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114cd565b6040518082815260200191505060405180910390f35b610708600480360360208110156106dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611554565b005b6040518060400160405280600c81526020017f59464f582e46494e414e4345000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156108a557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6108ae57600080fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061098183600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a1683600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a6c83826116a890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600681565b6006600a0a6159d80281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c7f576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d13565b610c9283826116a890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f59464f580000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610f1157503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610f1a57600080fd5b610f6c82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061100182600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808590506110c38686610743565b156111a5578073ffffffffffffffffffffffffffffffffffffffff1663a2d57853338787876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050600060405180830381600087803b15801561118357600080fd5b505af1158015611197573d6000803e3d6000fd5b5050505060019150506111a7565b505b949350505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461120957600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561129057600080fd5b505af11580156112a4573d6000803e3d6000fd5b505050506040513d60208110156112ba57600080fd5b810190808051906020019092919050505050505050565b600061136282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116bf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146115ae57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115e857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156116b457fe5b818303905092915050565b6000808284019050838110156116d157fe5b809150509291505056fea265627a7a72315820521e1f9db552330dde05dea15cbcddea5daef4970f1cb90410233d25d6deec0764736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,660
0x05f3aa09f1925cc792374d0ee8b0dde9ea42f290
/** *Submitted for verification at Etherscan.io on 2022-01-19 */ /* TG: https://t.me/Kishimoto_Inu Katsumi, the next release from Kishimoto Inu, will be releasing this week! Long awaited after the major updates from Kishimoto! Get ready for Katsumi: Web: https://kishimotoinu.com/ Web2: https://katsumi.kishimotoinu.com/ The Kishimoto Inu utility token”Katsumi” is launching this week. Katsumi will launch on Uniswap with an LP of 100,000,000,000,000 Katsumi tokens and $500,000eth. Katsumi’s main purpose will be to buyback Kishimoto Inu Tokens and burning them every few days. Katsumi will also donate to various charities each month. */ 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 katsumi is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 100* 10**12* 10**18; string private _name = 'Katsumi ' ; string private _symbol = 'KATSUMI ' ; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122016dcb28b4b1c882a47ea71db7c093f500ee216d977d72d243e45db985d1246d764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,661
0x02253dfa1f23e72e2e3e1c6b9cd2b8b0a2fc7bc5
/** *Submitted for verification at Etherscan.io on 2021-11-14 */ /* Spirit Of Elon .-----. .' - - '. / .-. .-. \ | | | | | | \ \o/ \o/ / _/ ^ \_ | \ '---' / | / /`--. .--`\ \ / /'---` `---'\ \ '.__. .__.' `| |` | \ \ '--. '. `\ `'---. | ,__) / `..' */ // 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 SoEToken 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 _isnotTaxed; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e9 * 10**9; uint256 private _rTotalAmt = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotalAmt; uint256 private _feeForAddress1; uint256 private _feeForAddress2; address payable private _walletAddrForFee; string private constant _name = "Spirit Of Elon"; string private constant _symbol = "SOE"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _walletAddrForFee = payable(0x1234567829DB578878Fde9c5f748e1e06085e471); _rOwned[_msgSender()] = _rTotalAmt; _isnotTaxed[owner()] = true; _isnotTaxed[address(this)] = true; _isnotTaxed[_walletAddrForFee] = true; emit Transfer(address(0x0000000000000000000000000000000000000000), _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 <= _rTotalAmt, "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"); _feeForAddress1 = 2; _feeForAddress2 = 4; if (from != owner() && to != owner()) { if (from != address(uniswapV2Router) && to == uniswapV2Pair && ! _isnotTaxed[from]) { _feeForAddress1 = 2; _feeForAddress2 = 5; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendToFee(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 sendToFee(uint256 amount) private { _walletAddrForFee.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; _maxTxAmount = 1e9 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotalAmt = _rTotalAmt.sub(rFee); _tFeeTotalAmt = _tFeeTotalAmt.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, _feeForAddress1, _feeForAddress2); 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 = _rTotalAmt; uint256 tSupply = _tTotal; if (rSupply < _rTotalAmt.div(_tTotal)) return (_rTotalAmt, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106100ab5760003560e01c8063715018a611610064578063715018a6146101ef5780638da5cb5b1461020657806395d89b4114610231578063a9059cbb1461025c578063c9567bf914610299578063dd62ed3e146102b0576100b2565b806306fdde03146100b7578063095ea7b3146100e257806318160ddd1461011f57806323b872dd1461014a578063313ce5671461018757806370a08231146101b2576100b2565b366100b257005b600080fd5b3480156100c357600080fd5b506100cc6102ed565b6040516100d991906121c0565b60405180910390f35b3480156100ee57600080fd5b5061010960048036038101906101049190611dbc565b61032a565b60405161011691906121a5565b60405180910390f35b34801561012b57600080fd5b50610134610348565b6040516101419190612322565b60405180910390f35b34801561015657600080fd5b50610171600480360381019061016c9190611d6d565b610358565b60405161017e91906121a5565b60405180910390f35b34801561019357600080fd5b5061019c610431565b6040516101a99190612397565b60405180910390f35b3480156101be57600080fd5b506101d960048036038101906101d49190611cdf565b61043a565b6040516101e69190612322565b60405180910390f35b3480156101fb57600080fd5b5061020461048b565b005b34801561021257600080fd5b5061021b6105de565b60405161022891906120d7565b60405180910390f35b34801561023d57600080fd5b50610246610607565b60405161025391906121c0565b60405180910390f35b34801561026857600080fd5b50610283600480360381019061027e9190611dbc565b610644565b60405161029091906121a5565b60405180910390f35b3480156102a557600080fd5b506102ae610662565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190611d31565b610ba2565b6040516102e49190612322565b60405180910390f35b60606040518060400160405280600e81526020017f537069726974204f6620456c6f6e000000000000000000000000000000000000815250905090565b600061033e610337610c29565b8484610c31565b6001905092915050565b6000670de0b6b3a7640000905090565b6000610365848484610dfc565b61042684610371610c29565b6104218560405180606001604052806028815260200161290f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103d7610c29565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118b9092919063ffffffff16565b610c31565b600190509392505050565b60006009905090565b6000610484600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111ef565b9050919050565b610493610c29565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610520576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051790612282565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f534f450000000000000000000000000000000000000000000000000000000000815250905090565b6000610658610651610c29565b8484610dfc565b6001905092915050565b61066a610c29565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612282565b60405180910390fd5b600c60149054906101000a900460ff1615610747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073e90612302565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506107d630600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000610c31565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561081c57600080fd5b505afa158015610830573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108549190611d08565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108b657600080fd5b505afa1580156108ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ee9190611d08565b6040518363ffffffff1660e01b815260040161090b9291906120f2565b602060405180830381600087803b15801561092557600080fd5b505af1158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d9190611d08565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306109e63061043a565b6000806109f16105de565b426040518863ffffffff1660e01b8152600401610a1396959493929190612144565b6060604051808303818588803b158015610a2c57600080fd5b505af1158015610a40573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a659190611e21565b5050506001600c60166101000a81548160ff021916908315150217905550670de0b6b3a7640000600d819055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610b4c92919061211b565b602060405180830381600087803b158015610b6657600080fd5b505af1158015610b7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9e9190611df8565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ca1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c98906122e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0890612222565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610def9190612322565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e63906122c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610edc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed3906121e2565b60405180910390fd5b60008111610f1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f16906122a2565b60405180910390fd5b60026008819055506004600981905550610f376105de565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610fa55750610f756105de565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561117b57600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156110555750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b80156110ab5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156110c157600260088190555060056009819055505b60006110cc3061043a565b9050600c60159054906101000a900460ff161580156111395750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156111515750600c60169054906101000a900460ff165b156111795761115f8161125d565b600047905060008111156111775761117647611557565b5b505b505b6111868383836115c3565b505050565b60008383111582906111d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ca91906121c0565b60405180910390fd5b50600083856111e291906124e8565b9050809150509392505050565b6000600654821115611236576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122d90612202565b60405180910390fd5b60006112406115d3565b905061125581846115fe90919063ffffffff16565b915050919050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112bb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156112e95781602001602082028036833780820191505090505b5090503081600081518110611327577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113c957600080fd5b505afa1580156113dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114019190611d08565b8160018151811061143b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506114a230600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610c31565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161150695949392919061233d565b600060405180830381600087803b15801561152057600080fd5b505af1158015611534573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115bf573d6000803e3d6000fd5b5050565b6115ce838383611648565b505050565b60008060006115e0611813565b915091506115f781836115fe90919063ffffffff16565b9250505090565b600061164083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611872565b905092915050565b60008060008060008061165a876118d5565b9550955095509550955095506116b886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461193d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061174d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611799816119e5565b6117a38483611aa2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516118009190612322565b60405180910390a3505050505050505050565b600080600060065490506000670de0b6b3a76400009050611847670de0b6b3a76400006006546115fe90919063ffffffff16565b82101561186557600654670de0b6b3a764000093509350505061186e565b81819350935050505b9091565b600080831182906118b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118b091906121c0565b60405180910390fd5b50600083856118c8919061245d565b9050809150509392505050565b60008060008060008060008060006118f28a600854600954611adc565b92509250925060006119026115d3565b905060008060006119158e878787611b72565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061197f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061118b565b905092915050565b60008082846119969190612407565b9050838110156119db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d290612242565b60405180910390fd5b8091505092915050565b60006119ef6115d3565b90506000611a068284611bfb90919063ffffffff16565b9050611a5a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ab78260065461193d90919063ffffffff16565b600681905550611ad28160075461198790919063ffffffff16565b6007819055505050565b600080600080611b086064611afa888a611bfb90919063ffffffff16565b6115fe90919063ffffffff16565b90506000611b326064611b24888b611bfb90919063ffffffff16565b6115fe90919063ffffffff16565b90506000611b5b82611b4d858c61193d90919063ffffffff16565b61193d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611b8b8589611bfb90919063ffffffff16565b90506000611ba28689611bfb90919063ffffffff16565b90506000611bb98789611bfb90919063ffffffff16565b90506000611be282611bd4858761193d90919063ffffffff16565b61193d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611c0e5760009050611c70565b60008284611c1c919061248e565b9050828482611c2b919061245d565b14611c6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6290612262565b60405180910390fd5b809150505b92915050565b600081359050611c85816128c9565b92915050565b600081519050611c9a816128c9565b92915050565b600081519050611caf816128e0565b92915050565b600081359050611cc4816128f7565b92915050565b600081519050611cd9816128f7565b92915050565b600060208284031215611cf157600080fd5b6000611cff84828501611c76565b91505092915050565b600060208284031215611d1a57600080fd5b6000611d2884828501611c8b565b91505092915050565b60008060408385031215611d4457600080fd5b6000611d5285828601611c76565b9250506020611d6385828601611c76565b9150509250929050565b600080600060608486031215611d8257600080fd5b6000611d9086828701611c76565b9350506020611da186828701611c76565b9250506040611db286828701611cb5565b9150509250925092565b60008060408385031215611dcf57600080fd5b6000611ddd85828601611c76565b9250506020611dee85828601611cb5565b9150509250929050565b600060208284031215611e0a57600080fd5b6000611e1884828501611ca0565b91505092915050565b600080600060608486031215611e3657600080fd5b6000611e4486828701611cca565b9350506020611e5586828701611cca565b9250506040611e6686828701611cca565b9150509250925092565b6000611e7c8383611e88565b60208301905092915050565b611e918161251c565b82525050565b611ea08161251c565b82525050565b6000611eb1826123c2565b611ebb81856123e5565b9350611ec6836123b2565b8060005b83811015611ef7578151611ede8882611e70565b9750611ee9836123d8565b925050600181019050611eca565b5085935050505092915050565b611f0d8161252e565b82525050565b611f1c81612571565b82525050565b6000611f2d826123cd565b611f3781856123f6565b9350611f47818560208601612583565b611f5081612614565b840191505092915050565b6000611f686023836123f6565b9150611f7382612625565b604082019050919050565b6000611f8b602a836123f6565b9150611f9682612674565b604082019050919050565b6000611fae6022836123f6565b9150611fb9826126c3565b604082019050919050565b6000611fd1601b836123f6565b9150611fdc82612712565b602082019050919050565b6000611ff46021836123f6565b9150611fff8261273b565b604082019050919050565b60006120176020836123f6565b91506120228261278a565b602082019050919050565b600061203a6029836123f6565b9150612045826127b3565b604082019050919050565b600061205d6025836123f6565b915061206882612802565b604082019050919050565b60006120806024836123f6565b915061208b82612851565b604082019050919050565b60006120a36017836123f6565b91506120ae826128a0565b602082019050919050565b6120c28161255a565b82525050565b6120d181612564565b82525050565b60006020820190506120ec6000830184611e97565b92915050565b60006040820190506121076000830185611e97565b6121146020830184611e97565b9392505050565b60006040820190506121306000830185611e97565b61213d60208301846120b9565b9392505050565b600060c0820190506121596000830189611e97565b61216660208301886120b9565b6121736040830187611f13565b6121806060830186611f13565b61218d6080830185611e97565b61219a60a08301846120b9565b979650505050505050565b60006020820190506121ba6000830184611f04565b92915050565b600060208201905081810360008301526121da8184611f22565b905092915050565b600060208201905081810360008301526121fb81611f5b565b9050919050565b6000602082019050818103600083015261221b81611f7e565b9050919050565b6000602082019050818103600083015261223b81611fa1565b9050919050565b6000602082019050818103600083015261225b81611fc4565b9050919050565b6000602082019050818103600083015261227b81611fe7565b9050919050565b6000602082019050818103600083015261229b8161200a565b9050919050565b600060208201905081810360008301526122bb8161202d565b9050919050565b600060208201905081810360008301526122db81612050565b9050919050565b600060208201905081810360008301526122fb81612073565b9050919050565b6000602082019050818103600083015261231b81612096565b9050919050565b600060208201905061233760008301846120b9565b92915050565b600060a08201905061235260008301886120b9565b61235f6020830187611f13565b81810360408301526123718186611ea6565b90506123806060830185611e97565b61238d60808301846120b9565b9695505050505050565b60006020820190506123ac60008301846120c8565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006124128261255a565b915061241d8361255a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612452576124516125b6565b5b828201905092915050565b60006124688261255a565b91506124738361255a565b925082612483576124826125e5565b5b828204905092915050565b60006124998261255a565b91506124a48361255a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156124dd576124dc6125b6565b5b828202905092915050565b60006124f38261255a565b91506124fe8361255a565b925082821015612511576125106125b6565b5b828203905092915050565b60006125278261253a565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061257c8261255a565b9050919050565b60005b838110156125a1578082015181840152602081019050612586565b838111156125b0576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6128d28161251c565b81146128dd57600080fd5b50565b6128e98161252e565b81146128f457600080fd5b50565b6129008161255a565b811461290b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b7ad06725568dfa58dce5b10f9e53fb525bd050c928845d88c9308882c1e175464736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,662
0x5b5746F6f5e2Db8BF5e260829CA7a004c876B167
/** *Submitted for verification at Etherscan.io on 2021-08-23 */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.6; /** * @title CrowdfundWithPodiumEditionsStorage * @author MirrorXYZ */ contract CrowdfundWithPodiumEditionsStorage { // The two states that this contract can exist in. "FUNDING" allows // contributors to add funds. enum Status { FUNDING, TRADING } // ============ Constants ============ // The factor by which ETH contributions will multiply into crowdfund tokens. uint16 internal constant TOKEN_SCALE = 1000; uint256 internal constant REENTRANCY_NOT_ENTERED = 1; uint256 internal constant REENTRANCY_ENTERED = 2; uint16 public constant PODIUM_TIME_BUFFER = 900; uint8 public constant decimals = 18; // ============ Immutable Storage ============ // The operator has a special role to change contract status. address payable public operator; address payable public fundingRecipient; address public treasuryConfig; // We add a hard cap to prevent raising more funds than deemed reasonable. uint256 public fundingCap; uint256 public feePercentage; // The operator takes some equity in the tokens, represented by this percent. uint256 public operatorPercent; string public symbol; string public name; // ============ Mutable Storage ============ // Represents the current state of the campaign. Status public status; uint256 internal reentrancy_status; // Podium storage uint256 public podiumStartTime; uint256 public podiumDuration; // ============ Mutable ERC20 Attributes ============ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; mapping(address => uint256) public nonces; // ============ Delegation logic ============ address public logic; // ============ Tiered Campaigns ============ // Address of the editions contract to purchase from. address public editions; } // File contracts/producers/crowdfunds/crowdfund-with-podium-editions/interface/ICrowdfundWithPodiumEditions.sol interface ICrowdfundWithPodiumEditions { struct Edition { // The maximum number of tokens that can be sold. uint256 quantity; // The price at which each token will be sold, in ETH. uint256 price; // The account that will receive sales revenue. address payable fundingRecipient; // The number of tokens sold so far. uint256 numSold; bytes32 contentHash; } struct EditionTier { // The maximum number of tokens that can be sold. uint256 quantity; // The price at which each token will be sold, in ETH. uint256 price; bytes32 contentHash; } function buyEdition(uint256 editionId, address recipient) external payable returns (uint256 tokenId); function editionPrice(uint256 editionId) external view returns (uint256); function createEditions( EditionTier[] memory tier, // The account that should receive the revenue. address payable fundingRecipient, address minter ) external; function contractURI() external view returns (string memory); } // File contracts/interface/ITreasuryConfig.sol interface ITreasuryConfig { function treasury() external returns (address payable); function distributionModel() external returns (address); } // File contracts/producers/crowdfunds/crowdfund-with-podium-editions/CrowdfundWithPodiumEditionsLogic.sol /** * @title CrowdfundWithPodiumEditionsLogic * @author MirrorXYZ * * Crowdfund the creation of NFTs by issuing ERC20 tokens that * can be redeemed for the underlying value of the NFT once sold. */ contract CrowdfundWithPodiumEditionsLogic is CrowdfundWithPodiumEditionsStorage { // ============ Events ============ event ReceivedERC721(uint256 tokenId, address sender); event Contribution(address contributor, uint256 amount); event ContributionForEdition( address contributor, uint256 amount, uint256 editionId, uint256 tokenId ); event FundingClosed(uint256 amountRaised, uint256 creatorAllocation); event BidAccepted(uint256 amount); event Redeemed(address contributor, uint256 amount); // ERC20 Events event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); // Podium Events event PodiumDurationExtended(uint256 editionId); // ============ Modifiers ============ /** * @dev Modifier to check whether the `msg.sender` is the operator. * If it is, it will run the function. Otherwise, it will revert. */ modifier onlyOperator() { require(msg.sender == operator); _; } modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(reentrancy_status != REENTRANCY_ENTERED, "Reentrant call"); // Any calls to nonReentrant after this point will fail reentrancy_status = REENTRANCY_ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) reentrancy_status = REENTRANCY_NOT_ENTERED; } // ============ Crowdfunding Methods ============ function contributeForPodium( address payable backer, uint256 editionId, uint256 amount ) external payable nonReentrant { _contribute(backer, editionId, amount, true); } /** * @notice Mints tokens for the sender propotional to the * amount of ETH sent in the transaction. * @dev Emits the Contribution event. */ function contribute( address payable backer, uint256 editionId, uint256 amount ) external payable nonReentrant { _contribute(backer, editionId, amount, false); } /** * @notice Burns the sender's tokens and redeems underlying ETH. * @dev Emits the Redeemed event. */ function redeem(uint256 tokenAmount) external nonReentrant { // Prevent backers from accidently redeeming when balance is 0. require( address(this).balance > 0, "Crowdfund: No ETH available to redeem" ); // Check require( balanceOf[msg.sender] >= tokenAmount, "Crowdfund: Insufficient balance" ); require(status == Status.TRADING, "Crowdfund: Funding must be trading"); // Effect uint256 redeemable = redeemableFromTokens(tokenAmount); _burn(msg.sender, tokenAmount); // Safe version of transfer. sendValue(payable(msg.sender), redeemable); emit Redeemed(msg.sender, redeemable); } /** * @notice Returns the amount of ETH that is redeemable for tokenAmount. */ function redeemableFromTokens(uint256 tokenAmount) public view returns (uint256) { return (tokenAmount * address(this).balance) / totalSupply; } function valueToTokens(uint256 value) public pure returns (uint256 tokens) { tokens = value * TOKEN_SCALE; } function tokensToValue(uint256 tokenAmount) internal pure returns (uint256 value) { value = tokenAmount / TOKEN_SCALE; } // ============ Operator Methods ============ /** * @notice Transfers all funds to operator, and mints tokens for the operator. * Updates status to TRADING. * @dev Emits the FundingClosed event. */ function closeFunding() external onlyOperator nonReentrant { require(status == Status.FUNDING, "Crowdfund: Funding must be open"); // Close funding status, move to tradable. status = Status.TRADING; // Mint the operator a percent of the total supply. uint256 operatorTokens = (operatorPercent * totalSupply) / (100 - operatorPercent); _mint(operator, operatorTokens); // Announce that funding has been closed. emit FundingClosed(address(this).balance, operatorTokens); // Transfer the fee to the treasury. sendValue( ITreasuryConfig(treasuryConfig).treasury(), computeFee(address(this).balance) ); // Transfer available balance to the fundingRecipient. sendValue(fundingRecipient, address(this).balance); } function computeFee(uint256 amount) public view returns (uint256 fee) { fee = (feePercentage * amount) / (100 * 100); } // ============ Utility Methods ============ 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" ); } // ============ ERC20 Spec ============ function _mint(address to, uint256 value) internal { totalSupply = totalSupply + value; balanceOf[to] = balanceOf[to] + value; emit Transfer(address(0), to, value); } function _burn(address from, uint256 value) internal { balanceOf[from] = balanceOf[from] - value; totalSupply = totalSupply - value; emit Transfer(from, address(0), value); } function _approve( address owner, address spender, uint256 value ) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } function _transfer( address from, address to, uint256 value ) private { balanceOf[from] = balanceOf[from] - value; balanceOf[to] = balanceOf[to] + value; emit Transfer(from, to, value); } function approve(address spender, uint256 value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function transfer(address to, uint256 value) external returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom( address from, address to, uint256 value ) external returns (bool) { allowance[from][msg.sender] = allowance[from][msg.sender] - value; _transfer(from, to, value); return true; } // ============ Tiered Campaigns ============ function buyEdition( uint256 amount, uint256 editionId, address recipient ) internal returns (uint256) { // Check that the sender is paying the correct amount. require( amount >= ICrowdfundWithPodiumEditions(editions).editionPrice(editionId), "Unable purchase edition with available amount" ); // We don't need to transfer the value to the NFT contract here, // since that contract trusts this one to check before minting. // I.E. this contract has minting privileges. return ICrowdfundWithPodiumEditions(editions).buyEdition( editionId, recipient ); } function buyEditionForPodium( uint256 amount, uint256 editionId, address recipient ) internal returns (uint256) { // Check that the sender is paying the correct amount. require( amount >= ICrowdfundWithPodiumEditions(editions).editionPrice(editionId), "Unable purchase edition with available amount" ); if (podiumStartTime == 0) { podiumStartTime = block.timestamp; } uint256 podiumEnds = podiumStartTime + podiumDuration; require(podiumEnds >= block.timestamp, "podium closed"); if (podiumEnds < block.timestamp + PODIUM_TIME_BUFFER) { // Extend duration. podiumDuration += block.timestamp + PODIUM_TIME_BUFFER - podiumEnds; emit PodiumDurationExtended(editionId); } // We don't need to transfer the value to the NFT contract here, // since that contract trusts this one to check before minting. // I.E. this contract has minting privileges. return ICrowdfundWithPodiumEditions(editions).buyEdition( editionId, recipient ); } function _contribute( address payable backer, uint256 editionId, uint256 amount, bool forPodium ) private { require(status == Status.FUNDING, "Crowdfund: Funding must be open"); require(amount == msg.value, "Crowdfund: Amount is not value sent"); // This first case is the happy path, so we will keep it efficient. // The balance, which includes the current contribution, is less than or equal to cap. if (address(this).balance <= fundingCap) { // Mint equity for the contributor. _mint(backer, valueToTokens(amount)); // Editions start at 1, so a "0" edition means the user wants to contribute without // purchasing a token. if (editionId > 0) { emit ContributionForEdition( backer, amount, editionId, forPodium ? buyEditionForPodium(amount, editionId, backer) : buyEdition(amount, editionId, backer) ); } else { emit Contribution(backer, amount); } } else { // Compute the balance of the crowdfund before the contribution was made. uint256 startAmount = address(this).balance - amount; // If that amount was already greater than the funding cap, then we should revert immediately. require( startAmount < fundingCap, "Crowdfund: Funding cap already reached" ); // Otherwise, the contribution helped us reach the funding cap. We should // take what we can until the funding cap is reached, and refund the rest. uint256 eligibleAmount = fundingCap - startAmount; // Otherwise, we process the contribution as if it were the minimal amount. _mint(backer, valueToTokens(eligibleAmount)); if (editionId > 0) { emit ContributionForEdition( backer, eligibleAmount, editionId, // Attempt to purchase edition with eligible amount. forPodium ? buyEditionForPodium(eligibleAmount, editionId, backer) : buyEdition(eligibleAmount, editionId, backer) ); } else { emit Contribution(backer, eligibleAmount); } // Refund the sender with their contribution (e.g. 2.5 minus the diff - e.g. 1.5 = 1 ETH) sendValue(backer, amount - eligibleAmount); } } }
0x6080604052600436106101c25760003560e01c80638dc06c7f116100f7578063ce4661bb11610095578063dd62ed3e11610064578063dd62ed3e14610503578063e1bf9c081461053b578063e3b2594f1461055b578063f72655ef1461057157600080fd5b8063ce4661bb14610490578063cfd7b0df146104a3578063d7dfa0dd146104c3578063db006a75146104e357600080fd5b8063a001ecdd116100d1578063a001ecdd14610427578063a08f793c1461043d578063a9059cbb14610450578063b8ddbcb31461047057600080fd5b80638dc06c7f146103dc57806395d89b41146103f25780639744b8dc1461040757600080fd5b80632f87e4be11610164578063570ca7351161013e578063570ca7351461034c57806370a082311461036c5780637b4044a0146103995780637ecebe00146103af57600080fd5b80632f87e4be146102ee578063313ce5671461030e57806331a3a5061461033557600080fd5b806318a855c7116101a057806318a855c7146102465780631bb534ba1461026f578063200d2ed2146102a757806323b872dd146102ce57600080fd5b806306fdde03146101c7578063095ea7b3146101f257806318160ddd14610222575b600080fd5b3480156101d357600080fd5b506101dc610587565b6040516101e99190611853565b60405180910390f35b3480156101fe57600080fd5b5061021261020d3660046117cd565b610615565b60405190151581526020016101e9565b34801561022e57600080fd5b50610238600c5481565b6040519081526020016101e9565b34801561025257600080fd5b5061025c61038481565b60405161ffff90911681526020016101e9565b34801561027b57600080fd5b5060015461028f906001600160a01b031681565b6040516001600160a01b0390911681526020016101e9565b3480156102b357600080fd5b506008546102c19060ff1681565b6040516101e9919061182b565b3480156102da57600080fd5b506102126102e936600461178c565b61062b565b3480156102fa57600080fd5b506102386103093660046117f9565b610693565b34801561031a57600080fd5b50610323601281565b60405160ff90911681526020016101e9565b34801561034157600080fd5b5061034a6106b3565b005b34801561035857600080fd5b5060005461028f906001600160a01b031681565b34801561037857600080fd5b506102386103873660046116dd565b600d6020526000908152604090205481565b3480156103a557600080fd5b5061023860055481565b3480156103bb57600080fd5b506102386103ca3660046116dd565b600f6020526000908152604090205481565b3480156103e857600080fd5b50610238600b5481565b3480156103fe57600080fd5b506101dc6108fa565b34801561041357600080fd5b506102386104223660046117f9565b610907565b34801561043357600080fd5b5061023860045481565b61034a61044b36600461171e565b610915565b34801561045c57600080fd5b5061021261046b3660046117cd565b610984565b34801561047c57600080fd5b5060115461028f906001600160a01b031681565b61034a61049e36600461171e565b610991565b3480156104af57600080fd5b5060025461028f906001600160a01b031681565b3480156104cf57600080fd5b5060105461028f906001600160a01b031681565b3480156104ef57600080fd5b5061034a6104fe3660046117f9565b6109f6565b34801561050f57600080fd5b5061023861051e366004611753565b600e60209081526000928352604080842090915290825290205481565b34801561054757600080fd5b506102386105563660046117f9565b610c0f565b34801561056757600080fd5b5061023860035481565b34801561057d57600080fd5b50610238600a5481565b6007805461059490611954565b80601f01602080910402602001604051908101604052809291908181526020018280546105c090611954565b801561060d5780601f106105e25761010080835404028352916020019161060d565b820191906000526020600020905b8154815290600101906020018083116105f057829003601f168201915b505050505081565b6000610622338484610c22565b50600192915050565b6001600160a01b0383166000908152600e6020908152604080832033845290915281205461065a90839061193d565b6001600160a01b0385166000908152600e60209081526040808320338452909152902055610689848484610c84565b5060019392505050565b600c546000906106a34784611900565b6106ad91906118de565b92915050565b6000546001600160a01b031633146106ca57600080fd5b600260095414156107225760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c00000000000000000000000000000000000060448201526064015b60405180910390fd5b6002600955600060085460ff166001811115610740576107406119a5565b1461078d5760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a2046756e64696e67206d757374206265206f70656e006044820152606401610719565b600880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556005546000906107c990606461193d565b600c546005546107d99190611900565b6107e391906118de565b6000549091506107fc906001600160a01b031682610d2c565b60408051478152602081018390527f352ce94da8e3109dc06c05ed84e8a0aaf9ce2c4329dfd10ad1190cf620048972910160405180910390a1600254604080517f61d027b300000000000000000000000000000000000000000000000000000000815290516108dc926001600160a01b0316916361d027b39160048083019260209291908290030181600087803b15801561089657600080fd5b505af11580156108aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ce9190611701565b6108d747610c0f565b610dbe565b6001546108f2906001600160a01b031647610dbe565b506001600955565b6006805461059490611954565b60006106ad6103e883611900565b600260095414156109685760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c0000000000000000000000000000000000006044820152606401610719565b600260095561097a8383836000610edc565b5050600160095550565b6000610622338484610c84565b600260095414156109e45760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c0000000000000000000000000000000000006044820152606401610719565b600260095561097a8383836001610edc565b60026009541415610a495760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c0000000000000000000000000000000000006044820152606401610719565b600260095547610ac15760405162461bcd60e51b815260206004820152602560248201527f43726f776466756e643a204e6f2045544820617661696c61626c6520746f207260448201527f656465656d0000000000000000000000000000000000000000000000000000006064820152608401610719565b336000908152600d6020526040902054811115610b205760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a20496e73756666696369656e742062616c616e6365006044820152606401610719565b600160085460ff166001811115610b3957610b396119a5565b14610bac5760405162461bcd60e51b815260206004820152602260248201527f43726f776466756e643a2046756e64696e67206d75737420626520747261646960448201527f6e670000000000000000000000000000000000000000000000000000000000006064820152608401610719565b6000610bb782610693565b9050610bc33383611208565b610bcd3382610dbe565b60408051338152602081018390527f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369910160405180910390a150506001600955565b6000612710826004546106a39190611900565b6001600160a01b038381166000818152600e602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166000908152600d6020526040902054610ca890829061193d565b6001600160a01b038085166000908152600d60205260408082209390935590841681522054610cd89082906118c6565b6001600160a01b038084166000818152600d602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610c779085815260200190565b80600c54610d3a91906118c6565b600c556001600160a01b0382166000908152600d6020526040902054610d619082906118c6565b6001600160a01b0383166000818152600d60205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610db29085815260200190565b60405180910390a35050565b80471015610e0e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610719565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610e5b576040519150601f19603f3d011682016040523d82523d6000602084013e610e60565b606091505b5050905080610ed75760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610719565b505050565b600060085460ff166001811115610ef557610ef56119a5565b14610f425760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a2046756e64696e67206d757374206265206f70656e006044820152606401610719565b348214610fb75760405162461bcd60e51b815260206004820152602360248201527f43726f776466756e643a20416d6f756e74206973206e6f742076616c7565207360448201527f656e7400000000000000000000000000000000000000000000000000000000006064820152608401610719565b600354471161108e57610fd284610fcd84610907565b610d2c565b821561104f577ffb7955a99240dbf0dd35c467144fb9661fbf7a19839f7d8220400c0dc52e70ae848385846110115761100c86888a611294565b61101c565b61101c86888a611446565b604080516001600160a01b03909516855260208501939093529183015260608201526080015b60405180910390a1611202565b604080516001600160a01b0386168152602081018490527f4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b9101611042565b600061109a834761193d565b905060035481106111135760405162461bcd60e51b815260206004820152602660248201527f43726f776466756e643a2046756e64696e672063617020616c7265616479207260448201527f65616368656400000000000000000000000000000000000000000000000000006064820152608401610719565b600081600354611123919061193d565b905061113286610fcd83610907565b84156111ae577ffb7955a99240dbf0dd35c467144fb9661fbf7a19839f7d8220400c0dc52e70ae868287866111715761116c858a8c611294565b61117c565b61117c858a8c611446565b604080516001600160a01b039095168552602085019390935291830152606082015260800160405180910390a16111f1565b604080516001600160a01b0388168152602081018390527f4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b910160405180910390a15b6111ff866108d7838761193d565b50505b50505050565b6001600160a01b0382166000908152600d602052604090205461122c90829061193d565b6001600160a01b0383166000908152600d6020526040902055600c5461125390829061193d565b600c556040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610db2565b6011546040517f38d37b9b000000000000000000000000000000000000000000000000000000008152600481018490526000916001600160a01b0316906338d37b9b9060240160206040518083038186803b1580156112f257600080fd5b505afa158015611306573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132a9190611812565b84101561139f5760405162461bcd60e51b815260206004820152602d60248201527f556e61626c652070757263686173652065646974696f6e20776974682061766160448201527f696c61626c6520616d6f756e74000000000000000000000000000000000000006064820152608401610719565b6011546040517f121e4984000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b0384811660248301529091169063121e498490604401602060405180830381600087803b15801561140657600080fd5b505af115801561141a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061143e9190611812565b949350505050565b6011546040517f38d37b9b000000000000000000000000000000000000000000000000000000008152600481018490526000916001600160a01b0316906338d37b9b9060240160206040518083038186803b1580156114a457600080fd5b505afa1580156114b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114dc9190611812565b8410156115515760405162461bcd60e51b815260206004820152602d60248201527f556e61626c652070757263686173652065646974696f6e20776974682061766160448201527f696c61626c6520616d6f756e74000000000000000000000000000000000000006064820152608401610719565b600a5461155d5742600a555b6000600b54600a5461156f91906118c6565b9050428110156115c15760405162461bcd60e51b815260206004820152600d60248201527f706f6469756d20636c6f736564000000000000000000000000000000000000006044820152606401610719565b6115cd610384426118c6565b81101561163557806115e1610384426118c6565b6115eb919061193d565b600b60008282546115fc91906118c6565b90915550506040518481527f3841271684238344478fca297cee5d0089898245fb14a4de23aa90c2988a31ed9060200160405180910390a15b6011546040517f121e4984000000000000000000000000000000000000000000000000000000008152600481018690526001600160a01b0385811660248301529091169063121e498490604401602060405180830381600087803b15801561169c57600080fd5b505af11580156116b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116d49190611812565b95945050505050565b6000602082840312156116ef57600080fd5b81356116fa816119bb565b9392505050565b60006020828403121561171357600080fd5b81516116fa816119bb565b60008060006060848603121561173357600080fd5b833561173e816119bb565b95602085013595506040909401359392505050565b6000806040838503121561176657600080fd5b8235611771816119bb565b91506020830135611781816119bb565b809150509250929050565b6000806000606084860312156117a157600080fd5b83356117ac816119bb565b925060208401356117bc816119bb565b929592945050506040919091013590565b600080604083850312156117e057600080fd5b82356117eb816119bb565b946020939093013593505050565b60006020828403121561180b57600080fd5b5035919050565b60006020828403121561182457600080fd5b5051919050565b602081016002831061184d57634e487b7160e01b600052602160045260246000fd5b91905290565b600060208083528351808285015260005b8181101561188057858101830151858201604001528201611864565b81811115611892576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600082198211156118d9576118d961198f565b500190565b6000826118fb57634e487b7160e01b600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156119385761193861198f565b500290565b60008282101561194f5761194f61198f565b500390565b600181811c9082168061196857607f821691505b6020821081141561198957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03811681146119d057600080fd5b5056fea26469706673582212205d9048012b7588097ea25e95c49c1842057509211fae605cb30b7e3548b1bfad64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,663
0xcb1310e2b7df0a8a5849680e98f6b04d2cebcdd6
pragma solidity ^0.4.19; /* Game: CryptoPokemon Domain: CryptoPokemon.com Dev: CryptoPokemon Team */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract PokemonInterface { function levels(uint256 _pokemonId) external view returns ( uint256 level ); function getPokemonOwner(uint _pokemonId)external view returns ( address currentOwner ); } contract PublicBattle { using SafeMath for uint256; //Guess parameter uint public totalGuess; uint public totalPool; uint public publicBattlepm1; uint public publicBattlepm2; address guesser; bool public publicbattlestart; mapping(uint => address[]) pokemonGuessPlayers; mapping(uint => uint) pokemonGuessNumber; mapping(uint => uint) pokemonGuessPrize; mapping(address => uint) playerGuessPM1Number; mapping(address => uint) playerGuessPM2Number; mapping(uint => uint) battleCD; uint public pbWinner; address cpAddress = 0x77fA1D1Ded3F4bed737e9aE870a6f3605445df9c; PokemonInterface pokemonContract = PokemonInterface(cpAddress); address contractCreator; address devFeeAddress; function PublicBattle () public { contractCreator = msg.sender; devFeeAddress = 0xFb2D26b0caa4C331bd0e101460ec9dbE0A4783A4; publicbattlestart = false; publicBattlepm1 = 99999; publicBattlepm2 = 99999; pbWinner = 99999; isPaused = false; totalPool = 0; initialPokemonInfo(); } struct Battlelog { uint pokemonId1; uint pokemonId2; uint result; } Battlelog[] battleresults; struct PokemonDetails { string pokemonName; uint pokemonType; uint total; } PokemonDetails[] pokemoninfo; //modifiers modifier onlyContractCreator() { require (msg.sender == contractCreator); _; } //Owners and admins /* Owner */ function setOwner (address _owner) onlyContractCreator() public { contractCreator = _owner; } // Adresses function setdevFeeAddress (address _devFeeAddress) onlyContractCreator() public { devFeeAddress = _devFeeAddress; } bool isPaused; /* When countdowns and events happening, use the checker. */ function pauseGame() public onlyContractCreator { isPaused = true; } function unPauseGame() public onlyContractCreator { isPaused = false; } function GetGamestatus() public view returns(bool) { return(isPaused); } //set withdraw only use when bugs happned. function withdrawAmount (uint256 _amount) onlyContractCreator() public { msg.sender.transfer(_amount); totalPool = totalPool - _amount; } function initialBattle(uint _pokemonId1,uint _pokemonId2) public{ require(pokemonContract.getPokemonOwner(_pokemonId1) == msg.sender); require(isPaused == false); require(_pokemonId1 != _pokemonId2); require(getPokemonCD(_pokemonId1) == 0); assert(publicbattlestart != true); publicBattlepm1 = _pokemonId1; publicBattlepm2 = _pokemonId2; publicbattlestart = true; pokemonGuessNumber[publicBattlepm1]=0; pokemonGuessNumber[publicBattlepm2]=0; pokemonGuessPrize[publicBattlepm1]=0; pokemonGuessPrize[publicBattlepm2]=0; isPaused = false; battleCD[_pokemonId1] = now + 12 * 1 hours; // add 1% of balance to contract totalGuess = totalPool.div(100); //trigger time } function donateToPool() public payable{ // The pool will make this game maintain forever, 1% of prize goto each publicbattle and // gain 1% of each publicbattle back before distributePrizes require(msg.value >= 0); totalPool = totalPool + msg.value; } function guess(uint _pokemonId) public payable{ require(isPaused == false); assert(msg.value > 0); assert(_pokemonId == publicBattlepm1 || _pokemonId == publicBattlepm2); uint256 calcValue = msg.value; uint256 cutFee = calcValue.div(16); calcValue = calcValue - cutFee; // %3 to the Owner of the card and %3 to dev pokemonContract.getPokemonOwner(_pokemonId).transfer(cutFee.div(2)); devFeeAddress.transfer(cutFee.div(2)); // Total amount totalGuess += calcValue; // Each guess time pokemonGuessNumber[_pokemonId]++; // Each amount pokemonGuessPrize[_pokemonId] = pokemonGuessPrize[_pokemonId] + calcValue; // mapping sender and amount if(_pokemonId == publicBattlepm1){ if(playerGuessPM1Number[msg.sender] != 0){ playerGuessPM1Number[msg.sender] = playerGuessPM1Number[msg.sender] + calcValue; }else{ pokemonGuessPlayers[_pokemonId].push(msg.sender); playerGuessPM1Number[msg.sender] = calcValue; } }else{ if(playerGuessPM2Number[msg.sender] != 0){ playerGuessPM2Number[msg.sender] = playerGuessPM2Number[msg.sender] + calcValue; }else{ pokemonGuessPlayers[_pokemonId].push(msg.sender); playerGuessPM2Number[msg.sender] = calcValue; } } if(pokemonGuessNumber[publicBattlepm1] + pokemonGuessNumber[publicBattlepm2] > 20){ startpublicBattle(publicBattlepm1, publicBattlepm2); } } function startpublicBattle(uint _pokemon1, uint _pokemon2) internal { require(publicBattlepm1 != 99999 && publicBattlepm2 != 99999); uint256 i = uint256(sha256(block.timestamp, block.number-i-1)) % 100 +1; uint256 threshold = dataCalc(_pokemon1, _pokemon2); if(i <= threshold){ pbWinner = publicBattlepm1; }else{ pbWinner = publicBattlepm2; } battleresults.push(Battlelog(_pokemon1,_pokemon2,pbWinner)); distributePrizes(); } function distributePrizes() internal{ // return 1% to the balance to keep public battle forever totalGuess = totalGuess - totalGuess.div(100); for(uint counter=0; counter < pokemonGuessPlayers[pbWinner].length; counter++){ guesser = pokemonGuessPlayers[pbWinner][counter]; if(pbWinner == publicBattlepm1){ guesser.transfer(playerGuessPM1Number[guesser].mul(totalGuess).div(pokemonGuessPrize[pbWinner])); //delete playerGuessPM1Number[guesser]; }else{ guesser.transfer(playerGuessPM2Number[guesser].mul(totalGuess).div(pokemonGuessPrize[pbWinner])); } } uint del; if(pbWinner == publicBattlepm1){ del = publicBattlepm2; }else{ del = publicBattlepm1; } for(uint cdel1=0; cdel1 < pokemonGuessPlayers[pbWinner].length; cdel1++){ guesser = pokemonGuessPlayers[pbWinner][cdel1]; if(pbWinner == publicBattlepm1){ delete playerGuessPM1Number[guesser]; }else{ delete playerGuessPM2Number[guesser]; } } for(uint cdel=0; cdel < pokemonGuessPlayers[del].length; cdel++){ guesser = pokemonGuessPlayers[del][cdel]; if(del == publicBattlepm1){ delete playerGuessPM1Number[guesser]; }else{ delete playerGuessPM2Number[guesser]; } } pokemonGuessNumber[publicBattlepm1]=0; pokemonGuessNumber[publicBattlepm2]=0; pokemonGuessPrize[publicBattlepm1]=0; pokemonGuessPrize[publicBattlepm2]=0; delete pokemonGuessPlayers[publicBattlepm2]; delete pokemonGuessPlayers[publicBattlepm1]; //for(counter=0; counter < pokemonGuessPlayers[pbWinner].length; counter++){ //pokemonGuessPlayers[counter].length = 0; //} counter = 0; publicBattlepm1 = 99999; publicBattlepm2 = 99999; pbWinner = 99999; totalGuess = 0; publicbattlestart = false; } function dataCalc(uint _pokemon1, uint _pokemon2) public view returns (uint256 _threshold){ uint _pokemontotal1; uint _pokemontotal2; // We can just leave the other fields blank: (,,_pokemontotal1) = getPokemonDetails(_pokemon1); (,,_pokemontotal2) = getPokemonDetails(_pokemon2); uint256 threshold = _pokemontotal1.mul(100).div(_pokemontotal1+_pokemontotal2); uint256 pokemonlevel1 = pokemonContract.levels(_pokemon1); uint256 pokemonlevel2 = pokemonContract.levels(_pokemon2); uint leveldiff = pokemonlevel1 - pokemonlevel2; if(pokemonlevel1 >= pokemonlevel2){ threshold = threshold.mul(11**leveldiff).div(10**leveldiff); }else{ //return (100 - dataCalc(_pokemon2, _pokemon1)); threshold = 100 - dataCalc(_pokemon2, _pokemon1); } if(threshold > 90){ threshold = 90; } if(threshold < 10){ threshold = 10; } return threshold; } // This function will return all of the details of the pokemons function getBattleDetails(uint _battleId) public view returns ( uint _pokemon1, uint _pokemon2, uint256 _result ) { Battlelog storage _battle = battleresults[_battleId]; _pokemon1 = _battle.pokemonId1; _pokemon2 = _battle.pokemonId2; _result = _battle.result; } function addPokemonDetails(string _pokemonName, uint _pokemonType, uint _total) public onlyContractCreator{ pokemoninfo.push(PokemonDetails(_pokemonName,_pokemonType,_total)); } // This function will return all of the details of the pokemons function getPokemonDetails(uint _pokemonId) public view returns ( string _pokemonName, uint _pokemonType, uint _total ) { PokemonDetails storage _pokemoninfomation = pokemoninfo[_pokemonId]; _pokemonName = _pokemoninfomation.pokemonName; _pokemonType = _pokemoninfomation.pokemonType; _total = _pokemoninfomation.total; } function totalBattles() public view returns (uint256 _totalSupply) { return battleresults.length; } function getPokemonBet(uint _pokemonId) public view returns (uint256 _pokemonBet){ return pokemonGuessPrize[_pokemonId]; } function getPokemonOwner(uint _pokemonId) public view returns ( address _owner ) { _owner = pokemonContract.getPokemonOwner(_pokemonId); } function getPublicBattlePokemon1() public view returns(uint _pokemonId1){ return publicBattlepm1; } function getPublicBattlePokemon2() public view returns(uint _pokemonId1){ return publicBattlepm2; } function getPokemonBetTimes(uint _pokemonId) public view returns(uint _pokemonBetTimes){ return pokemonGuessNumber[_pokemonId]; } function getPokemonCD(uint _pokemonId) public view returns(uint _pokemonCD){ if(battleCD[_pokemonId] <= now){ return 0; }else{ return battleCD[_pokemonId] - now; } } function initialPokemonInfo() public onlyContractCreator{ addPokemonDetails("PikaChu" ,1, 300); addPokemonDetails("Ninetales",1,505); addPokemonDetails("Charizard" ,2, 534); addPokemonDetails("Eevee",0,325); addPokemonDetails("Jigglypuff" ,0, 270); addPokemonDetails("Pidgeot",2,469); addPokemonDetails("Aerodactyl" ,2, 515); addPokemonDetails("Bulbasaur",0,318); addPokemonDetails("Abra" ,0, 310); addPokemonDetails("Gengar",2,500); addPokemonDetails("Hoothoot" ,0, 262); addPokemonDetails("Goldeen",0,320); } }
0x60606040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630562b9f71461016457806306b2e607146101875780630ea81cf9146101b457806310523af3146101c957806310ebf1031461020057806313af40351461023757806342ed6072146102705780634702d11514610299578063499831f2146102d95780635afbfd4f146102ee5780635d397767146103175780636bbadf09146103405780637e92a7e8146103af57806388e2af0e146103d85780638bbe4719146104045780639189fec11461040e5780639ad1c999146104265780639ea30fae1461045f578063bf1dfb8a146104c2578063c7410070146104eb578063d4fb0d2314610518578063d79521e814610541578063ecfb49a3146105eb578063f0e26f8014610614578063f42b1ae014610659578063f93f13911461066e578063fa5252e4146106a5575b600080fd5b341561016f57600080fd5b61018560048080359060200190919050506106ce565b005b341561019257600080fd5b61019a610778565b604051808215151515815260200191505060405180910390f35b34156101bf57600080fd5b6101c761078f565b005b34156101d457600080fd5b6101ea6004808035906020019091905050610b11565b6040518082815260200191505060405180910390f35b341561020b57600080fd5b6102216004808035906020019091905050610b56565b6040518082815260200191505060405180910390f35b341561024257600080fd5b61026e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b73565b005b341561027b57600080fd5b610283610c13565b6040518082815260200191505060405180910390f35b34156102a457600080fd5b6102c36004808035906020019091908035906020019091905050610c19565b6040518082815260200191505060405180910390f35b34156102e457600080fd5b6102ec610e3f565b005b34156102f957600080fd5b610301610eb8565b6040518082815260200191505060405180910390f35b341561032257600080fd5b61032a610ec2565b6040518082815260200191505060405180910390f35b341561034b57600080fd5b6103ad600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091908035906020019091905050610ec8565b005b34156103ba57600080fd5b6103c2610fa2565b6040518082815260200191505060405180910390f35b34156103e357600080fd5b6104026004808035906020019091908035906020019091905050610fac565b005b61040c6111e0565b005b61042460048080359060200190919050506111fd565b005b341561043157600080fd5b61045d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117a3565b005b341561046a57600080fd5b6104806004808035906020019091905050611843565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104cd57600080fd5b6104d56118f3565b6040518082815260200191505060405180910390f35b34156104f657600080fd5b6104fe611900565b604051808215151515815260200191505060405180910390f35b341561052357600080fd5b61052b611913565b6040518082815260200191505060405180910390f35b341561054c57600080fd5b6105626004808035906020019091905050611919565b6040518080602001848152602001838152602001828103825285818151815260200191508051906020019080838360005b838110156105ae578082015181840152602081019050610593565b50505050905090810190601f1680156105db5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b34156105f657600080fd5b6105fe6119fa565b6040518082815260200191505060405180910390f35b341561061f57600080fd5b6106356004808035906020019091905050611a00565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561066457600080fd5b61066c611a42565b005b341561067957600080fd5b61068f6004808035906020019091905050611abb565b6040518082815260200191505060405180910390f35b34156106b057600080fd5b6106b8611ad8565b6040518082815260200191505060405180910390f35b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561072a57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561076a57600080fd5b806001540360018190555050565b6000601260009054906101000a900460ff16905090565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107eb57600080fd5b61082e6040805190810160405280600781526020017f50696b6143687500000000000000000000000000000000000000000000000000815250600161012c610ec8565b6108716040805190810160405280600981526020017f4e696e6574616c6573000000000000000000000000000000000000000000000081525060016101f9610ec8565b6108b46040805190810160405280600981526020017f43686172697a61726400000000000000000000000000000000000000000000008152506002610216610ec8565b6108f76040805190810160405280600581526020017f45657665650000000000000000000000000000000000000000000000000000008152506000610145610ec8565b61093a6040805190810160405280600a81526020017f4a6967676c797075666600000000000000000000000000000000000000000000815250600061010e610ec8565b61097d6040805190810160405280600781526020017f50696467656f740000000000000000000000000000000000000000000000000081525060026101d5610ec8565b6109c06040805190810160405280600a81526020017f4165726f64616374796c000000000000000000000000000000000000000000008152506002610203610ec8565b610a036040805190810160405280600981526020017f42756c6261736175720000000000000000000000000000000000000000000000815250600061013e610ec8565b610a466040805190810160405280600481526020017f41627261000000000000000000000000000000000000000000000000000000008152506000610136610ec8565b610a896040805190810160405280600681526020017f47656e676172000000000000000000000000000000000000000000000000000081525060026101f4610ec8565b610acc6040805190810160405280600881526020017f486f6f74686f6f740000000000000000000000000000000000000000000000008152506000610106610ec8565b610b0f6040805190810160405280600781526020017f476f6c6465656e000000000000000000000000000000000000000000000000008152506000610140610ec8565b565b600042600a600084815260200190815260200160002054111515610b385760009050610b51565b42600a6000848152602001908152602001600020540390505b919050565b600060076000838152602001908152602001600020549050919050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bcf57600080fd5b80600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60035481565b6000806000806000806000610c2d89611919565b909150905080965050610c3f88611919565b909150905080955050610c70858701610c62606489611ade90919063ffffffff16565b611b1990919063ffffffff16565b9350600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b2596a678a6040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515610d0257600080fd5b5af11515610d0f57600080fd5b505050604051805190509250600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b2596a67896040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515610dab57600080fd5b5af11515610db857600080fd5b50505060405180519050915081830390508183101515610e0457610dfd81600a0a610def83600b0a87611ade90919063ffffffff16565b611b1990919063ffffffff16565b9350610e14565b610e0e888a610c19565b60640393505b605a841115610e2257605a93505b600a841015610e3057600a93505b83965050505050505092915050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e9b57600080fd5b6001601260006101000a81548160ff021916908315150217905550565b6000600354905090565b60025481565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f2457600080fd5b60118054806001018281610f38919061238d565b916000526020600020906003020160006060604051908101604052808781526020018681526020018581525090919091506000820151816000019080519060200190610f859291906123bf565b506020820151816001015560408201518160020155505050505050565b6000600254905090565b3373ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639ea30fae846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561105357600080fd5b5af1151561106057600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff1614151561108c57600080fd5b60001515601260009054906101000a900460ff1615151415156110ae57600080fd5b8082141515156110bd57600080fd5b60006110c883610b11565b1415156110d457600080fd5b60011515600460149054906101000a900460ff161515141515156110f457fe5b81600281905550806003819055506001600460146101000a81548160ff0219169083151502179055506000600660006002548152602001908152602001600020819055506000600660006003548152602001908152602001600020819055506000600760006002548152602001908152602001600020819055506000600760006003548152602001908152602001600020819055506000601260006101000a81548160ff02191690831515021790555061a8c04201600a6000848152602001908152602001600020819055506111d66064600154611b1990919063ffffffff16565b6000819055505050565b600034101515156111f057600080fd5b3460015401600181905550565b60008060001515601260009054906101000a900460ff16151514151561122257600080fd5b60003411151561122e57fe5b60025483148061123f575060035483145b151561124757fe5b34915061125e601083611b1990919063ffffffff16565b90508082039150600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639ea30fae846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15156112f557600080fd5b5af1151561130257600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff166108fc611339600284611b1990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050151561135e57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6113ae600284611b1990919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015156113d357600080fd5b81600080828254019250508190555060066000848152602001908152602001600020600081548092919060010191905055508160076000858152602001908152602001600020540160076000858152602001908152602001600020819055506002548314156115cd576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561150f5781600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115c8565b600560008481526020019081526020016000208054806001018281611534919061243f565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b61175a565b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415156116a05781600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611759565b6005600084815260200190815260200160002080548060010182816116c5919061243f565b9160005260206000209001600033909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b6014600660006003548152602001908152602001600020546006600060025481526020019081526020016000205401111561179e5761179d600254600354611b34565b5b505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ff57600080fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639ea30fae836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15156118d557600080fd5b5af115156118e257600080fd5b505050604051805190509050919050565b6000601080549050905090565b600460149054906101000a900460ff1681565b60005481565b61192161246b565b600080600060118581548110151561193557fe5b90600052602060002090600302019050806000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119dd5780601f106119b2576101008083540402835291602001916119dd565b820191906000526020600020905b8154815290600101906020018083116119c057829003601f168201915b505050505093508060010154925080600201549150509193909250565b60015481565b600080600080601085815481101515611a1557fe5b90600052602060002090600302019050806000015493508060010154925080600201549150509193909250565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a9e57600080fd5b6000601260006101000a81548160ff021916908315150217905550565b600060066000838152602001908152602001600020549050919050565b600b5481565b6000806000841415611af35760009150611b12565b8284029050828482811515611b0457fe5b04141515611b0e57fe5b8091505b5092915050565b6000808284811515611b2757fe5b0490508091505092915050565b6000806201869f60025414158015611b5157506201869f60035414155b1515611b5c57600080fd5b6001606460024260018643030360405180838152602001828152602001925050506020604051808303816000865af11515611b9657600080fd5b50506040518051905060019004811515611bac57fe5b06019150611bba8484610c19565b90508082111515611bd357600254600b81905550611bdd565b600354600b819055505b60108054806001018281611bf1919061247f565b91600052602060002090600302016000606060405190810160405280888152602001878152602001600b548152509091909150600082015181600001556020820151816001015560408201518160020155505050611c4d611c53565b50505050565b600080600080611c6f6064600054611b1990919063ffffffff16565b60005403600081905550600093505b60056000600b54815260200190815260200160002080549050841015611f475760056000600b54815260200190815260200160002084815481101515611cc057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600254600b541415611e3b57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e1160076000600b54815260200190815260200160002054611e0360005460086000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ade90919063ffffffff16565b611b1990919063ffffffff16565b9081150290604051600060405180830381858888f193505050501515611e3657600080fd5b611f3a565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f1460076000600b54815260200190815260200160002054611f0660005460096000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ade90919063ffffffff16565b611b1990919063ffffffff16565b9081150290604051600060405180830381858888f193505050501515611f3957600080fd5b5b8380600101945050611c7e565b600254600b541415611f5d576003549250611f63565b60025492505b600091505b60056000600b548152602001908152602001600020805490508210156120ff5760056000600b54815260200190815260200160002082815481101515611faa57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600254600b54141561208c5760086000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090556120f2565b60096000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090555b8180600101925050611f68565b600090505b600560008481526020019081526020016000208054905081101561229557600560008481526020019081526020016000208181548110151561214257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506002548314156122225760086000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009055612288565b60096000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090555b8080600101915050612104565b600060066000600254815260200190815260200160002081905550600060066000600354815260200190815260200160002081905550600060076000600254815260200190815260200160002081905550600060076000600354815260200190815260200160002081905550600560006003548152602001908152602001600020600061232291906124b1565b600560006002548152602001908152602001600020600061234391906124b1565b600093506201869f6002819055506201869f6003819055506201869f600b81905550600080819055506000600460146101000a81548160ff02191690831515021790555050505050565b8154818355818115116123ba576003028160030283600052602060002091820191016123b991906124d2565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061240057805160ff191683800117855561242e565b8280016001018555821561242e579182015b8281111561242d578251825591602001919060010190612412565b5b50905061243b9190612511565b5090565b815481835581811511612466578183600052602060002091820191016124659190612511565b5b505050565b602060405190810160405280600081525090565b8154818355818115116124ac576003028160030283600052602060002091820191016124ab9190612536565b5b505050565b50805460008255906000526020600020908101906124cf9190612511565b50565b61250e91905b8082111561250a57600080820160006124f1919061256d565b60018201600090556002820160009055506003016124d8565b5090565b90565b61253391905b8082111561252f576000816000905550600101612517565b5090565b90565b61256a91905b8082111561256657600080820160009055600182016000905560028201600090555060030161253c565b5090565b90565b50805460018160011615610100020316600290046000825580601f1061259357506125b2565b601f0160209004906000526020600020908101906125b19190612511565b5b505600a165627a7a72305820838ac83c2d1aab22f1a337e22b0ef73442d02082a6856da1a93794a7f5fcdcca0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,664
0xc01a327e30b0fbf32861333f238b5c36a60abc09
pragma solidity ^0.6.6; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; return c; } /** * @dev Mod two numbers. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } /** * @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 Again Coin * @dev Implementation of IERC20 * Token name,symbol,decimals,totalSupply . */ contract AgainCoin is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; address private _owner; constructor (string memory name_, string memory symbol_,uint256 totalSupply) public { _name = name_; _symbol = symbol_; _owner=msg.sender; _mint(msg.sender,totalSupply); } function _msgSender() internal view virtual returns (address) { return msg.sender; } modifier onlyOwner(){ require(_owner==msg.sender,"Only owner"); _; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. */ function decimals() public pure returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } 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, "AgainCoin: 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].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "AgainCoin: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance.sub(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), "AgainCoin: transfer from the zero address"); require(recipient != address(0), "AgainCoin: transfer to the zero address"); require(amount>0,"Amount must be greater than 0"); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "AgainCoin: transfer amount exceeds balance"); _balances[sender] = senderBalance.sub(amount); _balances[recipient] =_balances[recipient].add(amount) ; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual onlyOwner { require(account != address(0) && amount >0, "AgainCoin: mint to the zero address"); _totalSupply =_totalSupply.add(amount) ; _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "AgainCoin: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "AgainCoin: burn amount exceeds balance"); _balances[account] = accountBalance.sub(amount); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "AgainCoin: approve from the zero address"); require(spender != address(0), "AgainCoin: approve to the zero address"); require(amount>=0,"Amount must be greater than or equal to 0"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461025f57806370a08231146102c557806395d89b411461031d578063a457c2d7146103a0578063a9059cbb14610406578063dd62ed3e1461046c576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019757806323b872dd146101b5578063313ce5671461023b575b600080fd5b6100b66104e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610586565b604051808215151515815260200191505060405180910390f35b61019f6105a4565b6040518082815260200191505060405180910390f35b610221600480360360608110156101cb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ae565b604051808215151515815260200191505060405180910390f35b6102436106bc565b604051808260ff1660ff16815260200191505060405180910390f35b6102ab6004803603604081101561027557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b610307600480360360208110156102db57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610778565b6040518082815260200191505060405180910390f35b6103256107c0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036557808201518184015260208101905061034a565b50505050905090810190601f1680156103925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103ec600480360360408110156103b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610862565b604051808215151515815260200191505060405180910390f35b6104526004803603604081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610973565b604051808215151515815260200191505060405180910390f35b6104ce6004803603604081101561048257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610991565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561057c5780601f106105515761010080835404028352916020019161057c565b820191906000526020600020905b81548152906001019060200180831161055f57829003601f168201915b5050505050905090565b600061059a610593610a18565b8484610a20565b6001905092915050565b6000600254905090565b60006105bb848484610c71565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610606610a18565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561069c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611143602c913960400191505060405180910390fd5b6106b0856106a8610a18565b858403610a20565b60019150509392505050565b60006012905090565b600061076e6106d2610a18565b8461076985600160006106e3610a18565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe290919063ffffffff16565b610a20565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108585780601f1061082d57610100808354040283529160200191610858565b820191906000526020600020905b81548152906001019060200180831161083b57829003601f168201915b5050505050905090565b60008060016000610871610a18565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061116f6029913960400191505060405180910390fd5b61096861094f610a18565b85610963868561106a90919063ffffffff16565b610a20565b600191505092915050565b6000610987610980610a18565b8484610c71565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610aa6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806112126028913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061111d6026913960400191505060405180910390fd5b6000811015610b86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806111986029913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806110f46029913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806111eb6027913960400191505060405180910390fd5b60008111610df3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610e8f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806111c1602a913960400191505060405180910390fd5b610ea2828261106a90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f35826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe290919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b600080828401905083811015611060576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000828211156110e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b60008284039050809150509291505056fe416761696e436f696e3a207472616e736665722066726f6d20746865207a65726f2061646472657373416761696e436f696e3a20617070726f766520746f20746865207a65726f2061646472657373416761696e436f696e3a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365416761696e436f696e3a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416d6f756e74206d7573742062652067726561746572207468616e206f7220657175616c20746f2030416761696e436f696e3a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416761696e436f696e3a207472616e7366657220746f20746865207a65726f2061646472657373416761696e436f696e3a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122067ad5806f4a6b896c3a96fd9244e86694895cee782dd9da11e972c8ad912524c64736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,665
0xb65E16b44A80C9c44aDdD56a5014CbA2814a82D1
pragma solidity ^0.4.18; // ------------------------------------------------- // Assistive Reality ARX Token - ICO token sale contract // contact staff@aronline.io for queries // Revision 20b // Refunds integrated, full test suite 20r passed // ------------------------------------------------- // ERC Token Standard #20 interface: // https://github.com/ethereum/EIPs/issues/20 // ------------------------------------------------ // 2018 improvements: // - Updates to comply with latest Solidity versioning (0.4.18): // - Classification of internal/private vs public functions // - Specification of pure functions such as SafeMath integrated functions // - Conversion of all constant to view or pure dependant on state changed // - Full regression test of code updates // - Revision of block number timing for new Ethereum block times // - Removed duplicate Buy/Transfer event call in buyARXtokens function (ethScan output verified) // - Burn event now records number of ARX tokens burned vs Refund event Eth // - Transfer event now fired when beneficiaryWallet withdraws // - Gas req optimisation for payable function to maximise compatibility // - Going live in code ahead of ICO announcement 09th March 2018 19:30 GMT // ------------------------------------------------- // Security reviews passed - cycle 20r // Functional reviews passed - cycle 20r // Final code revision and regression test cycle passed - cycle 20r // ------------------------------------------------- contract owned { address public owner; function owned() internal { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } contract safeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; safeAssert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { safeAssert(b > 0); uint256 c = a / b; safeAssert(a == b * c + a % b); return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { safeAssert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; safeAssert(c>=a && c>=b); return c; } function safeAssert(bool assertion) internal pure { if (!assertion) revert(); } } contract StandardToken is owned, safeMath { function balanceOf(address who) view public returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract ARXCrowdsale is owned, safeMath { // owner/admin & token reward address public admin = owner; // admin address StandardToken public tokenReward; // address of the token used as reward // deployment variables for static supply sale uint256 private initialTokenSupply; uint256 private tokensRemaining; // multi-sig addresses and price variable address private beneficiaryWallet; // beneficiaryMultiSig (founder group) or wallet account // uint256 values for min,max,caps,tracking uint256 public amountRaisedInWei; // uint256 public fundingMinCapInWei; // uint256 public fundingMaxCapInWei; // // loop control, ICO startup and limiters string public CurrentStatus = ""; // current crowdsale status uint256 public fundingStartBlock; // crowdsale start block# uint256 public fundingEndBlock; // crowdsale end block# bool public isCrowdSaleClosed = false; // crowdsale completion boolean bool private areFundsReleasedToBeneficiary = false; // boolean for founder to receive Eth or not bool public isCrowdSaleSetup = false; // boolean for crowdsale setup event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); event Buy(address indexed _sender, uint256 _eth, uint256 _ARX); event Refund(address indexed _refunder, uint256 _value); event Burn(address _from, uint256 _value); mapping(address => uint256) balancesArray; mapping(address => uint256) usersARXfundValue; // default function, map admin function ARXCrowdsale() public onlyOwner { admin = msg.sender; CurrentStatus = "Crowdsale deployed to chain"; } // total number of tokens initially function initialARXSupply() public view returns (uint256 initialARXtokenCount) { return safeDiv(initialTokenSupply,1000000000000000000); // div by 1000000000000000000 for display normalisation (18 decimals) } // remaining number of tokens function remainingARXSupply() public view returns (uint256 remainingARXtokenCount) { return safeDiv(tokensRemaining,1000000000000000000); // div by 1000000000000000000 for display normalisation (18 decimals) } // setup the CrowdSale parameters function SetupCrowdsale(uint256 _fundingStartBlock, uint256 _fundingEndBlock) public onlyOwner returns (bytes32 response) { if ((msg.sender == admin) && (!(isCrowdSaleSetup)) && (!(beneficiaryWallet > 0))) { // init addresses beneficiaryWallet = 0x98DE47A1F7F96500276900925B334E4e54b1caD5; tokenReward = StandardToken(0xb0D926c1BC3d78064F3e1075D5bD9A24F35Ae6C5); // funding targets fundingMinCapInWei = 30000000000000000000; // 300 ETH wei initialTokenSupply = 277500000000000000000000000; // 277,500,000 + 18 dec resolution // update values amountRaisedInWei = 0; tokensRemaining = initialTokenSupply; fundingStartBlock = _fundingStartBlock; fundingEndBlock = _fundingEndBlock; fundingMaxCapInWei = 4500000000000000000000; // configure crowdsale isCrowdSaleSetup = true; isCrowdSaleClosed = false; CurrentStatus = "Crowdsale is setup"; return "Crowdsale is setup"; } else if (msg.sender != admin) { return "not authorised"; } else { return "campaign cannot be changed"; } } function checkPrice() internal view returns (uint256 currentPriceValue) { if (block.number >= 5532293) { return (2250); } else if (block.number >= 5490292) { return (2500); } else if (block.number >= 5406291) { return (2750); } else if (block.number >= 5370290) { return (3000); } else if (block.number >= 5352289) { return (3250); } else if (block.number >= 5310289) { return (3500); } else if (block.number >= 5268288) { return (4000); } else if (block.number >= 5232287) { return (4500); } else if (block.number >= fundingStartBlock) { return (5000); } } // default payable function when sending ether to this contract function () public payable { // 0. conditions (length, crowdsale setup, zero check, exceed funding contrib check, contract valid check, within funding block range check, balance overflow check etc) require(!(msg.value == 0) && (msg.data.length == 0) && (block.number <= fundingEndBlock) && (block.number >= fundingStartBlock) && (tokensRemaining > 0)); // 1. vars uint256 rewardTransferAmount = 0; // 2. effects amountRaisedInWei = safeAdd(amountRaisedInWei, msg.value); rewardTransferAmount = (safeMul(msg.value, checkPrice())); // 3. interaction tokensRemaining = safeSub(tokensRemaining, rewardTransferAmount); tokenReward.transfer(msg.sender, rewardTransferAmount); // 4. events usersARXfundValue[msg.sender] = safeAdd(usersARXfundValue[msg.sender], msg.value); Buy(msg.sender, msg.value, rewardTransferAmount); } function beneficiaryMultiSigWithdraw(uint256 _amount) public onlyOwner { require(areFundsReleasedToBeneficiary && (amountRaisedInWei >= fundingMinCapInWei)); beneficiaryWallet.transfer(_amount); Transfer(this, beneficiaryWallet, _amount); } function checkGoalReached() public onlyOwner { // return crowdfund status to owner for each result case, update public vars // update state & status variables require (isCrowdSaleSetup); if ((amountRaisedInWei < fundingMinCapInWei) && (block.number <= fundingEndBlock && block.number >= fundingStartBlock)) { // ICO in progress, under softcap areFundsReleasedToBeneficiary = false; isCrowdSaleClosed = false; CurrentStatus = "In progress (Eth < Softcap)"; } else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number < fundingStartBlock)) { // ICO has not started areFundsReleasedToBeneficiary = false; isCrowdSaleClosed = false; CurrentStatus = "Crowdsale is setup"; } else if ((amountRaisedInWei < fundingMinCapInWei) && (block.number > fundingEndBlock)) { // ICO ended, under softcap areFundsReleasedToBeneficiary = false; isCrowdSaleClosed = true; CurrentStatus = "Unsuccessful (Eth < Softcap)"; } else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining == 0)) { // ICO ended, all tokens bought! areFundsReleasedToBeneficiary = true; isCrowdSaleClosed = true; CurrentStatus = "Successful (ARX >= Hardcap)!"; } else if ((amountRaisedInWei >= fundingMinCapInWei) && (block.number > fundingEndBlock) && (tokensRemaining > 0)) { // ICO ended, over softcap! areFundsReleasedToBeneficiary = true; isCrowdSaleClosed = true; CurrentStatus = "Successful (Eth >= Softcap)!"; } else if ((amountRaisedInWei >= fundingMinCapInWei) && (tokensRemaining > 0) && (block.number <= fundingEndBlock)) { // ICO in progress, over softcap! areFundsReleasedToBeneficiary = true; isCrowdSaleClosed = false; CurrentStatus = "In progress (Eth >= Softcap)!"; } } function refund() public { // any contributor can call this to have their Eth returned. user's purchased ARX tokens are burned prior refund of Eth. //require minCap not reached require ((amountRaisedInWei < fundingMinCapInWei) && (isCrowdSaleClosed) && (block.number > fundingEndBlock) && (usersARXfundValue[msg.sender] > 0)); //burn user's token ARX token balance, refund Eth sent uint256 ethRefund = usersARXfundValue[msg.sender]; balancesArray[msg.sender] = 0; usersARXfundValue[msg.sender] = 0; //record Burn event with number of ARX tokens burned Burn(msg.sender, usersARXfundValue[msg.sender]); //send Eth back msg.sender.transfer(ethRefund); //record Refund event with number of Eth refunded in transaction Refund(msg.sender, ethRefund); } }
0x6060604052600436106100f05763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301cb3b20811461027c578063279029b31461029157806337205d76146102b657806344a71bc6146102dd578063590e1ae3146102f05780636e66f6e91461030357806372729ff21461033257806379ca0792146103455780637ee6b2d01461035b5780638da5cb5b1461036e5780638e62c9821461038157806391b43d1314610394578063a26d7b94146103a7578063ac06e302146103ba578063d648a647146103d3578063e3306a6f146103e6578063f851a44014610470575b600034158015906100ff575036155b801561010d5750600b544311155b801561011b5750600a544310155b801561012957506000600454115b151561013457600080fd5b6000905061014460065434610483565b600655610158346101536104a7565b610552565b905061016660045482610575565b600455600254600160a060020a031663a9059cbb33836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156101e157600080fd5b6102c65a03f115156101f257600080fd5b50505060405180515050600160a060020a0333166000908152600e602052604090205461021f9034610483565b600160a060020a0333166000818152600e60205260409081902092909255907f1cbc5ab135991bd2b6a4b034a04aa2aa086dac1371cb9b16b8b5e2ed6b036bed90349084905191825260208201526040908101905180910390a250005b341561028757600080fd5b61028f61058e565b005b341561029c57600080fd5b6102a46108a0565b60405190815260200160405180910390f35b34156102c157600080fd5b6102c96108bb565b604051901515815260200160405180910390f35b34156102e857600080fd5b6102a46108ca565b34156102fb57600080fd5b61028f6108d0565b341561030e57600080fd5b610316610a08565b604051600160a060020a03909116815260200160405180910390f35b341561033d57600080fd5b6102a4610a17565b341561035057600080fd5b61028f600435610a1d565b341561036657600080fd5b6102a4610ad8565b341561037957600080fd5b610316610ade565b341561038c57600080fd5b6102a4610aed565b341561039f57600080fd5b6102a4610b03565b34156103b257600080fd5b6102c9610b09565b34156103c557600080fd5b6102a4600435602435610b12565b34156103de57600080fd5b6102a4610cf1565b34156103f157600080fd5b6103f9610cf7565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561043557808201518382015260200161041d565b50505050905090810190601f1680156104625780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047b57600080fd5b610316610d95565b60008282016104a084821080159061049b5750838210155b610da4565b9392505050565b600062546a8543106104bc57506108ca61054f565b6253c67443106104cf57506109c461054f565b62527e5343106104e25750610abe61054f565b6251f1b243106104f55750610bb861054f565b6251ab6143106105085750610cb261054f565b62510751431061051b5750610dac61054f565b62506340431061052e5750610fa061054f565b624fd69f4310610541575061119461054f565b600a54431061054f57506113885b90565b60008282026104a084158061049b575083858381151561056e57fe5b0414610da4565b600061058383831115610da4565b508082035b92915050565b60005433600160a060020a039081169116146105a957600080fd5b600c5462010000900460ff1615156105c057600080fd5b6007546006541080156105e25750600b5443111580156105e25750600a544310155b1561063f57600c805461ffff1916905560408051908101604052601b81527f496e2070726f67726573732028457468203c20536f667463617029000000000060208201526009908051610639929160200190610de7565b5061089e565b6007546006541080156106535750600a5443105b156106aa57600c805461ffff1916905560408051908101604052601281527f43726f776473616c65206973207365747570000000000000000000000000000060208201526009908051610639929160200190610de7565b6007546006541080156106be5750600b5443115b1561071857600c805461ffff1916600117905560408051908101604052601c81527f556e7375636365737366756c2028457468203c20536f6674636170290000000060208201526009908051610639929160200190610de7565b6007546006541015801561072c5750600454155b1561079057600c805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028415258203e3d204861726463617029210000000060208201526009908051610639929160200190610de7565b600754600654101580156107a55750600b5443115b80156107b357506000600454115b1561081757600c805460ff1961ff00199091166101001716600117905560408051908101604052601c81527f5375636365737366756c2028457468203e3d20536f667463617029210000000060208201526009908051610639929160200190610de7565b6007546006541015801561082d57506000600454115b801561083b5750600b544311155b1561089e57600c805460ff1961ff00199091166101001716905560408051908101604052601d81527f496e2070726f67726573732028457468203e3d20536f667463617029210000006020820152600990805161089c929160200190610de7565b505b565b60006108b6600454670de0b6b3a7640000610db0565b905090565b600c5462010000900460ff1681565b60085481565b60006007546006541080156108e75750600c5460ff165b80156108f45750600b5443115b80156109165750600160a060020a0333166000908152600e6020526040812054115b151561092157600080fd5b5033600160a060020a0381166000908152600e602081815260408084208054600d8452828620869055939092529083905590927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca592909151600160a060020a03909216825260208201526040908101905180910390a1600160a060020a03331681156108fc0282604051600060405180830381858888f1935050505015156109c857600080fd5b33600160a060020a03167fbb28353e4598c3b9199101a66e0989549b659a59a54d2c27fbb183f1932c8e6d8260405190815260200160405180910390a250565b600254600160a060020a031681565b60065481565b60005433600160a060020a03908116911614610a3857600080fd5b600c54610100900460ff168015610a53575060075460065410155b1515610a5e57600080fd5b600554600160a060020a031681156108fc0282604051600060405180830381858888f193505050501515610a9157600080fd5b600554600160a060020a039081169030167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a350565b60075481565b600054600160a060020a031681565b60006108b6600354670de0b6b3a7640000610db0565b600b5481565b600c5460ff1681565b6000805433600160a060020a03908116911614610b2e57600080fd5b60015433600160a060020a039081169116148015610b555750600c5462010000900460ff16155b8015610b6f57506005546000600160a060020a0390911611155b15610c8d576005805473ffffffffffffffffffffffffffffffffffffffff199081167398de47a1f7f96500276900925b334e4e54b1cad5179091556002805490911673b0d926c1bc3d78064f3e1075d5bd9a24f35ae6c51790556801a055690d9db800006007556ae58ae924ab23960580000060038190556000600655600455600a839055600b82905568f3f20b8dfa69d00000600855600c805460ff1962ff000019909116620100001716905560408051908101604052601281527f43726f776473616c65206973207365747570000000000000000000000000000060208201526009908051610c64929160200190610de7565b507f43726f776473616c6520697320736574757000000000000000000000000000009050610588565b60015433600160a060020a03908116911614610cca57507f6e6f7420617574686f7269736564000000000000000000000000000000000000610588565b507f63616d706169676e2063616e6e6f74206265206368616e676564000000000000610588565b600a5481565b60098054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d8d5780601f10610d6257610100808354040283529160200191610d8d565b820191906000526020600020905b815481529060010190602001808311610d7057829003601f168201915b505050505081565b600154600160a060020a031681565b80151561089c57600080fd5b600080610dbf60008411610da4565b8284811515610dca57fe5b0490506104a08385811515610ddb57fe5b06828502018514610da4565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10610e2857805160ff1916838001178555610e55565b82800160010185558215610e55579182015b82811115610e55578251825591602001919060010190610e3a565b50610e61929150610e65565b5090565b61054f91905b80821115610e615760008155600101610e6b5600a165627a7a723058205de489d3e329631d5e8b9f6cd7f241ad1365ead435633e58d57f35c28f6cf7b00029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,666
0xa9b9419fe36004808ab80a3a2b1b1b35e48fedd8
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn'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 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; } } //========= main ================== contract TRUE is StandardToken { string public constant name = "True Chain"; //The Token's name uint8 public constant decimals = 18; //Number of decimals of the smallest unit string public constant symbol = "TRUE"; //An identifier function TRUE() public { totalSupply_ = 1 * (10 ** 8 ) * (10 ** 18); // 100 million TRUE, decimals set to 18 balances[msg.sender] = totalSupply_; Transfer(0, msg.sender, totalSupply_); } }
0x6060604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014257806318160ddd1461019c57806323b872dd146101c5578063313ce5671461023e578063661884631461026d57806370a08231146102c757806395d89b4114610314578063a9059cbb146103a2578063d73dd623146103fc578063dd62ed3e14610456575b600080fd5b34156100bf57600080fd5b6100c76104c2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101075780820151818401526020810190506100ec565b50505050905090810190601f1680156101345780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014d57600080fd5b610182600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104fb565b604051808215151515815260200191505060405180910390f35b34156101a757600080fd5b6101af6105ed565b6040518082815260200191505060405180910390f35b34156101d057600080fd5b610224600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105f7565b604051808215151515815260200191505060405180910390f35b341561024957600080fd5b6102516109b1565b604051808260ff1660ff16815260200191505060405180910390f35b341561027857600080fd5b6102ad600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109b6565b604051808215151515815260200191505060405180910390f35b34156102d257600080fd5b6102fe600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c47565b6040518082815260200191505060405180910390f35b341561031f57600080fd5b610327610c8f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036757808201518184015260208101905061034c565b50505050905090810190601f1680156103945780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103ad57600080fd5b6103e2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cc8565b604051808215151515815260200191505060405180910390f35b341561040757600080fd5b61043c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ee7565b604051808215151515815260200191505060405180910390f35b341561046157600080fd5b6104ac600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110e3565b6040518082815260200191505060405180910390f35b6040805190810160405280600a81526020017f5472756520436861696e0000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561063457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561070c57600080fd5b61075d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461116a90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107f0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108c182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461116a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ac7576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b5b565b610ada838261116a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6040805190810160405280600481526020017f545255450000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d0557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d5257600080fd5b610da3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461116a90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e36826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000610f7882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461118390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561117857fe5b818303905092915050565b600080828401905083811015151561119757fe5b80915050929150505600a165627a7a72305820ecbdf95c605aa572d950ebc0b4c419a625dfd37ee9dec0d0dc719d7dbfbb4e8a0029
{"success": true, "error": null, "results": {}}
6,667
0x528440e2ce53c908ea1a446ddd1bb9930cbecd3b
/** *Submitted for verification at Etherscan.io on 2021-10-15 */ pragma solidity ^0.5.12; /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ 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 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. * * _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) { // 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. * * _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; } /** * @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. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @dev Converts an `address` into `address payable`. Note that this is * simply a type cast: the actual underlying value is not changed. * * _Available since v2.4.0._ */ function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. * * _Available since v2.4.0._ */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract Dead { using SafeERC20 for IERC20; address public dead = address(0); address public owner; IERC20 public dpr; constructor(address _dpr) public{ dpr = IERC20(_dpr); owner = msg.sender; } modifier onlyOwner(){ require(msg.sender == owner, "Not Owner"); _; } function to_dead(uint256 _amount) external onlyOwner{ dpr.safeTransfer(dead, _amount); } function withdraw(uint256 _amount) external onlyOwner { dpr.safeTransfer(owner, _amount); } function transferOwnership(address _newOwner) external onlyOwner{ owner = _newOwner; } }
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632e1a7d4d1461006757806336cf7c87146100865780638da5cb5b146100aa57806392cd1c85146100b2578063f2fde38b146100cf578063f63013aa146100f5575b600080fd5b6100846004803603602081101561007d57600080fd5b50356100fd565b005b61008e61016e565b604080516001600160a01b039092168252519081900360200190f35b61008e61017d565b610084600480360360208110156100c857600080fd5b503561018c565b610084600480360360208110156100e557600080fd5b50356001600160a01b03166101fa565b61008e610267565b6001546001600160a01b03163314610148576040805162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b604482015290519081900360640190fd5b60015460025461016b916001600160a01b0391821691168363ffffffff61027616565b50565b6000546001600160a01b031681565b6001546001600160a01b031681565b6001546001600160a01b031633146101d7576040805162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b604482015290519081900360640190fd5b60005460025461016b916001600160a01b0391821691168363ffffffff61027616565b6001546001600160a01b03163314610245576040805162461bcd60e51b81526020600482015260096024820152682737ba1027bbb732b960b91b604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526102c89084906102cd565b505050565b6102df826001600160a01b031661048b565b610330576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061036e5780518252601f19909201916020918201910161034f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146103d0576040519150601f19603f3d011682016040523d82523d6000602084013e6103d5565b606091505b50915091508161042c576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156104855780806020019051602081101561044857600080fd5b50516104855760405162461bcd60e51b815260040180806020018281038252602a8152602001806104c8602a913960400191505060405180910390fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708181148015906104bf57508115155b94935050505056fe5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820cc192ddb3ea7352852a0257f6d54cda2d12ee56ef2bc20b59b50358290c74bc264736f6c63430005110032
{"success": true, "error": null, "results": {}}
6,668
0x654bdbf1126ade337097172f34255bbcadb66e5e
/** *Submitted for verification at Etherscan.io on 2022-04-29 */ /** */ /** https://t.me/LowTaxInu All of our sell taxes will be used for marketing purposes, we hope that early holders and new buyers can get the most profit through marketing. Low Tax Team */ 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 LowTaxInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "LowTaxInu"; string private constant _symbol = "LowTaxInu"; 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(0xd1cB22e8292BD3CF14087493783c64c95D383EdA); _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 = 3; _feeAddr2 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (0 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 3; _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 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; _maxTxAmount = _tTotal.mul(20).div(1000); _maxWalletSize = _tTotal.mul(40).div(1000); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function enableTrading() external onlyOwner{ tradingOpen = true; } function nonosquare(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab5780639e78fb4f1161006f5780639e78fb4f14610334578063a9059cbb14610349578063b87f137a14610369578063c3c8cd8014610389578063dd62ed3e1461039e578063e8078d94146103e457600080fd5b8063715018a6146102cd578063751039fc146102e25780638a8c523c146102f75780638da5cb5b1461030c57806395d89b411461014557600080fd5b8063273123b7116100fd578063273123b71461021c578063313ce5671461023c5780635932ead114610258578063677daa57146102785780636fc3eaec1461029857806370a08231146102ad57600080fd5b806306fdde0314610145578063095ea7b31461018657806318160ddd146101b65780631b3f71ae146101da57806323b872dd146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201825260098152684c6f77546178496e7560b81b6020820152905161017d9190611872565b60405180910390f35b34801561019257600080fd5b506101a66101a13660046118ec565b6103f9565b604051901515815260200161017d565b3480156101c257600080fd5b5066038d7ea4c680005b60405190815260200161017d565b3480156101e657600080fd5b506101fa6101f536600461192e565b610410565b005b34801561020857600080fd5b506101a66102173660046119f3565b61056d565b34801561022857600080fd5b506101fa610237366004611a34565b6105d6565b34801561024857600080fd5b506040516009815260200161017d565b34801561026457600080fd5b506101fa610273366004611a5f565b610621565b34801561028457600080fd5b506101fa610293366004611a7c565b610669565b3480156102a457600080fd5b506101fa6106c2565b3480156102b957600080fd5b506101cc6102c8366004611a34565b6106ef565b3480156102d957600080fd5b506101fa610711565b3480156102ee57600080fd5b506101fa610785565b34801561030357600080fd5b506101fa6107c1565b34801561031857600080fd5b506000546040516001600160a01b03909116815260200161017d565b34801561034057600080fd5b506101fa610800565b34801561035557600080fd5b506101a66103643660046118ec565b6108bf565b34801561037557600080fd5b506101fa610384366004611a7c565b6108cc565b34801561039557600080fd5b506101fa61091f565b3480156103aa57600080fd5b506101cc6103b9366004611a95565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f057600080fd5b506101fa610955565b6000610406338484610c87565b5060015b92915050565b6000546001600160a01b031633146104435760405162461bcd60e51b815260040161043a90611ace565b60405180910390fd5b60005b815181101561056957600d5482516001600160a01b039091169083908390811061047257610472611b03565b60200260200101516001600160a01b0316141580156104c35750600e5482516001600160a01b03909116908390839081106104af576104af611b03565b60200260200101516001600160a01b031614155b80156104fa5750306001600160a01b03168282815181106104e6576104e6611b03565b60200260200101516001600160a01b031614155b156105575760016006600084848151811061051757610517611b03565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061056181611b2f565b915050610446565b5050565b600061057a848484610dab565b6105cc84336105c785604051806060016040528060288152602001611c92602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111a0565b610c87565b5060019392505050565b6000546001600160a01b031633146106005760405162461bcd60e51b815260040161043a90611ace565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461064b5760405162461bcd60e51b815260040161043a90611ace565b600e8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106935760405162461bcd60e51b815260040161043a90611ace565b600081116106a057600080fd5b6106bc60646106b666038d7ea4c68000846111da565b90611263565b600f5550565b600c546001600160a01b0316336001600160a01b0316146106e257600080fd5b476106ec816112a5565b50565b6001600160a01b03811660009081526002602052604081205461040a906112df565b6000546001600160a01b0316331461073b5760405162461bcd60e51b815260040161043a90611ace565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107af5760405162461bcd60e51b815260040161043a90611ace565b66038d7ea4c68000600f819055601055565b6000546001600160a01b031633146107eb5760405162461bcd60e51b815260040161043a90611ace565b600e805460ff60a01b1916600160a01b179055565b6000546001600160a01b0316331461082a5760405162461bcd60e51b815260040161043a90611ace565b600e54600160a01b900460ff16156108845760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161043a565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ec308266038d7ea4c68000610c87565b6000610406338484610dab565b6000546001600160a01b031633146108f65760405162461bcd60e51b815260040161043a90611ace565b6000811161090357600080fd5b61091960646106b666038d7ea4c68000846111da565b60105550565b600c546001600160a01b0316336001600160a01b03161461093f57600080fd5b600061094a306106ef565b90506106ec8161135c565b6000546001600160a01b0316331461097f5760405162461bcd60e51b815260040161043a90611ace565b600d60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f69190611b48565b6001600160a01b031663c9c6539630600d60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7c9190611b48565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ac9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aed9190611b48565b600e80546001600160a01b0319166001600160a01b03928316179055600d541663f305d7194730610b1d816106ef565b600080610b326000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610b9a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bbf9190611b65565b5050600e805461ffff60b01b191661010160b01b17905550610bef6103e86106b666038d7ea4c6800060146111da565b600f55610c0a6103e86106b666038d7ea4c6800060286111da565b601055600e54600d5460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af1158015610c63573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ec9190611b93565b6001600160a01b038316610ce95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161043a565b6001600160a01b038216610d4a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161043a565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e0f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161043a565b6001600160a01b038216610e715760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161043a565b60008111610ed35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161043a565b6003600a556008600b556000546001600160a01b03848116911614801590610f0957506000546001600160a01b03838116911614155b15611190576001600160a01b03831660009081526006602052604090205460ff16158015610f5057506001600160a01b03821660009081526006602052604090205460ff16155b610f5957600080fd5b600e546001600160a01b038481169116148015610f845750600d546001600160a01b03838116911614155b8015610fa957506001600160a01b03821660009081526005602052604090205460ff16155b8015610fbe5750600e54600160b81b900460ff165b156110c357600f548111156110155760405162461bcd60e51b815260206004820152601960248201527f4578636565647320746865205f6d61785478416d6f756e742e00000000000000604482015260640161043a565b60105481611022846106ef565b61102c9190611bb0565b111561107a5760405162461bcd60e51b815260206004820152601a60248201527f4578636565647320746865206d617857616c6c657453697a652e000000000000604482015260640161043a565b6001600160a01b038216600090815260076020526040902054421161109e57600080fd5b6110a9426000611bb0565b6001600160a01b0383166000908152600760205260409020555b600e546001600160a01b0383811691161480156110ee5750600d546001600160a01b03848116911614155b801561111357506001600160a01b03831660009081526005602052604090205460ff16155b15611123576003600a556008600b555b600061112e306106ef565b600e54909150600160a81b900460ff161580156111595750600e546001600160a01b03858116911614155b801561116e5750600e54600160b01b900460ff165b1561118e5761117c8161135c565b47801561118c5761118c476112a5565b505b505b61119b8383836114d6565b505050565b600081848411156111c45760405162461bcd60e51b815260040161043a9190611872565b5060006111d18486611bc8565b95945050505050565b6000826000036111ec5750600061040a565b60006111f88385611bdf565b9050826112058583611bfe565b1461125c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161043a565b9392505050565b600061125c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114e1565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610569573d6000803e3d6000fd5b60006008548211156113465760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161043a565b600061135061150f565b905061125c8382611263565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113a4576113a4611b03565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156113fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114219190611b48565b8160018151811061143457611434611b03565b6001600160a01b039283166020918202929092010152600d5461145a9130911684610c87565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611493908590600090869030904290600401611c20565b600060405180830381600087803b1580156114ad57600080fd5b505af11580156114c1573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b61119b838383611532565b600081836115025760405162461bcd60e51b815260040161043a9190611872565b5060006111d18486611bfe565b600080600061151c611629565b909250905061152b8282611263565b9250505090565b60008060008060008061154487611667565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157690876116c4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a59086611706565b6001600160a01b0389166000908152600260205260409020556115c781611765565b6115d184836117af565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161691815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006116438282611263565b82101561165e5750506008549266038d7ea4c6800092509050565b90939092509050565b60008060008060008060008060006116848a600a54600b546117d3565b925092509250600061169461150f565b905060008060006116a78e878787611822565b919e509c509a509598509396509194505050505091939550919395565b600061125c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a0565b6000806117138385611bb0565b90508381101561125c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161043a565b600061176f61150f565b9050600061177d83836111da565b3060009081526002602052604090205490915061179a9082611706565b30600090815260026020526040902055505050565b6008546117bc90836116c4565b6008556009546117cc9082611706565b6009555050565b60008080806117e760646106b689896111da565b905060006117fa60646106b68a896111da565b905060006118128261180c8b866116c4565b906116c4565b9992985090965090945050505050565b600080808061183188866111da565b9050600061183f88876111da565b9050600061184d88886111da565b9050600061185f8261180c86866116c4565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561189f57858101830151858201604001528201611883565b818111156118b1576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106ec57600080fd5b80356118e7816118c7565b919050565b600080604083850312156118ff57600080fd5b823561190a816118c7565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561194157600080fd5b823567ffffffffffffffff8082111561195957600080fd5b818501915085601f83011261196d57600080fd5b81358181111561197f5761197f611918565b8060051b604051601f19603f830116810181811085821117156119a4576119a4611918565b6040529182528482019250838101850191888311156119c257600080fd5b938501935b828510156119e7576119d8856118dc565b845293850193928501926119c7565b98975050505050505050565b600080600060608486031215611a0857600080fd5b8335611a13816118c7565b92506020840135611a23816118c7565b929592945050506040919091013590565b600060208284031215611a4657600080fd5b813561125c816118c7565b80151581146106ec57600080fd5b600060208284031215611a7157600080fd5b813561125c81611a51565b600060208284031215611a8e57600080fd5b5035919050565b60008060408385031215611aa857600080fd5b8235611ab3816118c7565b91506020830135611ac3816118c7565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611b4157611b41611b19565b5060010190565b600060208284031215611b5a57600080fd5b815161125c816118c7565b600080600060608486031215611b7a57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ba557600080fd5b815161125c81611a51565b60008219821115611bc357611bc3611b19565b500190565b600082821015611bda57611bda611b19565b500390565b6000816000190483118215151615611bf957611bf9611b19565b500290565b600082611c1b57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c705784516001600160a01b031683529383019391830191600101611c4b565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c1730576694ed883dc8ba6d00d32663ac6aaabd368a962a3a6037e0f41a6c86b64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,669
0x5cfd3c6e6e8c823253a1d144d8ea6b7017bc5591
/** ORB-IT.FINANCE ------------- https://orb-it.finance https://t.me/orbitfinance TLDR: ----- ORB and clones failed because of instant buyers & sellers on Uniswap. This is why we chose to lock trading for 12 hours from the moment we list on Uniswap! (See website for countdown timer) During those 12 hours STAKING is the only way to get tokens and earn rewards. This will ensure we have enough liquidity for the moment trading goes live on uniswap. **/ pragma solidity ^0.6.6; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c;} function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow");} function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c;} function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) {return 0;} uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c;} function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero");} function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { 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 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); } 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; } } /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev Give an account access to this role. */ function add(Role storage role, address account) internal { require(!has(role, account), "Roles: account already has role"); role.bearer[account] = true; } /** * @dev Remove an account's access to this role. */ function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); 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), "Roles: account is the zero address"); return role.bearer[account]; } } contract MinterRole is Context { using Roles for Roles.Role; event MinterAdded(address indexed account); event MinterRemoved(address indexed account); Roles.Role private _minters; constructor () internal { _addMinter(_msgSender()); } modifier onlyMinter() { require(isMinter(_msgSender()), "MinterRole: sorry only callable by UniswapV2"); _; } function isMinter(address account) public view returns (bool) { return _minters.has(account); } function addMinter(address account) public onlyMinter { _addMinter(account); } function removeMinter(address account) public onlyMinter { _removeMinter(account); } function renounceMinter() public { _removeMinter(_msgSender()); } function _addMinter(address account) internal { _minters.add(account); emit MinterAdded(account); } function _removeMinter(address account) internal { _minters.remove(account); emit MinterRemoved(account); } } contract CanTransferRole is Context { using Roles for Roles.Role; event CanTransferAdded(address indexed account); event CanTransferRemoved(address indexed account); Roles.Role private _canTransfer; constructor () internal { _addCanTransfer(_msgSender()); } modifier onlyCanTransfer() { require(canTransfer(_msgSender()), "CanTransferRole: caller does not have the CanTransfer role"); _; } function canTransfer(address account) public view returns (bool) { return _canTransfer.has(account); } function addCanTransfer(address account) public onlyCanTransfer { _addCanTransfer(account); } function removeCanTransfer(address account) public onlyCanTransfer { _removeCanTransfer(account); } // Using this function might breaks CORE functionally - be careful function renounceCanTransfer() public { _removeCanTransfer(_msgSender()); } function _addCanTransfer(address account) internal { _canTransfer.add(account); emit CanTransferAdded(account); } function _removeCanTransfer(address account) internal { _canTransfer.remove(account); emit CanTransferRemoved(account); } } interface Uniswap { function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function addLiquidityETH(address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity); function getPair(address tokenA, address tokenB) external view returns (address pair); function WETH() external pure returns (address); } contract orbitToken is Context, IERC20, MinterRole, CanTransferRole { using SafeMath for uint256; event Transfer(address indexed from, address indexed to, uint256 value); mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; constructor () public { _name = "t.me/orbitfinance"; _symbol = "ORBIT"; _decimals = 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 onlyCanTransfer returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override onlyCanTransfer returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(amount != 0, "ERC20: transfer amount was 0"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _dust(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: dust to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function burn(uint256 amount) public onlyMinter { _burn(msg.sender, 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 dropdust(address account, uint256 amount) public onlyMinter { _dust(account, amount); } bool createUniswapAlreadyCalled = false; function createUniswap() public payable{ require(!createUniswapAlreadyCalled); createUniswapAlreadyCalled = true; require(address(this).balance > 0); uint toMint = address(this).balance; _dust(address(this), toMint); address UNIROUTER = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; _allowances[address(this)][UNIROUTER] = toMint; Uniswap(UNIROUTER).addLiquidityETH{ value: address(this).balance }(address(this), toMint, 1, 1, address(this), 33136721748); } receive() external payable { createUniswap(); } }
0x6080604052600436106101395760003560e01c806378fc3cb3116100ab578063a9059cbb1161006f578063a9059cbb146104b1578063aa271e1a146104ea578063ab6ac11a1461051d578063bc1d94c814610525578063dd62ed3e1461055e578063f408d96c1461059957610148565b806378fc3cb3146103e857806395d89b411461041b578063983b2d56146104305780639865027514610463578063a457c2d71461047857610148565b80633092afd5116100fd5780633092afd5146102c1578063313ce567146102f4578063395093511461031f57806342966c68146103585780636ef8b5411461038257806370a08231146103b557610148565b806306fdde031461014d578063095ea7b3146101d7578063101aab781461022457806318160ddd1461025757806323b872dd1461027e57610148565b36610148576101466105ae565b005b600080fd5b34801561015957600080fd5b506101626106b4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019c578181015183820152602001610184565b50505050905090810190601f1680156101c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e357600080fd5b50610210600480360360408110156101fa57600080fd5b506001600160a01b03813516906020013561074a565b604080519115158252519081900360200190f35b34801561023057600080fd5b506101466004803603602081101561024757600080fd5b50356001600160a01b0316610767565b34801561026357600080fd5b5061026c6107be565b60408051918252519081900360200190f35b34801561028a57600080fd5b50610210600480360360608110156102a157600080fd5b506001600160a01b038135811691602081013590911690604001356107c4565b3480156102cd57600080fd5b50610146600480360360208110156102e457600080fd5b50356001600160a01b0316610891565b34801561030057600080fd5b506103096108e5565b6040805160ff9092168252519081900360200190f35b34801561032b57600080fd5b506102106004803603604081101561034257600080fd5b506001600160a01b0381351690602001356108ee565b34801561036457600080fd5b506101466004803603602081101561037b57600080fd5b503561093c565b34801561038e57600080fd5b50610146600480360360208110156103a557600080fd5b50356001600160a01b031661098c565b3480156103c157600080fd5b5061026c600480360360208110156103d857600080fd5b50356001600160a01b03166109db565b3480156103f457600080fd5b506102106004803603602081101561040b57600080fd5b50356001600160a01b03166109f6565b34801561042757600080fd5b50610162610a09565b34801561043c57600080fd5b506101466004803603602081101561045357600080fd5b50356001600160a01b0316610a6a565b34801561046f57600080fd5b50610146610ab9565b34801561048457600080fd5b506102106004803603604081101561049b57600080fd5b506001600160a01b038135169060200135610acb565b3480156104bd57600080fd5b50610210600480360360408110156104d457600080fd5b506001600160a01b038135169060200135610b33565b3480156104f657600080fd5b506102106004803603602081101561050d57600080fd5b50356001600160a01b0316610b8d565b6101466105ae565b34801561053157600080fd5b506101466004803603604081101561054857600080fd5b506001600160a01b038135169060200135610b99565b34801561056a57600080fd5b5061026c6004803603604081101561058157600080fd5b506001600160a01b0381358116916020013516610bed565b3480156105a557600080fd5b50610146610c18565b600754610100900460ff16156105c357600080fd5b6007805461ff001916610100179055476105dc57600080fd5b476105e73082610ca9565b306000818152600360209081526040808320737a250d5630b4cf539739df2c5dacb4c659f2488d808552925291829020849055815163f305d71960e01b81526004810184905260248101859052600160448201819052606482015260848101939093526407b71a3f5460a484015290519091829163f305d71991479160c480830192606092919082900301818588803b15801561068357600080fd5b505af1158015610697573d6000803e3d6000fd5b50505050506040513d60608110156106ae57600080fd5b50505050565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107405780601f1061071557610100808354040283529160200191610740565b820191906000526020600020905b81548152906001019060200180831161072357829003601f168201915b5050505050905090565b600061075e610757610d8f565b8484610d93565b50600192915050565b610777610772610d8f565b6109f6565b6107b25760405162461bcd60e51b815260040180806020018281038252603a8152602001806114d2603a913960400191505060405180910390fd5b6107bb81610e7f565b50565b60045490565b60006107d1610772610d8f565b61080c5760405162461bcd60e51b815260040180806020018281038252603a8152602001806114d2603a913960400191505060405180910390fd5b610817848484610ec1565b61088784610823610d8f565b6108828560405180606001604052806028815260200161150c602891396001600160a01b038a16600090815260036020526040812090610861610d8f565b6001600160a01b031681526020810191909152604001600020549190611065565b610d93565b5060019392505050565b6108a161089c610d8f565b610b8d565b6108dc5760405162461bcd60e51b815260040180806020018281038252602c8152602001806115c0602c913960400191505060405180910390fd5b6107bb816110fc565b60075460ff1690565b600061075e6108fb610d8f565b84610882856003600061090c610d8f565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061113e565b61094761089c610d8f565b6109825760405162461bcd60e51b815260040180806020018281038252602c8152602001806115c0602c913960400191505060405180910390fd5b6107bb338261119f565b610997610772610d8f565b6109d25760405162461bcd60e51b815260040180806020018281038252603a8152602001806114d2603a913960400191505060405180910390fd5b6107bb8161128f565b6001600160a01b031660009081526002602052604090205490565b6000610a036001836112d1565b92915050565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107405780601f1061071557610100808354040283529160200191610740565b610a7561089c610d8f565b610ab05760405162461bcd60e51b815260040180806020018281038252602c8152602001806115c0602c913960400191505060405180910390fd5b6107bb81611338565b610ac9610ac4610d8f565b6110fc565b565b600061075e610ad8610d8f565b84610882856040518060600160405280602581526020016115ec6025913960036000610b02610d8f565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611065565b6000610b40610772610d8f565b610b7b5760405162461bcd60e51b815260040180806020018281038252603a8152602001806114d2603a913960400191505060405180910390fd5b61075e610b86610d8f565b8484610ec1565b6000610a0381836112d1565b610ba461089c610d8f565b610bdf5760405162461bcd60e51b815260040180806020018281038252602c8152602001806115c0602c913960400191505060405180910390fd5b610be98282610ca9565b5050565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b610ac9610c23610d8f565b61128f565b610c3282826112d1565b15610c84576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b6001600160a01b038216610d04576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206475737420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610d11908261113e565b6004556001600160a01b038216600090815260026020526040902054610d37908261113e565b6001600160a01b03831660008181526002602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3390565b6001600160a01b038316610dd85760405162461bcd60e51b815260040180806020018281038252602481526020018061159c6024913960400191505060405180910390fd5b6001600160a01b038216610e1d5760405162461bcd60e51b81526004018080602001828103825260228152602001806114696022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b610e8a600182610c28565b6040516001600160a01b038216907f531fb3f4abc13206cb61d4f7ef7b0acf84a392b92b2ce893be8ef23553e74a8f90600090a250565b6001600160a01b038316610f065760405162461bcd60e51b81526004018080602001828103825260258152602001806115776025913960400191505060405180910390fd5b6001600160a01b038216610f4b5760405162461bcd60e51b81526004018080602001828103825260238152602001806114246023913960400191505060405180910390fd5b80610f9d576040805162461bcd60e51b815260206004820152601c60248201527f45524332303a207472616e7366657220616d6f756e7420776173203000000000604482015290519081900360640190fd5b610fda8160405180606001604052806026815260200161148b602691396001600160a01b0386166000908152600260205260409020549190611065565b6001600160a01b038085166000908152600260205260408082209390935590841681522054611009908261113e565b6001600160a01b0380841660008181526002602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156110f45760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110b95781810151838201526020016110a1565b50505050905090810190601f1680156110e65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b61110760008261137a565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b600082820183811015611198576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b0382166111e45760405162461bcd60e51b81526004018080602001828103825260218152602001806115566021913960400191505060405180910390fd5b61122181604051806060016040528060228152602001611447602291396001600160a01b0385166000908152600260205260409020549190611065565b6001600160a01b03831660009081526002602052604090205560045461124790826113e1565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b61129a60018261137a565b6040516001600160a01b038216907fe63cdbc5df48c9c19f2cdb038b14762dae6eabe99f357a3caab7c1f1f5f26f7290600090a250565b60006001600160a01b0382166113185760405162461bcd60e51b81526004018080602001828103825260228152602001806115346022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b611343600082610c28565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b61138482826112d1565b6113bf5760405162461bcd60e51b81526004018080602001828103825260218152602001806114b16021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b600061119883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061106556fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6543616e5472616e73666572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652043616e5472616e7366657220726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573734d696e746572526f6c653a20736f727279206f6e6c792063616c6c61626c6520627920556e6973776170563245524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220642bb8b92f04eebbf5c7687fa93d97593b21779dc8492263af3b76aacfbee79d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,670
0xd1aaf33fe73939987795e4f50e4256da4ef8fe46
/* Alpha Coin Perfected Tokenomics Welcome to Alpha Coin, a decentralized platform consisting of the latest in Financial tools designed by some of the leading developers in the world and fueled by Alpha Coin, the first & native cryptocurrency of the Alpha ecosystem. Alpha is already developing a city within the Metaverse where multiple streams of income will be injected back into Alpha Coin via buybacks & marketing. The builders have been hired, the designs are ongoing and Alpha Coin is putting the world on notice. Fixed supply: 10,000,000,000 Tokens Minted Tokens Burned: 50% Burned at launch Formula: 6% Marketing, 3% Liquidity, and 2% Reflections. No Presale: A private sale was already held to raise initial liquidity of $25,000. NFT's: Our first collaborative NFT collection will be available to mint the same week of Alpha coin's launch. All profits from NFT sales will be used for buybacks, marketing & to pay our development team. */ 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 AlphaCoin is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 10* 10**9* 10**18; string private _name = 'Alpha Coin ' ; string private _symbol = 'ALPHA '; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function _approve(address ol, address tt, uint256 amount) private { require(ol != address(0), "ERC20: approve from the zero address"); require(tt != address(0), "ERC20: approve to the zero address"); if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); } else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); } } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "BEP20: transfer from the zero address"); require(recipient != address(0), "BEP20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206def91183cd4aa9b02ccdfa1b883efc282f61635ae616a45ec93206c7f66962c64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,671
0x63374a5afa659eca2db6fb049dfdf3af193f551d
pragma solidity ^0.4.18; contract TBsell{ TBCoin TBSC =TBCoin(0x6158e3F89b4398f5fb20D20DbFc5a5c955F0F6dd); address public wallet = 0x61C8C6d0119Cdc3fFFB4E49ebf0899887e49761D; address public TBowner; uint public TBrate = 1200; function TBsell() public{ TBowner = msg.sender; } function () public payable{ require(TBSC.balanceOf(this) >= msg.value*TBrate); TBSC.transfer(msg.sender,msg.value*TBrate); wallet.transfer(msg.value); } function getbackTB(uint amount) public{ assert(msg.sender == TBowner); TBSC.transfer(TBowner,amount); } function changeTBrate(uint rate) public{ assert(msg.sender == TBowner); TBrate = rate; } } /** * @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&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @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 { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken { using SafeMath for uint256; mapping (address => mapping (address => uint256)) allowed; mapping(address => uint256) balances; mapping(address => bool) preICO_address; uint256 public totalSupply; uint256 public endDate; /** * @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) { if( preICO_address[msg.sender] ) require( now > endDate + 120 days ); //Lock coin else require( now > endDate ); //Lock coin balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant public returns (uint256 balance) { return balances[_owner]; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); if( preICO_address[_from] ) require( now > endDate + 120 days ); //Lock coin else require( now > endDate ); //Lock coin balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); if( preICO_address[msg.sender] ) require( now > endDate + 120 days ); //Lock coin else require( now > endDate ); //Lock coin allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant public returns (uint256 remaining) { return allowed[_owner][_spender]; } } contract TBCoin is StandardToken, Ownable { using SafeMath for uint256; // Token Info. string public constant name = "TimeBox Coin"; string public constant symbol = "TB"; uint8 public constant decimals = 18; // Sale period. uint256 public startDate; // uint256 public endDate; // Token Cap for each rounds uint256 public saleCap; // Address where funds are collected. address public wallet; // Amount of raised money in wei. uint256 public weiRaised; // Event event TokenPurchase(address indexed purchaser, uint256 value, uint256 amount); event PreICOTokenPushed(address indexed buyer, uint256 amount); // Modifiers modifier uninitialized() { require(wallet == 0x0); _; } function TBCoin() public{ } // function initialize(address _wallet, uint256 _start, uint256 _end, uint256 _saleCap, uint256 _totalSupply) public onlyOwner uninitialized { require(_start >= getCurrentTimestamp()); require(_start < _end); require(_wallet != 0x0); require(_totalSupply > _saleCap); startDate = _start; endDate = _end; saleCap = _saleCap; wallet = _wallet; totalSupply = _totalSupply; balances[wallet] = _totalSupply.sub(saleCap); balances[0xb1] = saleCap; } function supply() internal view returns (uint256) { return balances[0xb1]; } function getCurrentTimestamp() internal view returns (uint256) { return now; } function getRateAt(uint256 at) public constant returns (uint256) { if (at < startDate) { return 0; } else if (at < (startDate + 3 days)) { return 1500; } else if (at < (startDate + 9 days)) { return 1440; } else if (at < (startDate + 15 days)) { return 1380; } else if (at < (startDate + 21 days)) { return 1320; } else if (at < (startDate + 27 days)) { return 1260; } else if (at <= endDate) { return 1200; } else { return 0; } } // Fallback function can be used to buy tokens function () public payable { buyTokens(msg.sender, msg.value); } // For pushing pre-ICO records function push(address buyer, uint256 amount) public onlyOwner { //b753a98c require(balances[wallet] >= amount); require(now < startDate); require(buyer != wallet); preICO_address[ buyer ] = true; // Transfer balances[wallet] = balances[wallet].sub(amount); balances[buyer] = balances[buyer].add(amount); PreICOTokenPushed(buyer, amount); } function buyTokens(address sender, uint256 value) internal { require(saleActive()); uint256 weiAmount = value; uint256 updatedWeiRaised = weiRaised.add(weiAmount); // Calculate token amount to be purchased uint256 actualRate = getRateAt(getCurrentTimestamp()); uint256 amount = weiAmount.mul(actualRate); // We have enough token to sale require(supply() >= amount); // Transfer balances[0xb1] = balances[0xb1].sub(amount); balances[sender] = balances[sender].add(amount); TokenPurchase(sender, weiAmount, amount); // Update state. weiRaised = updatedWeiRaised; // Forward the fund to fund collection wallet. wallet.transfer(msg.value); } function finalize() public onlyOwner { require(!saleActive()); // Transfer the rest of token to TB team balances[wallet] = balances[wallet].add(balances[0xb1]); balances[0xb1] = 0; } function saleActive() public constant returns (bool) { return (getCurrentTimestamp() >= startDate && getCurrentTimestamp() < endDate && supply() > 0); } }
0x60606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680634611efde146102ae5780634fa4a531146102d1578063521eb273146102f45780638a468e1514610349578063d5f827e21461039e575b60035434026000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561013657600080fd5b6102c65a03f1151561014757600080fd5b505050604051805190501015151561015e57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3360035434026000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561022e57600080fd5b6102c65a03f1151561023f57600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f1935050505015156102ac57600080fd5b005b34156102b957600080fd5b6102cf60048080359060200190919050506103c7565b005b34156102dc57600080fd5b6102f2600480803590602001909190505061042a565b005b34156102ff57600080fd5b610307610590565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561035457600080fd5b61035c6105b6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103a957600080fd5b6103b16105dc565b6040518082815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561042057fe5b8060038190555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561048357fe5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561057157600080fd5b6102c65a03f1151561058257600080fd5b505050604051805190505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600354815600a165627a7a72305820fc839cf7ce2493560ee33bdc5133e46e1574572f6393b47c7e0f2cb330fea4770029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
6,672
0xdbb6b23520472c5070078cd3e7097b36b001fb57
/* This software code is prohibited for copying and distribution. The violation of this requirement will be punished by law. Contact e-mail: thebigbangonline@protonmail.com Project site: http://thebigbang.online/ Calling the methods of this smart contract you accept the rules of the "The Big Bang" game, described by this program code. */ pragma solidity ^0.4.25; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract Ownable { address public owner; address public manager; address public ownerWallet; constructor() public { owner = msg.sender; manager = msg.sender; ownerWallet = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier onlyOwnerOrManager() { require((msg.sender == owner)||(msg.sender == manager)); _; } function transferOwnership(address newOwner) public onlyOwner { owner = newOwner; } function setManager(address _manager) public onlyOwnerOrManager { require(_manager != address(0)); manager = _manager; } function setOwnerWallet(address _ownerWallet) public onlyOwner { require(_ownerWallet != address(0)); ownerWallet = _ownerWallet; } } contract TheBigBangOnline is Ownable { using SafeMath for uint256; bool contractProtection = true; modifier notFromContract() { if ( (msg.sender != tx.origin) && (contractProtection == true)){ revert("call from contract"); } _; } event payEventLog(address indexed _address, uint value, uint periodCount, uint percent, uint time, bool result); event payRefEventLog(address indexed _addressFrom, address indexed _addressTo, uint value, uint percent, uint time, bool result); event payJackpotLog(address indexed _address, uint value, uint totalValue, uint userValue, uint time, bool result); uint public period = 24 hours; uint public startTime = 1537488000; // Fri, 21 Sep 2018 00:00:00 GMT uint public basicDayPercent = 300; //3% uint public bonusDayPercent = 330; //3.3% uint public referrerLevel1Percent = 250; //2.5% uint public referrerLevel2Percent = 500; //5% uint public referrerLevel3Percent = 1000; //10% uint public referrerLevel2Ether = 1 ether; uint public referrerLevel3Ether = 10 ether; uint public minBetLevel1_2 = 0.01 ether; uint public minBetLevel3 = 0.02 ether; uint public minBetLevel4 = 0.05 ether; //If more than 100 ETH in Jackpot Bank uint public referrerAndOwnerPercent = 2000; //20% uint public currBetID = 1; struct BetStruct { uint value; uint refValue; uint firstBetTime; uint lastBetTime; uint lastPaymentTime; uint nextPayAfterTime; bool isExist; uint id; uint referrerID; } mapping (address => BetStruct) public betsDatabase; mapping (uint => address) public addressList; // Jackpot uint public jackpotLevel2Amount = 1 ether; uint public jackpotLevel3Amount = 10 ether; uint public jackpotLevel4Amount = 100 ether; uint public jackpotPercent = 1000; //10% uint public jackpotBank = 0; uint public jackpotMaxTime = 24 hours; uint public jackpotTime = startTime + jackpotMaxTime; uint public increaseJackpotTimeAfterBetLevel1 = 5 minutes; uint public increaseJackpotTimeAfterBetLevel2_3 = 1 minutes; uint public increaseJackpotTimeAfterBetLevel4 = 30 seconds; //If more than 100 ETH in Jackpot Bank uint public gameRound = 1; uint public currJackpotBetID = 0; struct BetStructForJackpot { uint value; address user; } mapping (uint => BetStructForJackpot) public betForJackpot; function setContractProtection(bool _contractProtection) public onlyOwner { contractProtection = _contractProtection; } function bytesToAddress(bytes bys) private pure returns (address addr) { assembly { addr := mload(add(bys, 20)) } } function allBalance() public constant returns (uint) { return address(this).balance; } function addToJackpot() public payable onlyOwnerOrManager { jackpotBank += msg.value; } function addToBank() public payable onlyOwnerOrManager { } function createBet(uint _referrerID) public payable notFromContract { if( (_referrerID >= currBetID)){ revert("Incorrect _referrerID"); } if( (msg.value < minBetLevel1_2)||(msg.value < minBetLevel3 && jackpotBank >= jackpotLevel3Amount)||(msg.value < minBetLevel4 && jackpotBank >= jackpotLevel4Amount) ){ revert("Amount beyond acceptable limits"); } if(betsDatabase[msg.sender].isExist){ if( (betsDatabase[msg.sender].nextPayAfterTime < now) && (gameRound==1) ){ payRewardForAddress(msg.sender); } betsDatabase[msg.sender].value += msg.value; betsDatabase[msg.sender].lastBetTime = now; } else { BetStruct memory betStruct; uint nextPayAfterTime = startTime+((now.sub(startTime)).div(period)).mul(period)+period; betStruct = BetStruct({ value : msg.value, refValue : 0, firstBetTime : now, lastBetTime : now, lastPaymentTime : 0, nextPayAfterTime: nextPayAfterTime, isExist : true, id : currBetID, referrerID : _referrerID }); betsDatabase[msg.sender] = betStruct; addressList[currBetID] = msg.sender; currBetID++; } if(now > jackpotTime){ getJackpot(); } currJackpotBetID++; BetStructForJackpot memory betStructForJackpot; betStructForJackpot.user = msg.sender; betStructForJackpot.value = msg.value; betForJackpot[currJackpotBetID] = betStructForJackpot; if(jackpotBank >= jackpotLevel4Amount){ jackpotTime += increaseJackpotTimeAfterBetLevel4; }else if(jackpotBank >= jackpotLevel2Amount){ jackpotTime += increaseJackpotTimeAfterBetLevel2_3; }else { jackpotTime += increaseJackpotTimeAfterBetLevel1; } if( jackpotTime > now + jackpotMaxTime ) { jackpotTime = now + jackpotMaxTime; } if(gameRound==1){ jackpotBank += msg.value.mul(jackpotPercent).div(10000); } else { jackpotBank += msg.value.mul(10000-referrerAndOwnerPercent).div(10000); } if(betsDatabase[msg.sender].referrerID!=0){ betsDatabase[addressList[betsDatabase[msg.sender].referrerID]].refValue += msg.value; uint currReferrerPercent; uint currReferrerValue = betsDatabase[addressList[betsDatabase[msg.sender].referrerID]].value.add(betsDatabase[addressList[betsDatabase[msg.sender].referrerID]].refValue); if (currReferrerValue >= referrerLevel3Ether){ currReferrerPercent = referrerLevel3Percent; } else if (currReferrerValue >= referrerLevel2Ether) { currReferrerPercent = referrerLevel2Percent; } else { currReferrerPercent = referrerLevel1Percent; } uint refToPay = msg.value.mul(currReferrerPercent).div(10000); bool result = addressList[betsDatabase[msg.sender].referrerID].send( refToPay ); ownerWallet.transfer(msg.value.mul(referrerAndOwnerPercent - currReferrerPercent).div(10000)); emit payRefEventLog(msg.sender, addressList[betsDatabase[msg.sender].referrerID], refToPay, currReferrerPercent, now, result); } else { ownerWallet.transfer(msg.value.mul(referrerAndOwnerPercent).div(10000)); } } function () public payable notFromContract { if(msg.value == 0){ payRewardForAddress(msg.sender); }else{ uint refId = 1; address referrer = bytesToAddress(msg.data); if (betsDatabase[referrer].isExist){ refId = betsDatabase[referrer].id; } createBet(refId); } } function getReward() public notFromContract { payRewardForAddress(msg.sender); } function getRewardForAddress(address _address) public onlyOwnerOrManager { payRewardForAddress(_address); } function payRewardForAddress(address _address) internal { if(gameRound!=1){ revert("The first round end"); } if(!betsDatabase[_address].isExist){ revert("Address are not an investor"); } if(betsDatabase[_address].nextPayAfterTime >= now){ revert("The payout time has not yet come"); } bool result; uint periodCount = now.sub(betsDatabase[_address].nextPayAfterTime).div(period).add(1); uint percent = basicDayPercent; if(betsDatabase[_address].referrerID>0){ percent = bonusDayPercent; } uint toPay = periodCount.mul(betsDatabase[_address].value).div(10000).mul(percent); betsDatabase[_address].lastPaymentTime = now; betsDatabase[_address].nextPayAfterTime += periodCount.mul(period); if(toPay.add(jackpotBank) >= address(this).balance.sub(msg.value) ){ toPay = address(this).balance.sub(jackpotBank).sub(msg.value); gameRound = 2; } result = _address.send(toPay); emit payEventLog(_address, toPay, periodCount, percent, now, result); } function getJackpot() public notFromContract { if(now <= jackpotTime){ revert("Jackpot did not come"); } jackpotTime = now + jackpotMaxTime; if(currJackpotBetID >= 5){ uint toPay = jackpotBank; jackpotBank = 0; if(toPay>address(this).balance){ toPay = address(this).balance; } bool result; uint totalValue = betForJackpot[currJackpotBetID].value + betForJackpot[currJackpotBetID - 1].value + betForJackpot[currJackpotBetID - 2].value + betForJackpot[currJackpotBetID - 3].value + betForJackpot[currJackpotBetID - 4].value; uint winner1ToPay = toPay.mul(betForJackpot[currJackpotBetID].value).div(totalValue); uint winner2ToPay = toPay.mul(betForJackpot[currJackpotBetID-1].value).div(totalValue); uint winner3ToPay = toPay.mul(betForJackpot[currJackpotBetID-2].value).div(totalValue); uint winner4ToPay = toPay.mul(betForJackpot[currJackpotBetID-3].value).div(totalValue); uint winner5ToPay = toPay.sub(winner1ToPay + winner2ToPay + winner3ToPay + winner4ToPay); result = betForJackpot[currJackpotBetID].user.send( winner1ToPay ); emit payJackpotLog(betForJackpot[currJackpotBetID].user, winner1ToPay, totalValue, betForJackpot[currJackpotBetID].value, now, result); result = betForJackpot[currJackpotBetID-1].user.send( winner2ToPay ); emit payJackpotLog(betForJackpot[currJackpotBetID-1].user, winner2ToPay, totalValue, betForJackpot[currJackpotBetID-1].value, now, result); result = betForJackpot[currJackpotBetID-2].user.send( winner3ToPay ); emit payJackpotLog(betForJackpot[currJackpotBetID-2].user, winner3ToPay, totalValue, betForJackpot[currJackpotBetID-2].value, now, result); result = betForJackpot[currJackpotBetID-3].user.send( winner4ToPay ); emit payJackpotLog(betForJackpot[currJackpotBetID-3].user, winner4ToPay, totalValue, betForJackpot[currJackpotBetID-3].value, now, result); result = betForJackpot[currJackpotBetID-4].user.send( winner5ToPay ); emit payJackpotLog(betForJackpot[currJackpotBetID-4].user, winner5ToPay, totalValue, betForJackpot[currJackpotBetID-4].value, now, result); } } }
0x60806040526004361061020d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166250945d81146103175780630de040a91461033e57806310971bee1461035357806320a08d091461036857806320d000181461037d57806323326f3d14610392578063256bcaa0146103a757806333833037146103b15780633d18b912146103c6578063470ca291146103db578063481c6a75146103f0578063486936881461042157806365d6e6a41461045a57806370d762c21461046f57806378e979251461048457806385093668146104995780638aaabf61146104ae5780638da5cb5b146104c35780639329066c146104d85780639335dcb7146104ed57806393c74b37146105025780639dea34ad14610517578063a5f9b5c21461052c578063aad4482514610541578063ac793a6014610562578063b0e547e81461056d578063b810fb4314610582578063bb542ef01461059a578063bd3124e0146105bb578063bf4637e5146105c3578063c040d62b146105d8578063c0d25203146105ed578063c1687feb14610602578063c171fb9114610617578063c7bce8501461062c578063d0ebdbe714610696578063d505c1cf146106b7578063df1836ca146106cc578063e3de5c05146106e1578063ebda6686146106f6578063ef78d4fd1461070b578063f022d9f614610720578063f2fde38b1461073a575b60008033321480159061022e575060025460a060020a900460ff1615156001145b15610271576040805160e560020a62461bcd0281526020600482015260126024820152600080516020611b0e833981519152604482015290519081900360640190fd5b341515610286576102813361075b565b610313565b600191506102c46000368080601f01602080910402602001604051908101604052809392919081815260200183838082843750610aa6945050505050565b600160a060020a03811660009081526011602052604090206006015490915060ff161561030a57600160a060020a03811660009081526011602052604090206007015491505b61031382610aad565b5050005b34801561032357600080fd5b5061032c611138565b60408051918252519081900360200190f35b34801561034a57600080fd5b5061032c61113e565b34801561035f57600080fd5b5061032c611144565b34801561037457600080fd5b5061032c61114a565b34801561038957600080fd5b5061032c611150565b34801561039e57600080fd5b5061032c611156565b6103af61115c565b005b3480156103bd57600080fd5b5061032c611194565b3480156103d257600080fd5b506103af611199565b3480156103e757600080fd5b5061032c611205565b3480156103fc57600080fd5b5061040561120b565b60408051600160a060020a039092168252519081900360200190f35b34801561042d57600080fd5b5061043960043561121a565b60408051928352600160a060020a0390911660208301528051918290030190f35b34801561046657600080fd5b5061032c61123c565b34801561047b57600080fd5b5061032c611242565b34801561049057600080fd5b5061032c611248565b3480156104a557600080fd5b5061032c61124e565b3480156104ba57600080fd5b5061032c611254565b3480156104cf57600080fd5b5061040561125a565b3480156104e457600080fd5b506103af611269565b3480156104f957600080fd5b50610405611796565b34801561050e57600080fd5b5061032c6117a5565b34801561052357600080fd5b5061032c6117ab565b34801561053857600080fd5b5061032c6117b1565b34801561054d57600080fd5b506103af600160a060020a03600435166117b7565b6103af600435610aad565b34801561057957600080fd5b5061032c6117f1565b34801561058e57600080fd5b506104056004356117f7565b3480156105a657600080fd5b506103af600160a060020a0360043516611812565b6103af61186d565b3480156105cf57600080fd5b5061032c61189b565b3480156105e457600080fd5b5061032c6118a1565b3480156105f957600080fd5b5061032c6118a7565b34801561060e57600080fd5b5061032c6118ad565b34801561062357600080fd5b5061032c6118b3565b34801561063857600080fd5b5061064d600160a060020a03600435166118b9565b60408051998a5260208a0198909852888801969096526060880194909452608087019290925260a0860152151560c085015260e084015261010083015251908190036101200190f35b3480156106a257600080fd5b506103af600160a060020a0360043516611908565b3480156106c357600080fd5b5061032c61197a565b3480156106d857600080fd5b5061032c611980565b3480156106ed57600080fd5b5061032c611986565b34801561070257600080fd5b5061032c61198c565b34801561071757600080fd5b5061032c611992565b34801561072c57600080fd5b506103af6004351515611998565b34801561074657600080fd5b506103af600160a060020a03600435166119de565b600080600080601d5460011415156107bd576040805160e560020a62461bcd02815260206004820152601360248201527f54686520666972737420726f756e6420656e6400000000000000000000000000604482015290519081900360640190fd5b600160a060020a03851660009081526011602052604090206006015460ff161515610832576040805160e560020a62461bcd02815260206004820152601b60248201527f4164647265737320617265206e6f7420616e20696e766573746f720000000000604482015290519081900360640190fd5b600160a060020a03851660009081526011602052604090206005015442116108a4576040805160e560020a62461bcd02815260206004820181905260248201527f546865207061796f75742074696d6520686173206e6f742079657420636f6d65604482015290519081900360640190fd5b600354600160a060020a0386166000908152601160205260409020600501546108f8916001916108ec91906108e090429063ffffffff611a2416565b9063ffffffff611a3616565b9063ffffffff611a4d16565b600554600160a060020a03871660009081526011602052604081206008015492955090935010156109295760065491505b600160a060020a03851660009081526011602052604090205461096d90839061096190612710906108e090889063ffffffff611a6316565b9063ffffffff611a6316565b600160a060020a0386166000908152601160205260409020426004909101556003549091506109a390849063ffffffff611a6316565b600160a060020a0386166000908152601160205260409020600501805490910190556109d630313463ffffffff611a2416565b6017546109ea90839063ffffffff611a4d16565b10610a1e57601754610a16903490610a0a9030319063ffffffff611a2416565b9063ffffffff611a2416565b6002601d5590505b604051600160a060020a0386169082156108fc029083906000818181858888f160408051878152602081018a905280820189905242606082015282151560808201529051919950600160a060020a038b1695507f470422121b313df934846544a1cf8956a87f6169f3b9400f9c18059dda8f351b945081900360a00192509050a25050505050565b6014015190565b610ab5611a87565b6000610abf611ad6565b6000808080333214801590610ae2575060025460a060020a900460ff1615156001145b15610b25576040805160e560020a62461bcd0281526020600482015260126024820152600080516020611b0e833981519152604482015290519081900360640190fd5b6010548810610b7e576040805160e560020a62461bcd02815260206004820152601560248201527f496e636f7272656374205f726566657272657249440000000000000000000000604482015290519081900360640190fd5b600c54341080610b9e5750600d5434108015610b9e575060145460175410155b80610bb95750600e5434108015610bb9575060155460175410155b15610c0e576040805160e560020a62461bcd02815260206004820152601f60248201527f416d6f756e74206265796f6e642061636365707461626c65206c696d69747300604482015290519081900360640190fd5b3360009081526011602052604090206006015460ff1615610c7b573360009081526011602052604090206005015442118015610c4c5750601d546001145b15610c5a57610c5a3361075b565b33600090815260116020526040902080543401815542600390910155610dd7565b600354610c9f6003546109616003546108e060045442611a2490919063ffffffff16565b600454010195506101206040519081016040528034815260200160008152602001428152602001428152602001600081526020018781526020016001151581526020016010548152602001898152509650866011600033600160a060020a0316600160a060020a03168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c08201518160060160006101000a81548160ff02191690831515021790555060e0820151816007015561010082015181600801559050503360126000601054815260200190815260200160002060006101000a815481600160a060020a030219169083600160a060020a031602179055506010600081548092919060010191905055505b601954421115610de957610de9611269565b601e80546001908101918290553360208881019182523489526000938452601f905260409092208751815591519101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0390921691909117905560155460175410610e5e57601c54601980549091019055610e87565b60135460175410610e7a57601b54601980549091019055610e87565b601a546019805490910190555b60185442016019541115610e9e5760185442016019555b601d5460011415610ed257610ec46127106108e060165434611a6390919063ffffffff16565b601780549091019055610efb565b610ef16127106108e0600f546127100334611a6390919063ffffffff16565b6017805490910190555b33600090815260116020526040902060080154156110d55733600090815260116020818152604080842060080180548552601280845282862054600160a060020a0390811687528585528387206001908101805434019055925487529084528286205416855292909152909120908101549054610f7791611a4d565b600b549093508310610f8d576009549350610fa6565b600a548310610fa0576008549350610fa6565b60075493505b610fbc6127106108e0348763ffffffff611a6316565b3360009081526011602090815260408083206008015483526012909152808220549051929450600160a060020a03169184156108fc0291859190818181858888f1600254600f54919650600160a060020a031694506108fc9350611034925061271091506108e09034908a900363ffffffff611a6316565b6040518115909202916000818181858888f1935050505015801561105c573d6000803e3d6000fd5b503360008181526011602090815260408083206008015483526012825291829020548251868152918201889052428284015284151560608301529151600160a060020a039290921692917fd75735dab46f17fcbbc85fd6a30e4def4c2e57da4b1610edf3a71de1dc4e68b19181900360800190a361112e565b600254600f54600160a060020a03909116906108fc9061110490612710906108e090349063ffffffff611a6316565b6040518115909202916000818181858888f1935050505015801561112c573d6000803e3d6000fd5b505b5050505050505050565b600a5481565b600c5481565b60065481565b601a5481565b60195481565b60145481565b600054600160a060020a031633148061117f5750600154600160a060020a031633145b151561118a57600080fd5b6017805434019055565b303190565b3332148015906111b7575060025460a060020a900460ff1615156001145b156111fa576040805160e560020a62461bcd0281526020600482015260126024820152600080516020611b0e833981519152604482015290519081900360640190fd5b6112033361075b565b565b600b5481565b600154600160a060020a031681565b601f6020526000908152604090208054600190910154600160a060020a031682565b60185481565b60055481565b60045481565b60175481565b601b5481565b600054600160a060020a031681565b600080808080808080333214801590611290575060025460a060020a900460ff1615156001145b156112d3576040805160e560020a62461bcd0281526020600482015260126024820152600080516020611b0e833981519152604482015290519081900360640190fd5b601954421161132c576040805160e560020a62461bcd02815260206004820152601460248201527f4a61636b706f7420646964206e6f7420636f6d65000000000000000000000000604482015290519081900360640190fd5b6018544201601955601e5460051161112e576017805460009091559750303188111561135757303197505b601e5460031981016000908152601f60205260408082205460021984018352818320546001198501845282842054600019860185528385205495855292909320549384019091019091010196506113bb9087906108e0908b9063ffffffff611a6316565b601e54600019016000908152601f60205260409020549095506113eb9087906108e0908b9063ffffffff611a6316565b601e54600119016000908152601f602052604090205490945061141b9087906108e0908b9063ffffffff611a6316565b601e54600219016000908152601f602052604090205490935061144b9087906108e0908b9063ffffffff611a6316565b9150611463888686018501840163ffffffff611a2416565b601e546000908152601f6020526040808220600101549051929350600160a060020a03169187156108fc0291889190818181858888f1601e546000908152601f60209081526040918290206001810154905483518e81529283018f90528284015242606083015283151560808301529151929d50600160a060020a039091169550600080516020611aee833981519152945081900360a00192509050a2601e54600019016000908152601f6020526040808220600101549051600160a060020a039091169186156108fc02918791818181858888f1601e54600019016000908152601f60209081526040918290206001810154905483518d81529283018f90528284015242606083015283151560808301529151929d50600160a060020a039091169550600080516020611aee833981519152945081900360a00192509050a2601e54600119016000908152601f6020526040808220600101549051600160a060020a039091169185156108fc02918691818181858888f1601e54600119016000908152601f60209081526040918290206001810154905483518c81529283018f90528284015242606083015283151560808301529151929d50600160a060020a039091169550600080516020611aee833981519152945081900360a00192509050a2601e54600219016000908152601f6020526040808220600101549051600160a060020a039091169184156108fc02918591818181858888f1601e54600219016000908152601f60209081526040918290206001810154905483518b81529283018f90528284015242606083015283151560808301529151929d50600160a060020a039091169550600080516020611aee833981519152945081900360a00192509050a2601e54600319016000908152601f6020526040808220600101549051600160a060020a039091169183156108fc02918491818181858888f1601e54600319016000908152601f60209081526040918290206001810154905483518a81529283018f90528284015242606083015283151560808301529151929d50600160a060020a039091169550600080516020611aee833981519152945081900360a00192509050a25050505050505050565b600254600160a060020a031681565b600d5481565b60105481565b601d5481565b600054600160a060020a03163314806117da5750600154600160a060020a031633145b15156117e557600080fd5b6117ee8161075b565b50565b60085481565b601260205260009081526040902054600160a060020a031681565b600054600160a060020a0316331461182957600080fd5b600160a060020a038116151561183e57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a03163314806118905750600154600160a060020a031633145b151561120357600080fd5b60165481565b601c5481565b600e5481565b60155481565b60075481565b60116020526000908152604090208054600182015460028301546003840154600485015460058601546006870154600788015460089098015496979596949593949293919260ff909116919089565b600054600160a060020a031633148061192b5750600154600160a060020a031633145b151561193657600080fd5b600160a060020a038116151561194b57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b601e5481565b600f5481565b60135481565b60095481565b60035481565b600054600160a060020a031633146119af57600080fd5b6002805491151560a060020a0274ff000000000000000000000000000000000000000019909216919091179055565b600054600160a060020a031633146119f557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115611a3057fe5b50900390565b6000808284811515611a4457fe5b04949350505050565b600082820183811015611a5c57fe5b9392505050565b6000828202831580611a7f5750828482811515611a7c57fe5b04145b1515611a5c57fe5b6101206040519081016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152602001600081525090565b6040805180820190915260008082526020820152905600372ea71e3f2bfd1fb31614350b6d827bf7b0842423a4ddba3d8683c1fa32f83f63616c6c2066726f6d20636f6e74726163740000000000000000000000000000a165627a7a7230582050fca99e4689f862cc11e85318145c6abfa3861b4cb66a496793b655bf39c2630029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,673
0xe99bdb2708a367a82925c0a549a07bf328380558
/* https://t.me/sumomusk https://twitter.com/elonmusk/status/1505782437879717890 Total Supply 1,000,000,000 1% Max Transaction 3% Max Wallet 100% liquidity Pool at launch */ // 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 musksumo is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Sumo Musk"; string private constant _symbol = "Sumo Musk"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 11; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 11; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xa20a07aaF2047B29347982633e768813683d6838); address payable private _marketingAddress = payable(0xa20a07aaF2047B29347982633e768813683d6838); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000 * 10**9; uint256 public _maxWalletSize = 30000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b41146101fe57806398a5c3151461047f57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026f57806318160ddd146102a757806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023f57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192e565b6105ca565b005b34801561020a57600080fd5b50604080518082018252600981526853756d6f204d75736b60b81b6020820152905161023691906119f3565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611a48565b610669565b6040519015158152602001610236565b34801561027b57600080fd5b5060145461028f906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b3480156102b357600080fd5b50670de0b6b3a76400005b604051908152602001610236565b3480156102d857600080fd5b5061025f6102e7366004611a74565b610680565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610236565b34801561032a57600080fd5b5060155461028f906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611ab5565b6106e9565b34801561036a57600080fd5b506101fc610379366004611ae2565b610734565b34801561038a57600080fd5b506101fc61077c565b34801561039f57600080fd5b506102be6103ae366004611ab5565b6107c7565b3480156103bf57600080fd5b506101fc6107e9565b3480156103d457600080fd5b506101fc6103e3366004611afd565b61085d565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611ab5565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028f565b34801561045557600080fd5b506101fc610464366004611ae2565b61088c565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b506101fc61049a366004611afd565b6108d4565b3480156104ab57600080fd5b506101fc6104ba366004611b16565b610903565b3480156104cb57600080fd5b5061025f6104da366004611a48565b610941565b3480156104eb57600080fd5b5061025f6104fa366004611ab5565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc61094e565b34801561053057600080fd5b506101fc61053f366004611b48565b6109a2565b34801561055057600080fd5b506102be61055f366004611bcc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611afd565b610a43565b3480156105b657600080fd5b506101fc6105c5366004611ab5565b610a72565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611c05565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611c3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611c66565b915050610600565b5050565b6000610676338484610b5c565b5060015b92915050565b600061068d848484610c80565b6106df84336106da85604051806060016040528060288152602001611d80602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075e5760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b157506013546001600160a01b0316336001600160a01b0316145b6107ba57600080fd5b476107c4816111f6565b50565b6001600160a01b03811660009081526002602052604081205461067a90611230565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016105f490611c05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105f490611c05565b601655565b6000546001600160a01b031633146108b65760405162461bcd60e51b81526004016105f490611c05565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fe5760405162461bcd60e51b81526004016105f490611c05565b601855565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105f490611c05565b600893909355600a91909155600955600b55565b6000610676338484610c80565b6012546001600160a01b0316336001600160a01b0316148061098357506013546001600160a01b0316336001600160a01b0316145b61098c57600080fd5b6000610997306107c7565b90506107c4816112b4565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105f490611c05565b60005b82811015610a3d5781600560008686858181106109ee576109ee611c3a565b9050602002016020810190610a039190611ab5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611c66565b9150506109cf565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105f490611c05565b601755565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105f490611c05565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601554600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0157506001600160a01b03821660009081526010602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610fde5760175481610f7b846107c7565b610f859190611c81565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000610fe9306107c7565b6018546016549192508210159082106110025760165491505b8080156110195750601554600160a81b900460ff16155b801561103357506015546001600160a01b03868116911614155b80156110485750601554600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a0826112b4565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506015546001600160a01b0385811691161480159061112957506015546001600160a01b03848116911614155b15611136575060006111b0565b6015546001600160a01b03858116911614801561116157506014546001600160a01b03848116911614155b1561117357600854600c55600954600d555b6015546001600160a01b03848116911614801561119e57506014546001600160a01b03858116911614155b156111b057600a54600c55600b54600d555b610a3d8484848461143d565b600081848411156111e05760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611c99565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b60006006548211156112975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006112a161146b565b90506112ad838261148e565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fc576112fc611c3a565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113889190611cb0565b8160018151811061139b5761139b611c3a565b6001600160a01b0392831660209182029290920101526014546113c19130911684610b5c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fa908590600090869030904290600401611ccd565b600060405180830381600087803b15801561141457600080fd5b505af1158015611428573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144a5761144a6114d0565b6114558484846114fe565b80610a3d57610a3d600e54600c55600f54600d55565b60008060006114786115f5565b9092509050611487828261148e565b9250505090565b60006112ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611635565b600c541580156114e05750600d54155b156114e757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151087611663565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154290876116c0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115719086611702565b6001600160a01b03891660009081526002602052604090205561159381611761565b61159d84836117ab565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e291815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611610828261148e565b82101561162c57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116565760405162461bcd60e51b81526004016105f491906119f3565b5060006111ed8486611d3e565b60008060008060008060008060006116808a600c54600d546117cf565b925092509250600061169061146b565b905060008060006116a38e878787611824565b919e509c509a509598509396509194505050505091939550919395565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b60008061170f8385611c81565b9050838110156112ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b600061176b61146b565b905060006117798383611874565b306000908152600260205260409020549091506117969082611702565b30600090815260026020526040902055505050565b6006546117b890836116c0565b6006556007546117c89082611702565b6007555050565b60008080806117e960646117e38989611874565b9061148e565b905060006117fc60646117e38a89611874565b905060006118148261180e8b866116c0565b906116c0565b9992985090965090945050505050565b60008080806118338886611874565b905060006118418887611874565b9050600061184f8888611874565b905060006118618261180e86866116c0565b939b939a50919850919650505050505050565b6000826118835750600061067a565b600061188f8385611d60565b90508261189c8583611d3e565b146112ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b803561192981611909565b919050565b6000602080838503121561194157600080fd5b823567ffffffffffffffff8082111561195957600080fd5b818501915085601f83011261196d57600080fd5b81358181111561197f5761197f6118f3565b8060051b604051601f19603f830116810181811085821117156119a4576119a46118f3565b6040529182528482019250838101850191888311156119c257600080fd5b938501935b828510156119e7576119d88561191e565b845293850193928501926119c7565b98975050505050505050565b600060208083528351808285015260005b81811015611a2057858101830151858201604001528201611a04565b81811115611a32576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5b57600080fd5b8235611a6681611909565b946020939093013593505050565b600080600060608486031215611a8957600080fd5b8335611a9481611909565b92506020840135611aa481611909565b929592945050506040919091013590565b600060208284031215611ac757600080fd5b81356112ad81611909565b8035801515811461192957600080fd5b600060208284031215611af457600080fd5b6112ad82611ad2565b600060208284031215611b0f57600080fd5b5035919050565b60008060008060808587031215611b2c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5d57600080fd5b833567ffffffffffffffff80821115611b7557600080fd5b818601915086601f830112611b8957600080fd5b813581811115611b9857600080fd5b8760208260051b8501011115611bad57600080fd5b602092830195509350611bc39186019050611ad2565b90509250925092565b60008060408385031215611bdf57600080fd5b8235611bea81611909565b91506020830135611bfa81611909565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7a57611c7a611c50565b5060010190565b60008219821115611c9457611c94611c50565b500190565b600082821015611cab57611cab611c50565b500390565b600060208284031215611cc257600080fd5b81516112ad81611909565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1d5784516001600160a01b031683529383019391830191600101611cf8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7a57611d7a611c50565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207b83e7351b6a4b10f8d0e4fd8b863ec0092ea605e7e2cb835ec1575a90e88a0564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,674
0xca2796f9f61dc7b238aab043971e49c6164df375
pragma solidity 0.4.24; /** * @title ERC20 Interface */ contract ERC20 { 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); 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 Lockable Token * @author info@yggdrash.io */ contract Lockable { bool public tokenTransfer; address public owner; /** * @dev They can transfer even if tokenTranser flag is false. */ mapping(address => bool) public unlockAddress; /** * @dev They cannot transfer even if tokenTransfer flag is true. */ mapping(address => bool) public lockAddress; event Locked(address lockAddress, bool status); event Unlocked(address unlockedAddress, bool status); /** * @dev check whether can tranfer tokens or not. */ modifier isTokenTransfer { if(!tokenTransfer) { require(unlockAddress[msg.sender]); } _; } /** * @dev check whether registered in lockAddress or not */ modifier checkLock { require(!lockAddress[msg.sender]); _; } modifier isOwner { require(owner == msg.sender); _; } constructor() public { tokenTransfer = false; owner = msg.sender; } /** * @dev add or remove in lockAddress(blacklist) */ function setLockAddress(address target, bool status) external isOwner { require(owner != target); lockAddress[target] = status; emit Locked(target, status); } /** * @dev add or remove in unlockAddress(whitelist) */ function setUnlockAddress(address target, bool status) external isOwner { unlockAddress[target] = status; emit Unlocked(target, status); } } /** * @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 YGGDRASH Token Contract. * @author info@yggdrash.io * @notice This contract is the updated version that fixes the unlocking bug. * This source code is audited by external auditors. */ contract YeedToken is ERC20, Lockable { string public constant name = "YGGDRASH"; string public constant symbol = "YEED"; uint8 public constant decimals = 18; /** * @dev If this flag is true, admin can use enableTokenTranfer(), emergencyTransfer(). */ bool public adminMode; using SafeMath for uint256; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _approvals; uint256 internal _supply; event TokenBurned(address burnAddress, uint256 amountOfTokens); event SetTokenTransfer(bool transfer); event SetAdminMode(bool adminMode); event EmergencyTransfer(address indexed from, address indexed to, uint256 value); modifier isAdminMode { require(adminMode); _; } constructor(uint256 initial_balance) public { require(initial_balance != 0); _supply = initial_balance; _balances[msg.sender] = initial_balance; emit Transfer(address(0), msg.sender, initial_balance); } function totalSupply() public view returns (uint256) { return _supply; } function balanceOf(address who) public view returns (uint256) { return _balances[who]; } function transfer(address to, uint256 value) public isTokenTransfer checkLock returns (bool) { require(to != address(0)); require(_balances[msg.sender] >= value); _balances[msg.sender] = _balances[msg.sender].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(msg.sender, to, value); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _approvals[owner][spender]; } function transferFrom(address from, address to, uint256 value) public isTokenTransfer checkLock returns (bool success) { require(!lockAddress[from]); require(_balances[from] >= value); require(_approvals[from][msg.sender] >= value); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); _approvals[from][msg.sender] = _approvals[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 checkLock returns (bool) { _approvals[msg.sender][spender] = value; emit Approval(msg.sender, spender, 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 checkLock returns (bool) { _approvals[msg.sender][_spender] = ( _approvals[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, _approvals[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 checkLock returns (bool) { uint256 oldValue = _approvals[msg.sender][_spender]; if (_subtractedValue > oldValue) { _approvals[msg.sender][_spender] = 0; } else { _approvals[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, _approvals[msg.sender][_spender]); return true; } /** * @dev Burn tokens can only use by owner */ function burnTokens(uint256 tokensAmount) public isAdminMode isOwner { require(_balances[msg.sender] >= tokensAmount); _balances[msg.sender] = _balances[msg.sender].sub(tokensAmount); _supply = _supply.sub(tokensAmount); emit TokenBurned(msg.sender, tokensAmount); } /** * @dev Set the tokenTransfer flag. * If true, * - unregistered lockAddress can transfer() * - registered lockAddress can not transfer() * If false, * - registered unlockAddress & unregistered lockAddress * - can transfer(), unregistered unlockAddress can not transfer() */ function setTokenTransfer(bool _tokenTransfer) external isAdminMode isOwner { tokenTransfer = _tokenTransfer; emit SetTokenTransfer(tokenTransfer); } function setAdminMode(bool _adminMode) public isOwner { adminMode = _adminMode; emit SetAdminMode(adminMode); } /** * @dev In emergency situation, * admin can use emergencyTransfer() for protecting user's token. */ function emergencyTransfer(address emergencyAddress) public isAdminMode isOwner returns (bool success) { require(emergencyAddress != owner); _balances[owner] = _balances[owner].add(_balances[emergencyAddress]); emit Transfer(emergencyAddress, owner, _balances[emergencyAddress]); emit EmergencyTransfer(emergencyAddress, owner, _balances[emergencyAddress]); _balances[emergencyAddress] = 0; return true; } }
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd5780630e5018341461022257806312582c1a1461027d57806318160ddd146102ac57806323b872dd146102d7578063313ce5671461035c57806334a90d021461038d57806358dd6f23146103e857806366188463146104175780636c4eca271461047c5780636d1b229d146104ab57806370a08231146104d85780637fd196921461052f5780638da5cb5b1461057e57806390de8234146105d557806395d89b4114610604578063a9059cbb14610694578063ae56e668146106f9578063b7eb5e0a14610748578063d73dd623146107a3578063dd62ed3e14610808575b600080fd5b34801561013957600080fd5b5061014261087f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610208600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b8565b604051808215151515815260200191505060405180910390f35b34801561022e57600080fd5b50610263600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a03565b604051808215151515815260200191505060405180910390f35b34801561028957600080fd5b506102aa600480360381019080803515159060200190929190505050610dc9565b005b3480156102b857600080fd5b506102c1610e8c565b6040518082815260200191505060405180910390f35b3480156102e357600080fd5b50610342600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e96565b604051808215151515815260200191505060405180910390f35b34801561036857600080fd5b5061037161133a565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039957600080fd5b506103ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061133f565b604051808215151515815260200191505060405180910390f35b3480156103f457600080fd5b5061041560048036038101908080351515906020019092919050505061135f565b005b34801561042357600080fd5b50610462600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061143b565b604051808215151515815260200191505060405180910390f35b34801561048857600080fd5b50610491611725565b604051808215151515815260200191505060405180910390f35b3480156104b757600080fd5b506104d660048036038101908080359060200190929190505050611737565b005b3480156104e457600080fd5b50610519600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061191a565b6040518082815260200191505060405180910390f35b34801561053b57600080fd5b5061057c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611963565b005b34801561058a57600080fd5b50610593611ae6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105e157600080fd5b506105ea611b0c565b604051808215151515815260200191505060405180910390f35b34801561061057600080fd5b50610619611b1f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065957808201518184015260208101905061063e565b50505050905090810190601f1680156106865780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106a057600080fd5b506106df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b58565b604051808215151515815260200191505060405180910390f35b34801561070557600080fd5b50610746600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611e44565b005b34801561075457600080fd5b50610789600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f6a565b604051808215151515815260200191505060405180910390f35b3480156107af57600080fd5b506107ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f8a565b604051808215151515815260200191505060405180910390f35b34801561081457600080fd5b50610869600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121df565b6040518082815260200191505060405180910390f35b6040805190810160405280600881526020017f594747445241534800000000000000000000000000000000000000000000000081525081565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561091357600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360009054906101000a900460ff161515610a2057600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610a7c57600080fd5b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610ad957600080fd5b610b8b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226690919063ffffffff16565b600460008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fe73b77795c13bee9883a40de3973381a54190f3bc777dcab3a8206d302afc784600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e2557600080fd5b80600360006101000a81548160ff0219169083151502179055507f665e3bdc481c1733308b1c8a060e52dc6ad799813249224ecc6cf4b7980d6c71600360009054906101000a900460ff16604051808215151515815260200191505060405180910390a150565b6000600654905090565b60008060009054906101000a900460ff161515610f0657600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610f0557600080fd5b5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610fb857600080fd5b81600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561100657600080fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561109157600080fd5b6110e382600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228290919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117882600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226690919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061124a82600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228290919063ffffffff16565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b60026020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900460ff16151561137a57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156113d657600080fd5b806000806101000a81548160ff0219169083151502179055507f80abd2ec88759df7bfcb4e7983e7b31c08fd1938cc2c3dedd31dd3486e91904a6000809054906101000a900460ff16604051808215151515815260200191505060405180910390a150565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561149757600080fd5b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156115a5576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611639565b6115b8838261228290919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000809054906101000a900460ff1681565b600360009054906101000a900460ff16151561175257600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156117ae57600080fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156117fc57600080fd5b61184e81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228290919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a68160065461228290919063ffffffff16565b6006819055507f1af5163f80e79b5e554f61e1d052084d3a3fe1166e42a265798c4e2ddce8ffa23382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156119bf57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515611a1c57600080fd5b80600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507fcaf46096bdd957e9271a7e46a00ff61870b80644805049e7ea814162a2b606bc8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900460ff1681565b6040805190810160405280600481526020017f594545440000000000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900460ff161515611bc857600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611bc757600080fd5b5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611c2157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c5d57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611cab57600080fd5b611cfd82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228290919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9282600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226690919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611ea057600080fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f5c42a6eb70f030b267ab6ddbc362cfe8dbe7cc3b42c590692fa695c58aeaca2b8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611fe557600080fd5b61207482600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461226690919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000818301905082811015151561227957fe5b80905092915050565b600082821115151561229057fe5b8183039050929150505600a165627a7a72305820a1e439e3392f323261481a5af15ecca243968e1318061f24aad30c75b14996730029
{"success": true, "error": null, "results": {}}
6,675
0x2cfc5d1ac47c711079f15eb2841a8425fabde15e
/** *Submitted for verification at Etherscan.io on 2021-10-26 */ //SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.9; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } /** * @dev 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 FundsRecovery is Ownable { address payable internal fundsDestination; IERC20 public token; event DestinationChanged( address indexed previousDestination, address indexed newDestination ); /** * Setting new destination of funds recovery. */ function setFundsDestination(address payable _newDestination) public virtual onlyOwner { require(_newDestination != address(0), "address is 0x0"); emit DestinationChanged(fundsDestination, _newDestination); fundsDestination = _newDestination; } /** * Getting funds destination address. */ function getFundsDestination() public view onlyOwner returns (address) { return fundsDestination; } /** * Possibility to recover funds in case they were sent to this address before smart contract deployment */ function claimNative() public { require(fundsDestination != address(0), "address is 0x0"); fundsDestination.transfer(address(this).balance); } /** Transfers selected tokens into owner address. */ function claimTokens(address _token) public { require(fundsDestination != address(0), "address is 0x0"); require( _token != address(token), "native token funds can't be recovered" ); uint256 _amount = IERC20(_token).balanceOf(address(this)); IERC20(_token).transfer(fundsDestination, _amount); } } contract TopperUpper is FundsRecovery { struct Limit { uint256 native; uint256 token; uint256 blocksWindow; } struct CurrentLimit { uint256 amount; uint256 validTill; } mapping(address => bool) public managers; mapping(address => Limit) public approvedAddresses; mapping(address => CurrentLimit) public tokenLimits; // Current period token limits mapping(address => CurrentLimit) public nativeLimits; // Current period native currency limits modifier onlyManager() { require(managers[_msgSender()], "Caller is not a manager"); _; } constructor(address _token) { token = IERC20(_token); } receive() external payable {} function setManagers(address[] memory _managers) public onlyOwner { require(_managers.length > 0, "Please pass at least one manager"); for (uint256 i = 0; i < _managers.length; i++) { managers[_managers[i]] = true; } } function removeManagers(address[] memory _managers) public onlyOwner { require(_managers.length > 0, "Invalid array length"); for (uint256 i = 0; i < _managers.length; i++) { delete managers[_managers[i]]; } } function approveAddresses( address[] memory _addrs, uint256[] memory _limitsNative, uint256[] memory _limitsToken, uint256[] memory _blocksWindow ) public onlyOwner { require( _addrs.length == _limitsNative.length && _limitsNative.length == _limitsToken.length && _blocksWindow.length == _limitsToken.length, "Invalid array length" ); for (uint256 i = 0; i < _addrs.length; i++) { Limit memory limit = Limit( _limitsNative[i], _limitsToken[i], _blocksWindow[i] ); approvedAddresses[_addrs[i]] = limit; } } function disapproveAddresses(address[] memory _addrs) public onlyOwner { require(_addrs.length > 0, "Invalid array length"); for (uint256 i = 0; i < _addrs.length; i++) { delete approvedAddresses[_addrs[i]]; delete nativeLimits[_addrs[i]]; delete tokenLimits[_addrs[i]]; } } function _topupNative(address payable _to, uint256 _amount) internal { if (block.number > nativeLimits[_to].validTill) { require( approvedAddresses[_to].native >= _amount, "Payout limits exceeded" ); nativeLimits[_to].validTill = block.number + approvedAddresses[_to].blocksWindow; nativeLimits[_to].amount = approvedAddresses[_to].native - _amount; } else { require( nativeLimits[_to].amount >= _amount, "Payout limits exceeded" ); nativeLimits[_to].amount -= _amount; } _to.transfer(_amount); } function topupNative(address payable _to, uint256 _amounts) public onlyManager { _topupNative(_to, _amounts); } function topupNatives( address payable[] memory _to, uint256[] memory _amounts ) public onlyManager { require(_amounts.length == _to.length, "Invalid array length"); for (uint256 i = 0; i < _to.length; i++) { topupNative(_to[i], _amounts[i]); } } function _topupToken(address _to, uint256 _amount) internal { if (block.number > tokenLimits[_to].validTill) { require( approvedAddresses[_to].token >= _amount, "Payout limits exceeded" ); tokenLimits[_to].validTill = block.number + approvedAddresses[_to].blocksWindow; tokenLimits[_to].amount = approvedAddresses[_to].token - _amount; } else { require( tokenLimits[_to].amount >= _amount, "Payout limits exceeded" ); tokenLimits[_to].amount -= _amount; } token.transfer(_to, _amount); } function topupToken(address _to, uint256 _amounts) public onlyManager { _topupToken(_to, _amounts); } function topupTokens(address[] memory _to, uint256[] memory _amounts) public onlyManager { require(_amounts.length == _to.length, "Invalid array length"); for (uint256 i = 0; i < _amounts.length; i++) { _topupToken(_to[i], _amounts[i]); } } }
0x6080604052600436106101235760003560e01c806391b571cf116100a0578063f2fde38b11610064578063f2fde38b146103c6578063f4856230146103ef578063f58c5b6e14610406578063fc0c546a14610431578063fdff9b4d1461045c5761012a565b806391b571cf146102ce578063d4f2b668146102f7578063df8de3e714610320578063e7fc94c414610349578063f136a874146103875761012a565b80634784e21b116100e75780634784e21b146102115780634f85d3db1461023a578063714280b314610263578063715018a61461028c5780638da5cb5b146102a35761012a565b80630d4e1a1e1461012f57806310f3ee2914610158578063238e130a14610181578063367caa09146101aa578063417a0698146101d35761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b5061015660048036038101906101519190611f43565b610499565b005b34801561016457600080fd5b5061017f600480360381019061017a919061211a565b61053a565b005b34801561018d57600080fd5b506101a860048036038101906101a39190612163565b610686565b005b3480156101b657600080fd5b506101d160048036038101906101cc919061211a565b610832565b005b3480156101df57600080fd5b506101fa60048036038101906101f59190612190565b610987565b6040516102089291906121cc565b60405180910390f35b34801561021d57600080fd5b50610238600480360381019061023391906122b8565b6109ab565b005b34801561024657600080fd5b50610261600480360381019061025c919061211a565b610b94565b005b34801561026f57600080fd5b5061028a6004803603810190610285919061238f565b610dc3565b005b34801561029857600080fd5b506102a1610e64565b005b3480156102af57600080fd5b506102b8610eec565b6040516102c591906123de565b60405180910390f35b3480156102da57600080fd5b506102f560048036038101906102f091906123f9565b610f15565b005b34801561030357600080fd5b5061031e60048036038101906103199190612534565b61104e565b005b34801561032c57600080fd5b5061034760048036038101906103429190612190565b611187565b005b34801561035557600080fd5b50610370600480360381019061036b9190612190565b6113eb565b60405161037e9291906121cc565b60405180910390f35b34801561039357600080fd5b506103ae60048036038101906103a99190612190565b61140f565b6040516103bd939291906125ac565b60405180910390f35b3480156103d257600080fd5b506103ed60048036038101906103e89190612190565b611439565b005b3480156103fb57600080fd5b50610404611531565b005b34801561041257600080fd5b5061041b61162e565b60405161042891906123de565b60405180910390f35b34801561043d57600080fd5b506104466116d4565b6040516104539190612642565b60405180910390f35b34801561046857600080fd5b50610483600480360381019061047e9190612190565b6116fa565b6040516104909190612678565b60405180910390f35b600360006104a561171a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661052c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610523906126f0565b60405180910390fd5b6105368282611722565b5050565b61054261171a565b73ffffffffffffffffffffffffffffffffffffffff16610560610eec565b73ffffffffffffffffffffffffffffffffffffffff16146105b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ad9061275c565b60405180910390fd5b60008151116105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f1906127c8565b60405180910390fd5b60005b8151811015610682576003600083838151811061061d5761061c6127e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff0219169055808061067a90612846565b9150506105fd565b5050565b61068e61171a565b73ffffffffffffffffffffffffffffffffffffffff166106ac610eec565b73ffffffffffffffffffffffffffffffffffffffff1614610702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f99061275c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610772576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610769906128db565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fe1a66d77649cf0a57b9937073549f30f1c82bb865aaf066d2f299e37a62c6aad60405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b61083a61171a565b73ffffffffffffffffffffffffffffffffffffffff16610858610eec565b73ffffffffffffffffffffffffffffffffffffffff16146108ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a59061275c565b60405180910390fd5b60008151116108f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e990612947565b60405180910390fd5b60005b815181101561098357600160036000848481518110610917576109166127e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061097b90612846565b9150506108f5565b5050565b60056020528060005260406000206000915090508060000154908060010154905082565b6109b361171a565b73ffffffffffffffffffffffffffffffffffffffff166109d1610eec565b73ffffffffffffffffffffffffffffffffffffffff1614610a27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1e9061275c565b60405180910390fd5b82518451148015610a39575081518351145b8015610a46575081518151145b610a85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7c906127c8565b60405180910390fd5b60005b8451811015610b8d5760006040518060600160405280868481518110610ab157610ab06127e8565b5b60200260200101518152602001858481518110610ad157610ad06127e8565b5b60200260200101518152602001848481518110610af157610af06127e8565b5b602002602001015181525090508060046000888581518110610b1657610b156127e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020155905050508080610b8590612846565b915050610a88565b5050505050565b610b9c61171a565b73ffffffffffffffffffffffffffffffffffffffff16610bba610eec565b73ffffffffffffffffffffffffffffffffffffffff1614610c10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c079061275c565b60405180910390fd5b6000815111610c54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4b906127c8565b60405180910390fd5b60005b8151811015610dbf5760046000838381518110610c7757610c766127e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008082016000905560018201600090556002820160009055505060066000838381518110610ceb57610cea6127e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808201600090556001820160009055505060056000838381518110610d5757610d566127e8565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080820160009055600182016000905550508080610db790612846565b915050610c57565b5050565b60036000610dcf61171a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610e56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4d906126f0565b60405180910390fd5b610e608282611a48565b5050565b610e6c61171a565b73ffffffffffffffffffffffffffffffffffffffff16610e8a610eec565b73ffffffffffffffffffffffffffffffffffffffff1614610ee0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed79061275c565b60405180910390fd5b610eea6000611dd7565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60036000610f2161171a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610fa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9f906126f0565b60405180910390fd5b8151815114610fec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe3906127c8565b60405180910390fd5b60005b81518110156110495761103683828151811061100e5761100d6127e8565b5b6020026020010151838381518110611029576110286127e8565b5b6020026020010151611a48565b808061104190612846565b915050610fef565b505050565b6003600061105a61171a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166110e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d8906126f0565b60405180910390fd5b8151815114611125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111c906127c8565b60405180910390fd5b60005b82518110156111825761116f838281518110611147576111466127e8565b5b6020026020010151838381518110611162576111616127e8565b5b6020026020010151610499565b808061117a90612846565b915050611128565b505050565b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611219576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611210906128db565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a1906129d9565b60405180910390fd5b60008173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016112e591906123de565b60206040518083038186803b1580156112fd57600080fd5b505afa158015611311573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113359190612a0e565b90508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401611394929190612a5c565b602060405180830381600087803b1580156113ae57600080fd5b505af11580156113c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113e69190612ab1565b505050565b60066020528060005260406000206000915090508060000154908060010154905082565b60046020528060005260406000206000915090508060000154908060010154908060020154905083565b61144161171a565b73ffffffffffffffffffffffffffffffffffffffff1661145f610eec565b73ffffffffffffffffffffffffffffffffffffffff16146114b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ac9061275c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611525576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151c90612b50565b60405180910390fd5b61152e81611dd7565b50565b600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156115c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ba906128db565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561162b573d6000803e3d6000fd5b50565b600061163861171a565b73ffffffffffffffffffffffffffffffffffffffff16611656610eec565b73ffffffffffffffffffffffffffffffffffffffff16146116ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a39061275c565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b600033905090565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015443111561191e5780600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410156117f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e890612bbc565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201544361183f9190612bdc565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546118d39190612c32565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506119fd565b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410156119a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199a90612bbc565b60405180910390fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160008282546119f59190612c32565b925050819055505b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611a43573d6000803e3d6000fd5b505050565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154431115611c445780600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541015611b17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b0e90612bbc565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015443611b659190612bdc565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154611bf99190612c32565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550611d23565b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541015611cc9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc090612bbc565b60405180910390fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000016000828254611d1b9190612c32565b925050819055505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401611d80929190612c66565b602060405180830381600087803b158015611d9a57600080fd5b505af1158015611dae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611dd29190612ab1565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611eda82611eaf565b9050919050565b611eea81611ecf565b8114611ef557600080fd5b50565b600081359050611f0781611ee1565b92915050565b6000819050919050565b611f2081611f0d565b8114611f2b57600080fd5b50565b600081359050611f3d81611f17565b92915050565b60008060408385031215611f5a57611f59611ea5565b5b6000611f6885828601611ef8565b9250506020611f7985828601611f2e565b9150509250929050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fd182611f88565b810181811067ffffffffffffffff82111715611ff057611fef611f99565b5b80604052505050565b6000612003611e9b565b905061200f8282611fc8565b919050565b600067ffffffffffffffff82111561202f5761202e611f99565b5b602082029050602081019050919050565b600080fd5b600061205082611eaf565b9050919050565b61206081612045565b811461206b57600080fd5b50565b60008135905061207d81612057565b92915050565b600061209661209184612014565b611ff9565b905080838252602082019050602084028301858111156120b9576120b8612040565b5b835b818110156120e257806120ce888261206e565b8452602084019350506020810190506120bb565b5050509392505050565b600082601f83011261210157612100611f83565b5b8135612111848260208601612083565b91505092915050565b6000602082840312156121305761212f611ea5565b5b600082013567ffffffffffffffff81111561214e5761214d611eaa565b5b61215a848285016120ec565b91505092915050565b60006020828403121561217957612178611ea5565b5b600061218784828501611ef8565b91505092915050565b6000602082840312156121a6576121a5611ea5565b5b60006121b48482850161206e565b91505092915050565b6121c681611f0d565b82525050565b60006040820190506121e160008301856121bd565b6121ee60208301846121bd565b9392505050565b600067ffffffffffffffff8211156122105761220f611f99565b5b602082029050602081019050919050565b600061223461222f846121f5565b611ff9565b9050808382526020820190506020840283018581111561225757612256612040565b5b835b81811015612280578061226c8882611f2e565b845260208401935050602081019050612259565b5050509392505050565b600082601f83011261229f5761229e611f83565b5b81356122af848260208601612221565b91505092915050565b600080600080608085870312156122d2576122d1611ea5565b5b600085013567ffffffffffffffff8111156122f0576122ef611eaa565b5b6122fc878288016120ec565b945050602085013567ffffffffffffffff81111561231d5761231c611eaa565b5b6123298782880161228a565b935050604085013567ffffffffffffffff81111561234a57612349611eaa565b5b6123568782880161228a565b925050606085013567ffffffffffffffff81111561237757612376611eaa565b5b6123838782880161228a565b91505092959194509250565b600080604083850312156123a6576123a5611ea5565b5b60006123b48582860161206e565b92505060206123c585828601611f2e565b9150509250929050565b6123d881612045565b82525050565b60006020820190506123f360008301846123cf565b92915050565b600080604083850312156124105761240f611ea5565b5b600083013567ffffffffffffffff81111561242e5761242d611eaa565b5b61243a858286016120ec565b925050602083013567ffffffffffffffff81111561245b5761245a611eaa565b5b6124678582860161228a565b9150509250929050565b600067ffffffffffffffff82111561248c5761248b611f99565b5b602082029050602081019050919050565b60006124b06124ab84612471565b611ff9565b905080838252602082019050602084028301858111156124d3576124d2612040565b5b835b818110156124fc57806124e88882611ef8565b8452602084019350506020810190506124d5565b5050509392505050565b600082601f83011261251b5761251a611f83565b5b813561252b84826020860161249d565b91505092915050565b6000806040838503121561254b5761254a611ea5565b5b600083013567ffffffffffffffff81111561256957612568611eaa565b5b61257585828601612506565b925050602083013567ffffffffffffffff81111561259657612595611eaa565b5b6125a28582860161228a565b9150509250929050565b60006060820190506125c160008301866121bd565b6125ce60208301856121bd565b6125db60408301846121bd565b949350505050565b6000819050919050565b60006126086126036125fe84611eaf565b6125e3565b611eaf565b9050919050565b600061261a826125ed565b9050919050565b600061262c8261260f565b9050919050565b61263c81612621565b82525050565b60006020820190506126576000830184612633565b92915050565b60008115159050919050565b6126728161265d565b82525050565b600060208201905061268d6000830184612669565b92915050565b600082825260208201905092915050565b7f43616c6c6572206973206e6f742061206d616e61676572000000000000000000600082015250565b60006126da601783612693565b91506126e5826126a4565b602082019050919050565b60006020820190508181036000830152612709816126cd565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612746602083612693565b915061275182612710565b602082019050919050565b6000602082019050818103600083015261277581612739565b9050919050565b7f496e76616c6964206172726179206c656e677468000000000000000000000000600082015250565b60006127b2601483612693565b91506127bd8261277c565b602082019050919050565b600060208201905081810360008301526127e1816127a5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061285182611f0d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561288457612883612817565b5b600182019050919050565b7f6164647265737320697320307830000000000000000000000000000000000000600082015250565b60006128c5600e83612693565b91506128d08261288f565b602082019050919050565b600060208201905081810360008301526128f4816128b8565b9050919050565b7f506c656173652070617373206174206c65617374206f6e65206d616e61676572600082015250565b6000612931602083612693565b915061293c826128fb565b602082019050919050565b6000602082019050818103600083015261296081612924565b9050919050565b7f6e617469766520746f6b656e2066756e64732063616e2774206265207265636f60008201527f7665726564000000000000000000000000000000000000000000000000000000602082015250565b60006129c3602583612693565b91506129ce82612967565b604082019050919050565b600060208201905081810360008301526129f2816129b6565b9050919050565b600081519050612a0881611f17565b92915050565b600060208284031215612a2457612a23611ea5565b5b6000612a32848285016129f9565b91505092915050565b6000612a468261260f565b9050919050565b612a5681612a3b565b82525050565b6000604082019050612a716000830185612a4d565b612a7e60208301846121bd565b9392505050565b612a8e8161265d565b8114612a9957600080fd5b50565b600081519050612aab81612a85565b92915050565b600060208284031215612ac757612ac6611ea5565b5b6000612ad584828501612a9c565b91505092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000612b3a602683612693565b9150612b4582612ade565b604082019050919050565b60006020820190508181036000830152612b6981612b2d565b9050919050565b7f5061796f7574206c696d69747320657863656564656400000000000000000000600082015250565b6000612ba6601683612693565b9150612bb182612b70565b602082019050919050565b60006020820190508181036000830152612bd581612b99565b9050919050565b6000612be782611f0d565b9150612bf283611f0d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c2757612c26612817565b5b828201905092915050565b6000612c3d82611f0d565b9150612c4883611f0d565b925082821015612c5b57612c5a612817565b5b828203905092915050565b6000604082019050612c7b60008301856123cf565b612c8860208301846121bd565b939250505056fea2646970667358221220b80c95eb1eac5891387be63d0d4c5add0e22c13671700f39dd60c2d0e82cc68964736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,676
0x67069df3168fca0a67d5e9b965d8c31afe783acf
/** *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; } } 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 ImmortalDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " Immortal Doge "; string private constant _symbol = " DogeImmortal"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600f81526020017f20496d6d6f7274616c20446f6765200000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f20446f6765496d6d6f7274616c00000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c5f9a99ba736b1c796496b59cd233dc95cd6c693fb6eae42180dff71e58c6fa764736f6c63430008060033
{"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"}]}}
6,677
0x5884c40dded55b5649a1aaa677a750ead35e3043
/** @title Onasander Token Contract * * @author: Andrzej Wegrzyn * Contact: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e6828390838a89968b838892a6898887958788828394c885898b">[email&#160;protected]</a> * Date: May 5, 2018 * Location: New York, USA * Token: Onasander * Symbol: ONA * * @notice This is a simple contract due to solidity bugs and complications. * * @notice Owner has the option to burn all the remaining tokens after the ICO. That way Owners will not end up with majority of the tokens. * @notice Onasander would love to give every user the option to burn the remaining tokens, but due to Solidity VM bugs and risk, we will process * @notice all coin burns and refunds manually. * * @notice How to run the contract: * * Requires: * Wallet Address * * Run: * 1. Create Contract * 2. Set Minimum Goal * 3. Set Tokens Per ETH * 4. Create PRE ICO Sale (can have multiple PRE-ICOs) * 5. End PRE ICO Sale * 6. Create ICO Sale * 7. End ICO Sale * 8. END ICO * 9. Burn Remaining Tokens * * e18 for every value except tokens per ETH * * @dev This contract allows you to configure as many Pre-ICOs as you need. It&#39;s a very simple contract written to give contract admin lots of dynamic options. * @dev Here, most features except for total supply, max tokens for sale, company reserves, and token standard features, are dynamic. You can configure your contract * @dev however you want to. * * @dev IDE: Remix with Mist 0.10 * @dev Token supply numbers are provided in 0e18 format in MIST in order to bypass MIST number format errors. */ pragma solidity ^0.4.23; contract OnasanderToken { using SafeMath for uint; address private wallet; // Address where funds are collected address public owner; // contract owner string constant public name = "Onasander"; string constant public symbol = "ONA"; uint8 constant public decimals = 18; uint public totalSupply = 88000000e18; uint public totalTokensSold = 0e18; // total number of tokens sold to date uint public totalTokensSoldInThisSale = 0e18; // total number of tokens sold in this sale uint public maxTokensForSale = 79200000e18; // 90% max tokens we can ever sale uint public companyReserves = 8800000e18; // 10% company reserves. this is what we end up with after eco ends and burns the rest if any uint public minimumGoal = 0e18; // hold minimum goal uint public tokensForSale = 0e18; // total number of tokens we are selling in the current sale (ICO, preICO) bool public saleEnabled = false; // enables all sales: ICO and tokensPreICO bool public ICOEnded = false; // flag checking if the ICO has completed bool public burned = false; // Excess tokens burned flag after ICO ends uint public tokensPerETH = 800; // amount of Onasander tokens you get for 1 ETH bool public wasGoalReached = false; // checks if minimum goal was reached address private lastBuyer; uint private singleToken = 1e18; constructor(address icoWallet) public { require(icoWallet != address(0), "ICO Wallet address is required."); owner = msg.sender; wallet = icoWallet; balances[owner] = totalSupply; // give initial full balance to contract owner emit TokensMinted(owner, totalSupply); } event ICOHasEnded(); event SaleEnded(); event OneTokenBugFixed(); event ICOConfigured(uint minimumGoal); event TokenPerETHReset(uint amount); event ICOCapReached(uint amount); event SaleCapReached(uint amount); event GoalReached(uint amount); event Burned(uint amount); event BuyTokens(address buyer, uint tokens); event SaleStarted(uint tokensForSale); event TokensMinted(address targetAddress, uint tokens); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner, uint tokens); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); mapping(address => uint) balances; mapping(address => mapping (address => uint)) allowances; function balanceOf(address accountAddress) public constant returns (uint balance) { return balances[accountAddress]; } function allowance(address sender, address spender) public constant returns (uint remainingAllowedAmount) { return allowances[sender][spender]; } function transfer(address to, uint tokens) public returns (bool success) { require (ICOEnded, "ICO has not ended. Can not transfer."); require (balances[to] + tokens > balances[to], "Overflow is not allowed."); // actual transfer // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } function transferFrom(address from, address to, uint tokens) public returns(bool success) { require (ICOEnded, "ICO has not ended. Can not transfer."); require (balances[to] + tokens > balances[to], "Overflow is not allowed."); // actual transfer balances[from] = balances[from].sub(tokens); allowances[from][msg.sender] = allowances[from][msg.sender].sub(tokens); // lower the allowance by the amount of tokens balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } function approve(address spender, uint tokens) public returns(bool success) { require (ICOEnded, "ICO has not ended. Can not transfer."); allowances[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } // in case some investor pays by wire or credit card we will transfer him the tokens manually. function wirePurchase(address to, uint numberOfTokenPurchased) onlyOwner public { require (saleEnabled, "Sale must be enabled."); require (!ICOEnded, "ICO already ended."); require (numberOfTokenPurchased > 0, "Tokens must be greater than 0."); require (tokensForSale > totalTokensSoldInThisSale, "There is no more tokens for sale in this sale."); // calculate amount uint buyAmount = numberOfTokenPurchased; uint tokens = 0e18; // this check is not perfect as someone may want to buy more than we offer for sale and we lose a sale. // the best would be to calclate and sell you only the amout of tokens that is left and refund the rest of money if (totalTokensSoldInThisSale.add(buyAmount) >= tokensForSale) { tokens = tokensForSale.sub(totalTokensSoldInThisSale); // we allow you to buy only up to total tokens for sale, and refund the rest // need to program the refund for the rest,or do it manually. } else { tokens = buyAmount; } // transfer only as we do not need to take the payment since we already did in wire require (balances[to].add(tokens) > balances[to], "Overflow is not allowed."); balances[to] = balances[to].add(tokens); balances[owner] = balances[owner].sub(tokens); lastBuyer = to; // update counts totalTokensSold = totalTokensSold.add(tokens); totalTokensSoldInThisSale = totalTokensSoldInThisSale.add(tokens); emit BuyTokens(to, tokens); emit Transfer(owner, to, tokens); isGoalReached(); isMaxCapReached(); } function buyTokens() payable public { require (saleEnabled, "Sale must be enabled."); require (!ICOEnded, "ICO already ended."); require (tokensForSale > totalTokensSoldInThisSale, "There is no more tokens for sale in this sale."); require (msg.value > 0, "Must send ETH"); // calculate amount uint buyAmount = SafeMath.mul(msg.value, tokensPerETH); uint tokens = 0e18; // this check is not perfect as someone may want to buy more than we offer for sale and we lose a sale. // the best would be to calclate and sell you only the amout of tokens that is left and refund the rest of money if (totalTokensSoldInThisSale.add(buyAmount) >= tokensForSale) { tokens = tokensForSale.sub(totalTokensSoldInThisSale); // we allow you to buy only up to total tokens for sale, and refund the rest // need to program the refund for the rest } else { tokens = buyAmount; } // buy require (balances[msg.sender].add(tokens) > balances[msg.sender], "Overflow is not allowed."); balances[msg.sender] = balances[msg.sender].add(tokens); balances[owner] = balances[owner].sub(tokens); lastBuyer = msg.sender; // take the money out right away wallet.transfer(msg.value); // update counts totalTokensSold = totalTokensSold.add(tokens); totalTokensSoldInThisSale = totalTokensSoldInThisSale.add(tokens); emit BuyTokens(msg.sender, tokens); emit Transfer(owner, msg.sender, tokens); isGoalReached(); isMaxCapReached(); } // Fallback function. Used for buying tokens from contract owner by simply // sending Ethers to contract. function() public payable { // we buy tokens using whatever ETH was sent in buyTokens(); } // Called when ICO is closed. Burns the remaining tokens except the tokens reserved // Must be called by the owner to trigger correct transfer event function burnRemainingTokens() public onlyOwner { require (!burned, "Remaining tokens have been burned already."); require (ICOEnded, "ICO has not ended yet."); uint difference = balances[owner].sub(companyReserves); if (wasGoalReached) { totalSupply = totalSupply.sub(difference); balances[owner] = companyReserves; } else { // in case we did not reach the goal, we burn all tokens except tokens purchased. totalSupply = totalTokensSold; balances[owner] = 0e18; } burned = true; emit Transfer(owner, address(0), difference); // this is run in order to update token holders in the website emit Burned(difference); } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { address preOwner = owner; owner = newOwner; uint previousBalance = balances[preOwner]; // transfer balance balances[newOwner] = balances[newOwner].add(previousBalance); balances[preOwner] = 0; //emit Transfer(preOwner, newOwner, previousBalance); // required to update the Token Holders on the network emit OwnershipTransferred(preOwner, newOwner, previousBalance); } // Set the number of ONAs sold per ETH function setTokensPerETH(uint newRate) onlyOwner public { require (!ICOEnded, "ICO already ended."); require (newRate > 0, "Rate must be higher than 0."); tokensPerETH = newRate; emit TokenPerETHReset(newRate); } // Minimum goal is based on USD, not on ETH. Since we will have different dynamic prices based on the daily pirce of ETH, we // will need to be able to adjust our minimum goal in tokens sold, as our goal is set in tokens, not USD. function setMinimumGoal(uint goal) onlyOwner public { require(goal > 0e18,"Minimum goal must be greater than 0."); minimumGoal = goal; // since we can edit the goal, we want to check if we reached the goal before in case we lowered the goal number. isGoalReached(); emit ICOConfigured(goal); } function createSale(uint numberOfTokens) onlyOwner public { require (!saleEnabled, "Sale is already going on."); require (!ICOEnded, "ICO already ended."); require (totalTokensSold < maxTokensForSale, "We already sold all our tokens."); totalTokensSoldInThisSale = 0e18; uint tryingToSell = totalTokensSold.add(numberOfTokens); // in case we are trying to create a sale with too many tokens, we subtract and sell only what&#39;s left if (tryingToSell > maxTokensForSale) { tokensForSale = maxTokensForSale.sub(totalTokensSold); } else { tokensForSale = numberOfTokens; } tryingToSell = 0e18; saleEnabled = true; emit SaleStarted(tokensForSale); } function endSale() public { if (saleEnabled) { saleEnabled = false; tokensForSale = 0e18; emit SaleEnded(); } } function endICO() onlyOwner public { if (!ICOEnded) { // run this before end of ICO and end of last sale fixTokenCalcBug(); endSale(); ICOEnded = true; lastBuyer = address(0); emit ICOHasEnded(); } } function isGoalReached() internal { // check if we reached the goal if (!wasGoalReached) { if (totalTokensSold >= minimumGoal) { wasGoalReached = true; emit GoalReached(minimumGoal); } } } function isMaxCapReached() internal { if (totalTokensSoldInThisSale >= tokensForSale) { emit SaleCapReached(totalTokensSoldInThisSale); endSale(); } if (totalTokensSold >= maxTokensForSale) { emit ICOCapReached(maxTokensForSale); endICO(); } } // This is a hack to add the lost token during final full sale. function fixTokenCalcBug() internal { require(!burned, "Fix lost token can only run before the burning of the tokens."); if (maxTokensForSale.sub(totalTokensSold) == singleToken) { totalTokensSold = totalTokensSold.add(singleToken); totalTokensSoldInThisSale = totalTokensSoldInThisSale.add(singleToken); balances[lastBuyer] = balances[lastBuyer].add(singleToken); balances[owner] = balances[owner].sub(singleToken); emit Transfer(owner, lastBuyer, singleToken); emit OneTokenBugFixed(); } } } 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) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold 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; } }
0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461018a578063095ea7b31461021a578063116fb2a81461027f57806312aef8c3146102ac57806318160ddd146102d757806323b872dd1461030257806324562747146103875780632cc88401146103b2578063313ce567146103ff578063380d831b146104305780634f2484091461044757806362d9c2671461045e57806363b201171461048d5780636c4d0c00146104b857806370a08231146104e757806371b9b6461461053e57806373f425611461056d578063755f12db1461059c57806383408d73146105c75780638da5cb5b146105de57806395d89b411461063557806397f2f5c3146106c55780639da1b02a146106f05780639f0e7d441461071d578063a9059cbb14610748578063b2561417146107ad578063bc697319146107da578063d0febe4c14610805578063dd62ed3e1461080f578063f2fde38b14610886575b6101886108c9565b005b34801561019657600080fd5b5061019f610f9b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101df5780820151818401526020810190506101c4565b50505050905090810190601f16801561020c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022657600080fd5b50610265600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fd4565b604051808215151515815260200191505060405180910390f35b34801561028b57600080fd5b506102aa60048036038101908080359060200190929190505050611170565b005b3480156102b857600080fd5b506102c161130a565b6040518082815260200191505060405180910390f35b3480156102e357600080fd5b506102ec611310565b6040518082815260200191505060405180910390f35b34801561030e57600080fd5b5061036d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611316565b604051808215151515815260200191505060405180910390f35b34801561039357600080fd5b5061039c611762565b6040518082815260200191505060405180910390f35b3480156103be57600080fd5b506103fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611768565b005b34801561040b57600080fd5b50610414611e25565b604051808260ff1660ff16815260200191505060405180910390f35b34801561043c57600080fd5b50610445611e2a565b005b34801561045357600080fd5b5061045c611e91565b005b34801561046a57600080fd5b50610473611f9f565b604051808215151515815260200191505060405180910390f35b34801561049957600080fd5b506104a2611fb2565b6040518082815260200191505060405180910390f35b3480156104c457600080fd5b506104cd611fb8565b604051808215151515815260200191505060405180910390f35b3480156104f357600080fd5b50610528600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fcb565b6040518082815260200191505060405180910390f35b34801561054a57600080fd5b50610553612014565b604051808215151515815260200191505060405180910390f35b34801561057957600080fd5b50610582612027565b604051808215151515815260200191505060405180910390f35b3480156105a857600080fd5b506105b161203a565b6040518082815260200191505060405180910390f35b3480156105d357600080fd5b506105dc612040565b005b3480156105ea57600080fd5b506105f3612430565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064157600080fd5b5061064a612456565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068a57808201518184015260208101905061066f565b50505050905090810190601f1680156106b75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106d157600080fd5b506106da61248f565b6040518082815260200191505060405180910390f35b3480156106fc57600080fd5b5061071b60048036038101908080359060200190929190505050612495565b005b34801561072957600080fd5b50610732612727565b6040518082815260200191505060405180910390f35b34801561075457600080fd5b50610793600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061272d565b604051808215151515815260200191505060405180910390f35b3480156107b957600080fd5b506107d860048036038101908080359060200190929190505050612a69565b005b3480156107e657600080fd5b506107ef612bac565b6040518082815260200191505060405180910390f35b61080d6108c9565b005b34801561081b57600080fd5b50610870600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bb2565b6040518082815260200191505060405180910390f35b34801561089257600080fd5b506108c7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c39565b005b600080600960009054906101000a900460ff161515610950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53616c65206d75737420626520656e61626c65642e000000000000000000000081525060200191505060405180910390fd5b600960019054906101000a900460ff161515156109d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f49434f20616c726561647920656e6465642e000000000000000000000000000081525060200191505060405180910390fd5b600454600854111515610a76576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f5468657265206973206e6f206d6f726520746f6b656e7320666f722073616c6581526020017f20696e20746869732073616c652e00000000000000000000000000000000000081525060400191505060405180910390fd5b600034111515610aee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742073656e64204554480000000000000000000000000000000000000081525060200191505060405180910390fd5b610afa34600a54612e84565b915060009050600854610b1883600454612ebc90919063ffffffff16565b101515610b3d57610b36600454600854612ed890919063ffffffff16565b9050610b41565b8190505b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bd382600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b111515610c48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f766572666c6f77206973206e6f7420616c6c6f7765642e000000000000000081525060200191505060405180910390fd5b610c9a81600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d5181600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ed890919063ffffffff16565b600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555033600b60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610e5e573d6000803e3d6000fd5b50610e7481600354612ebc90919063ffffffff16565b600381905550610e8f81600454612ebc90919063ffffffff16565b6004819055507f4aff2c4e63da20aaa26764b3e97f557bf5e95b76ddba8f97a156abbecb0818463382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a13373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3610f8f612ef1565b610f97612f6c565b5050565b6040805190810160405280600981526020017f4f6e6173616e646572000000000000000000000000000000000000000000000081525081565b6000600960019054906101000a900460ff161515611080576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f49434f20686173206e6f7420656e6465642e202043616e206e6f74207472616e81526020017f736665722e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111cc57600080fd5b600960019054906101000a900460ff16151515611251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f49434f20616c726561647920656e6465642e000000000000000000000000000081525060200191505060405180910390fd5b6000811115156112c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f52617465206d75737420626520686967686572207468616e20302e000000000081525060200191505060405180910390fd5b80600a819055507f52305729103b1933f51f949a09d2b9a1c408363a6e7b0b315a0e00464bc029d5816040518082815260200191505060405180910390a150565b60085481565b60025481565b6000600960019054906101000a900460ff1615156113c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f49434f20686173206e6f7420656e6465642e202043616e206e6f74207472616e81526020017f736665722e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f766572666c6f77206973206e6f7420616c6c6f7765642e000000000000000081525060200191505060405180910390fd5b61150b82600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ed890919063ffffffff16565b600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115dd82600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ed890919063ffffffff16565b600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116af82600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600a5481565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c757600080fd5b600960009054906101000a900460ff16151561184b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f53616c65206d75737420626520656e61626c65642e000000000000000000000081525060200191505060405180910390fd5b600960019054906101000a900460ff161515156118d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f49434f20616c726561647920656e6465642e000000000000000000000000000081525060200191505060405180910390fd5b600083111515611948576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f546f6b656e73206d7573742062652067726561746572207468616e20302e000081525060200191505060405180910390fd5b6004546008541115156119e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f5468657265206973206e6f206d6f726520746f6b656e7320666f722073616c6581526020017f20696e20746869732073616c652e00000000000000000000000000000000000081525060400191505060405180910390fd5b82915060009050600854611a0883600454612ebc90919063ffffffff16565b101515611a2d57611a26600454600854612ed890919063ffffffff16565b9050611a31565b8190505b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac382600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b111515611b38576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f766572666c6f77206973206e6f7420616c6c6f7765642e000000000000000081525060200191505060405180910390fd5b611b8a81600d60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c4181600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ed890919063ffffffff16565b600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600b60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611cfc81600354612ebc90919063ffffffff16565b600381905550611d1781600454612ebc90919063ffffffff16565b6004819055507f4aff2c4e63da20aaa26764b3e97f557bf5e95b76ddba8f97a156abbecb0818468482604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a18373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3611e17612ef1565b611e1f612f6c565b50505050565b601281565b600960009054906101000a900460ff1615611e8f576000600960006101000a81548160ff02191690831515021790555060006008819055507f0bd8a3eb532e5fbcd3f5b00335f0fb42fdc11969e9af0fab7c9e71a36ae0d31a60405160405180910390a15b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611eed57600080fd5b600960019054906101000a900460ff161515611f9d57611f0b61300c565b611f13611e2a565b6001600960016101000a81548160ff0219169083151502179055506000600b60016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f89a5180095e498e64367fb3fe8a42dbd6fbcdc7b5c429a7844318fbc3be3a13760405160405180910390a15b565b600960019054906101000a900460ff1681565b60035481565b600b60009054906101000a900460ff1681565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600960009054906101000a900460ff1681565b600960029054906101000a900460ff1681565b60045481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561209e57600080fd5b600960029054906101000a900460ff16151515612149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f52656d61696e696e6720746f6b656e732068617665206265656e206275726e6581526020017f6420616c72656164792e0000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600960019054906101000a900460ff1615156121cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f49434f20686173206e6f7420656e646564207965742e0000000000000000000081525060200191505060405180910390fd5b612243600654600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ed890919063ffffffff16565b9050600b60009054906101000a900460ff16156122e25761226f81600254612ed890919063ffffffff16565b600281905550600654600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612353565b6003546002819055506000600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600960026101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a37fd83c63197e8e676d80ab0122beba9a9d20f3828839e9a1d6fe81d242e9cd7e6e816040518082815260200191505060405180910390a150565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f4f4e41000000000000000000000000000000000000000000000000000000000081525081565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156124f357600080fd5b600960009054906101000a900460ff16151515612578576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f53616c6520697320616c726561647920676f696e67206f6e2e0000000000000081525060200191505060405180910390fd5b600960019054906101000a900460ff161515156125fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f49434f20616c726561647920656e6465642e000000000000000000000000000081525060200191505060405180910390fd5b600554600354101515612678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f576520616c726561647920736f6c6420616c6c206f757220746f6b656e732e0081525060200191505060405180910390fd5b600060048190555061269582600354612ebc90919063ffffffff16565b90506005548111156126c3576126b8600354600554612ed890919063ffffffff16565b6008819055506126cb565b816008819055505b600090506001600960006101000a81548160ff0219169083151502179055507fa78c547613f6306e7a70d1bd161c18a496cae1eeb8d4f9e58b60d69ad72ddf586008546040518082815260200191505060405180910390a15050565b60065481565b6000600960019054906101000a900460ff1615156127d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f49434f20686173206e6f7420656e6465642e202043616e206e6f74207472616e81526020017f736665722e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156128d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4f766572666c6f77206973206e6f7420616c6c6f7765642e000000000000000081525060200191505060405180910390fd5b61292282600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ed890919063ffffffff16565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129b782600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ac557600080fd5b600081111515612b63576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f4d696e696d756d20676f616c206d75737420626520677265617465722074686181526020017f6e20302e0000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600781905550612b72612ef1565b7f0a64ca691d1f0b1a24c79a664d494042b0e7e40ca1495ad40ba5f3f71f23ddfd816040518082815260200191505060405180910390a150565b60075481565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612c9857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050612d9281600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fc13a1166d81cd3b0b352a367aebab95f3a6f6bc695fdab8e9a9d335239c3861b836040518082815260200191505060405180910390a3505050565b600080831415612e975760009050612eb6565b8183029050818382811515612ea857fe5b04141515612eb257fe5b8090505b92915050565b60008183019050828110151515612ecf57fe5b80905092915050565b6000828211151515612ee657fe5b818303905092915050565b600b60009054906101000a900460ff161515612f6a57600754600354101515612f69576001600b60006101000a81548160ff0219169083151502179055507ffbfd8ab7c24300fa9888cd721c8565a7da56759384781283684dcf7c7c4a846b6007546040518082815260200191505060405180910390a15b5b565b600854600454101515612fbb577fb73e71437a3dd947096186742d93725c20946637d210c36562cef949e19dafae6004546040518082815260200191505060405180910390a1612fba611e2a565b5b60055460035410151561300a577ffc7d1c6bb49966a7b98ad244a063c952205109f2f0d1f8b50b5ce50d8019d9146005546040518082815260200191505060405180910390a1613009611e91565b5b565b600960029054906101000a900460ff161515156130b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d8152602001807f466978206c6f737420746f6b656e2063616e206f6e6c792072756e206265666f81526020017f726520746865206275726e696e67206f662074686520746f6b656e732e00000081525060400191505060405180910390fd5b600c546130d1600354600554612ed890919063ffffffff16565b141561339f576130ee600c54600354612ebc90919063ffffffff16565b60038190555061310b600c54600454612ebc90919063ffffffff16565b600481905550613187600c54600d6000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ebc90919063ffffffff16565b600d6000600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613262600c54600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ed890919063ffffffff16565b600d6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b60019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600c546040518082815260200191505060405180910390a37fedf2ef24b74d409b6957d607578f64cbb8b4fa11afaad64eedf2de58043772fe60405160405180910390a15b5600a165627a7a72305820a473a0b54ed24bd66c59e500def6aa48b310b7d56b41369d38ebcb19672050630029
{"success": true, "error": null, "results": {}}
6,678
0x0d8563d3b8b3fec542aae50a530c606dac4d1c4f
/** *Submitted for verification at Etherscan.io on 2021-11-03 */ // Sources flattened with hardhat v2.5.0 https://hardhat.org // File contracts/external/avm/interfaces/iArbitrum_Inbox.sol // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; // Retryable tickets are the Arbitrum protocol’s canonical method for passing generalized messages from Ethereum to // Arbitrum. A retryable ticket is an L2 message encoded and delivered by L1; if gas is provided, it will be executed // immediately. If no gas is provided or the execution reverts, it will be placed in the L2 retry buffer, // where any user can re-execute for some fixed period (roughly one week). // Retryable tickets are created by calling Inbox.createRetryableTicket. // More details here: https://developer.offchainlabs.com/docs/l1_l2_messages#ethereum-to-arbitrum-retryable-tickets interface iArbitrum_Inbox { function createRetryableTicketNoRefundAliasRewrite( address destAddr, uint256 l2CallValue, uint256 maxSubmissionCost, address excessFeeRefundAddress, address callValueRefundAddress, uint256 maxGas, uint256 gasPriceBid, bytes calldata data ) external payable returns (uint256); } // File contracts/insured-bridge/avm/Arbitrum_CrossDomainEnabled.sol // Copied logic from https://github.com/makerdao/arbitrum-dai-bridge/blob/34acc39bc6f3a2da0a837ea3c5dbc634ec61c7de/contracts/l1/L1CrossDomainEnabled.sol // with a change to the solidity version. abstract contract Arbitrum_CrossDomainEnabled { iArbitrum_Inbox public immutable inbox; /** * @param _inbox Contract that sends generalized messages to the Arbitrum chain. */ constructor(address _inbox) { inbox = iArbitrum_Inbox(_inbox); } // More details about retryable ticket parameters here: https://developer.offchainlabs.com/docs/l1_l2_messages#parameters // This function will not apply aliassing to the `user` address on L2. // Note: If `l1CallValue > 0`, then this contract must contain at least that much ETH to send as msg.value to the // inbox. function sendTxToL2NoAliassing( address target, // Address where transaction will initiate on L2. address user, // Address where excess gas is credited on L2. uint256 l1CallValue, // msg.value deposited to `user` on L2. uint256 maxSubmissionCost, // Amount of ETH allocated to pay for base submission fee. The user is charged this // fee to cover the storage costs of keeping their retryable ticket's calldata in the retry buffer. This should // also cover the `l2CallValue`, but we set that to 0. This amount is proportional to the size of `data`. uint256 maxGas, // Gas limit for immediate L2 execution attempt. uint256 gasPriceBid, // L2 gas price bid for immediate L2 execution attempt. bytes memory data // ABI encoded data to send to target. ) internal returns (uint256) { // createRetryableTicket API: https://developer.offchainlabs.com/docs/sol_contract_docs/md_docs/arb-bridge-eth/bridge/inbox#createretryableticketaddress-destaddr-uint256-l2callvalue-uint256-maxsubmissioncost-address-excessfeerefundaddress-address-callvaluerefundaddress-uint256-maxgas-uint256-gaspricebid-bytes-data-%E2%86%92-uint256-external // - address destAddr: destination L2 contract address // - uint256 l2CallValue: call value for retryable L2 message // - uint256 maxSubmissionCost: Max gas deducted from user's L2 balance to cover base submission fee // - address excessFeeRefundAddress: maxgas x gasprice - execution cost gets credited here on L2 // - address callValueRefundAddress: l2CallValue gets credited here on L2 if retryable txn times out or gets cancelled // - uint256 maxGas: Max gas deducted from user's L2 balance to cover L2 execution // - uint256 gasPriceBid: price bid for L2 execution // - bytes data: ABI encoded data of L2 message uint256 seqNum = inbox.createRetryableTicketNoRefundAliasRewrite{ value: l1CallValue }( target, 0, // we always assume that l2CallValue = 0 maxSubmissionCost, user, user, maxGas, gasPriceBid, data ); return seqNum; } } // File contracts/insured-bridge/interfaces/MessengerInterface.sol /** * @notice Sends cross chain messages to contracts on a specific L2 network. The `relayMessage` implementation will * differ for each L2. */ interface MessengerInterface { function relayMessage( address target, address userToRefund, uint256 l1CallValue, uint256 gasLimit, uint256 gasPrice, uint256 maxSubmissionCost, bytes memory message ) external payable; } // File @openzeppelin/contracts/utils/[email protected] /* * @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; } } // File @openzeppelin/contracts/access/[email protected] /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // File contracts/insured-bridge/avm/Arbitrum_Messenger.sol /** * @notice Sends cross chain messages Arbitrum L2 network. * @dev This contract's owner should be set to the BridgeAdmin deployed on the same L1 network so that only the * BridgeAdmin can call cross-chain administrative functions on the L2 DepositBox via this messenger. * @dev This address will be the sender of any L1 --> L2 retryable tickets, so it should be set as the cross domain * owner for L2 contracts that expect to receive cross domain messages. */ contract Arbitrum_Messenger is Ownable, Arbitrum_CrossDomainEnabled, MessengerInterface { event RelayedMessage( address indexed from, address indexed to, uint256 indexed seqNum, address userToRefund, uint256 l1CallValue, uint256 gasLimit, uint256 gasPrice, uint256 maxSubmissionCost, bytes data ); /** * @param _inbox Contract that sends generalized messages to the Arbitrum chain. */ constructor(address _inbox) Arbitrum_CrossDomainEnabled(_inbox) {} /** * @notice Sends a message to an account on L2. If this message reverts on l2 for any reason it can either be * resent on L1, or redeemed on L2 manually. To learn more see how "retryable tickets" work on Arbitrum * https://developer.offchainlabs.com/docs/l1_l2_messages#parameters * @param target The intended recipient on L2. * @param userToRefund User on L2 to refund extra fees to. * @param l1CallValue Amount of ETH deposited to `target` contract on L2. Used to pay for L2 submission fee and * l2CallValue. This will usually be > 0. * @param gasLimit The gasLimit for the receipt of the message on L2. * @param gasPrice Gas price bid for L2 execution. * @param maxSubmissionCost: Max gas deducted from user's L2 balance to cover base submission fee. * This amount is proportional to the size of `data`. * @param message The data to send to the target (usually calldata to a function with * `onlyFromCrossDomainAccount()`) */ function relayMessage( address target, address userToRefund, uint256 l1CallValue, uint256 gasLimit, uint256 gasPrice, uint256 maxSubmissionCost, bytes memory message ) external payable override onlyOwner { // Since we know the L2 target's address in advance, we don't need to alias an L1 address. uint256 seqNumber = sendTxToL2NoAliassing(target, userToRefund, l1CallValue, maxSubmissionCost, gasLimit, gasPrice, message); emit RelayedMessage( msg.sender, target, seqNumber, userToRefund, l1CallValue, gasLimit, gasPrice, maxSubmissionCost, message ); } }
0x60806040526004361061004a5760003560e01c8063715018a61461004f5780638da5cb5b146100665780639e353c701461009c578063f2fde38b146100af578063fb0e722b146100cf575b600080fd5b34801561005b57600080fd5b50610064610103565b005b34801561007257600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b6100646100aa366004610403565b610180565b3480156100bb57600080fd5b506100646100ca3660046103e1565b61021d565b3480156100db57600080fd5b506100807f0000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f81565b6000546001600160a01b031633146101365760405162461bcd60e51b815260040161012d90610602565b60405180910390fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146101aa5760405162461bcd60e51b815260040161012d90610602565b60006101bb88888886898988610307565b905080886001600160a01b0316336001600160a01b03167fe0546421195e3e65035cacdb8d655c6d557e249c01c601f2af8b56f7526bc03f8a8a8a8a8a8a60405161020b969594939291906105bd565b60405180910390a45050505050505050565b6000546001600160a01b031633146102475760405162461bcd60e51b815260040161012d90610602565b6001600160a01b0381166102ac5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161012d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000807f0000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f6001600160a01b0316631b871c8d888b60008a8d8e8c8c8c6040518a63ffffffff1660e01b8152600401610366989796959493929190610562565b6020604051808303818588803b15801561037f57600080fd5b505af1158015610393573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906103b891906104fc565b9998505050505050505050565b80356001600160a01b03811681146103dc57600080fd5b919050565b6000602082840312156103f357600080fd5b6103fc826103c5565b9392505050565b600080600080600080600060e0888a03121561041e57600080fd5b610427886103c5565b9650610435602089016103c5565b955060408801359450606088013593506080880135925060a0880135915060c088013567ffffffffffffffff8082111561046e57600080fd5b818a0191508a601f83011261048257600080fd5b81358181111561049457610494610637565b604051601f8201601f19908116603f011681019083821181831017156104bc576104bc610637565b816040528281528d60208487010111156104d557600080fd5b82602086016020830137600060208483010152809550505050505092959891949750929550565b60006020828403121561050e57600080fd5b5051919050565b6000815180845260005b8181101561053b5760208185018101518683018201520161051f565b8181111561054d576000602083870101525b50601f01601f19169290920160200192915050565b600061010060018060a01b03808c1684528a602085015289604085015280891660608501528088166080850152508560a08401528460c08401528060e08401526105ae81840185610515565b9b9a5050505050505050505050565b60018060a01b038716815285602082015284604082015283606082015282608082015260c060a082015260006105f660c0830184610515565b98975050505050505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fdfea264697066735822122014ae70ed258357998f8e3b88b823951690435719388ed6d4e1aeb5cc0ad61c0a64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
6,679
0x5fce239cf60062b0e4b3104d35590e8c0fc00150
/** *Submitted for verification at Etherscan.io on 2021-02-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { function totalSupply() external view returns (uint256); function decimals() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function name() external view returns (string memory); function symbol() external view returns (string memory); } interface IyVault { function token() external view returns (address); function deposit(uint, address) external returns (uint); function withdraw(uint, address, uint) external returns (uint); function permit(address, address, uint, uint, bytes32) external view returns (bool); function pricePerShare() external view returns (uint); } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract yAffiliateTokenV2 { using SafeERC20 for IERC20; /// @notice EIP-20 token name for this token string public name; /// @notice EIP-20 token symbol for this token string public symbol; /// @notice EIP-20 token decimals for this token uint256 public decimals; /// @notice Total number of tokens in circulation uint public totalSupply = 0; mapping(address => mapping (address => uint)) internal allowances; mapping(address => uint) internal balances; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint chainId,address verifyingContract)"); bytes32 public immutable DOMAINSEPARATOR; /// @notice The EIP-712 typehash for the permit struct used by the contract bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint value,uint nonce,uint deadline)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint amount); uint public index = 0; uint public bal = 0; function update() external { _update(); } function _update() internal { if (totalSupply > 0) { uint256 _bal = IyVault(vault).pricePerShare(); if (_bal > bal) { uint256 _diff = _bal - bal; if (_diff > 0) { uint256 _ratio = _diff * 10**decimals / totalSupply; if (_ratio > 0) { index += _ratio; bal = _bal; } } } } else { bal = IyVault(vault).pricePerShare(); } } function _mint(address dst, uint amount) internal { // mint the amount totalSupply += amount; // transfer the amount to the recipient balances[dst] += amount; emit Transfer(address(0), dst, amount); } function _burn(address dst, uint amount) internal { // burn the amount totalSupply -= amount; // transfer the amount from the recipient balances[dst] -= amount; emit Transfer(dst, address(0), amount); } address public affiliate; address public governance; address public pendingGovernance; address public immutable token; address public immutable vault; constructor(address _governance, string memory _moniker, address _affiliate, address _token, address _vault) { DOMAINSEPARATOR = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), _getChainId(), address(this))); affiliate = _affiliate; governance = _governance; token = _token; vault = _vault; name = string(abi.encodePacked(_moniker, "-yearn ", IERC20(_token).name())); symbol = string(abi.encodePacked(_moniker, "-yv", IERC20(_token).symbol())); decimals = IERC20(_token).decimals(); IERC20(_token).approve(_vault, type(uint).max); } function setGovernance(address _gov) external { require(msg.sender == governance); pendingGovernance = _gov; } function acceptGovernance() external { require(msg.sender == pendingGovernance); governance = pendingGovernance; } function currentContribution() external view returns (uint) { return 1e18 * IERC20(vault).balanceOf(address(this)) / IERC20(vault).totalSupply(); } function setAffiliate(address _affiliate) external { require(msg.sender == governance || msg.sender == affiliate); affiliate = _affiliate; } function depositAll() external { _deposit(IERC20(token).balanceOf(msg.sender)); } function deposit(uint amount) external { _deposit(amount); } function _deposit(uint amount) internal { _update(); IERC20(token).safeTransferFrom(msg.sender, address(this), amount); _mint(msg.sender, IyVault(vault).deposit(amount, address(this))); } function withdrawAll(uint maxLoss) external { _withdraw(balances[msg.sender], maxLoss); } function withdraw(uint amount, uint maxLoss) external { _withdraw(amount, maxLoss); } function _withdraw(uint amount, uint maxLoss) internal { _update(); _burn(msg.sender, amount); IyVault(vault).withdraw(amount, msg.sender, maxLoss); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param amount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint amount) external returns (bool) { allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Triggers an approval from owner to spends * @param owner The address to approve from * @param spender The address to be approved * @param amount The number of tokens that are approved (2^256-1 means infinite) * @param deadline The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function permit(address owner, address spender, uint amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external { bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, amount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAINSEPARATOR, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "permit: signature"); require(signatory == owner, "permit: unauthorized"); require(block.timestamp <= deadline, "permit: expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint amount) external returns (bool) { _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param amount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint amount) external returns (bool) { address spender = msg.sender; uint spenderAllowance = allowances[src][spender]; if (spender != src && spenderAllowance != type(uint).max) { uint newAllowance = spenderAllowance - amount; allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function _transferTokens(address src, address dst, uint amount) internal { balances[src] -= amount; balances[dst] += amount; emit Transfer(src, dst, amount); } function _getChainId() internal view returns (uint) { uint chainId; assembly { chainId := chainid() } return chainId; } } contract yAffiliateFactoryV2 { using SafeERC20 for IERC20; address public governance; address public pendingGovernance; address[] public _affiliates; mapping(address => bool) isAffiliate; address[] public _yAffiliateTokens; mapping(address => mapping(address => address[])) affiliateTokens; mapping(address => mapping(address => bool)) isTokenAffiliate; mapping(address => address[]) tokenAffiliates; function yAffiliateTokens() external view returns (address[] memory) { return _yAffiliateTokens; } function affiliates() external view returns (address[] memory) { return _affiliates; } constructor() { governance = msg.sender; } function lookupAffiliates(address token) external view returns (address[] memory) { return tokenAffiliates[token]; } function lookupAffiliateToken(address token, address affiliate) external view returns (address[] memory) { return affiliateTokens[token][affiliate]; } function setGovernance(address _gov) external { require(msg.sender == governance); pendingGovernance = _gov; } function acceptGovernance() external { require(msg.sender == pendingGovernance); governance = pendingGovernance; } function deploy(string memory _moniker, address _affiliate, address _token, address _vault) external { require(msg.sender == governance); if (!isAffiliate[_affiliate]) { _affiliates.push(_affiliate); isAffiliate[_affiliate] = true; } if (!isTokenAffiliate[_token][_affiliate]) { tokenAffiliates[_token].push(_affiliate); isTokenAffiliate[_token][_affiliate] = true; } address _yAffiliateToken = address(new yAffiliateTokenV2(governance, _moniker, _affiliate, _token, _vault)); _yAffiliateTokens.push(_yAffiliateToken); affiliateTokens[_token][_affiliate].push(_yAffiliateToken); } }
0x60806040523480156200001157600080fd5b5060043610620000b85760003560e01c8063ab033ea9116200007b578063ab033ea91462000125578063ac7638de146200013c578063b42fd3361462000153578063dfd60935146200016a578063f39c38a01462000181578063f9040482146200018b57620000b8565b806305c7f86714620000bd578063238efcbc14620000ec5780633f03842a14620000f85780635aa6e6751462000111578063603dc317146200011b575b600080fd5b620000d4620000ce366004620007b1565b620001a2565b604051620000e39190620007d7565b60405180910390f35b620000f6620001cd565b005b6200010262000209565b604051620000e3919062000882565b620000d46200026d565b620001026200027c565b620000f66200013636600462000668565b620002de565b620001026200014d3660046200068c565b62000318565b620001026200016436600462000668565b6200039d565b620000f66200017b366004620006c3565b62000416565b620000d462000622565b620000d46200019c366004620007b1565b62000631565b60048181548110620001b357600080fd5b6000918252602090912001546001600160a01b0316905081565b6001546001600160a01b03163314620001e557600080fd5b600154600080546001600160a01b0319166001600160a01b03909216919091179055565b606060028054806020026020016040519081016040528092919081815260200182805480156200026357602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000244575b5050505050905090565b6000546001600160a01b031681565b6060600480548060200260200160405190810160405280929190818152602001828054801562000263576020028201919060005260206000209081546001600160a01b0316815260019091019060200180831162000244575050505050905090565b6000546001600160a01b03163314620002f657600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0380831660009081526005602090815260408083209385168352928152908290208054835181840281018401909452808452606093928301828280156200039057602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831162000371575b5050505050905092915050565b6001600160a01b0381166000908152600760209081526040918290208054835181840281018401909452808452606093928301828280156200040957602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311620003ea575b505050505090505b919050565b6000546001600160a01b031633146200042e57600080fd5b6001600160a01b03831660009081526003602052604090205460ff16620004b3576002805460018082019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b0386169081179091556000908152600360205260409020805460ff191690911790555b6001600160a01b0380831660009081526006602090815260408083209387168352929052205460ff1662000541576001600160a01b0382811660008181526007602090815260408083208054600180820183559185528385200180546001600160a01b031916968a1696871790559383526006825280832094835293905291909120805460ff191690911790555b60008060009054906101000a90046001600160a01b0316858585856040516200056a9062000642565b6200057a959493929190620007eb565b604051809103906000f08015801562000597573d6000803e3d6000fd5b506004805460018181019092557f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0180546001600160a01b039384166001600160a01b03199182168117909255958316600090815260056020908152604080832099909516825297885292832080549283018155835295909120018054909316909317909155505050565b6001546001600160a01b031681565b60028181548110620001b357600080fd5b61210b80620008e883390190565b80356001600160a01b03811681146200041157600080fd5b6000602082840312156200067a578081fd5b620006858262000650565b9392505050565b600080604083850312156200069f578081fd5b620006aa8362000650565b9150620006ba6020840162000650565b90509250929050565b60008060008060808587031215620006d9578182fd5b843567ffffffffffffffff80821115620006f1578384fd5b818701915087601f83011262000705578384fd5b8135818111156200071a576200071a620008d1565b604051601f8201601f19908116603f01168101908382118183101715620007455762000745620008d1565b816040528281528a60208487010111156200075e578687fd5b8260208601602083013786602084830101528098505050505050620007866020860162000650565b9250620007966040860162000650565b9150620007a66060860162000650565b905092959194509250565b600060208284031215620007c3578081fd5b5035919050565b6001600160a01b03169052565b6001600160a01b0391909116815260200190565b600060018060a01b0387168252602060a08184015286518060a0850152825b81811015620008285788810183015185820160c0015282016200080a565b818111156200083a578360c083870101525b50601f01601f1916830160c00191506200085a90506040830186620007ca565b620008696060830185620007ca565b620008786080830184620007ca565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015620008c55783516001600160a01b0316835292840192918401916001016200089e565b50909695505050505050565b634e487b7160e01b600052604160045260246000fdfe60e06040526000600355600060075560006008553480156200002057600080fd5b506040516200210b3803806200210b8339810160408190526200004391620004c8565b7f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f356000604051620000759190620005d2565b6040519081900390206200008862000372565b306040516020016200009e949392919062000718565b60408051601f198184030181528282528051602090910120608052600980546001600160a01b038088166001600160a01b031992831617909255600a80548a841692169190911790556001600160601b0319606086811b821660a05285901b1660c0526306fdde0360e01b835290518692918516916306fdde03916004808301926000929190829003018186803b1580156200013957600080fd5b505afa1580156200014e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200017891908101906200057b565b6040516020016200018b929190620006b9565b60405160208183030381529060405260009080519060200190620001b192919062000376565b5083826001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015620001ed57600080fd5b505afa15801562000202573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526200022c91908101906200057b565b6040516020016200023f92919062000677565b604051602081830303815290604052600190805190602001906200026592919062000376565b50816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015620002a057600080fd5b505afa158015620002b5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002db9190620005b9565b60025560405163095ea7b360e01b81526001600160a01b0383169063095ea7b3906200031090849060001990600401620006ff565b602060405180830381600087803b1580156200032b57600080fd5b505af115801562000340573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000366919062000552565b505050505050620007ce565b4690565b82805462000384906200077b565b90600052602060002090601f016020900481019282620003a85760008555620003f3565b82601f10620003c357805160ff1916838001178555620003f3565b82800160010185558215620003f3579182015b82811115620003f3578251825591602001919060010190620003d6565b506200040192915062000405565b5090565b5b8082111562000401576000815560010162000406565b80516001600160a01b03811681146200043457600080fd5b919050565b600082601f8301126200044a578081fd5b81516001600160401b0380821115620004675762000467620007b8565b604051601f8301601f19908116603f01168101908282118183101715620004925762000492620007b8565b81604052838152866020858801011115620004ab578485fd5b620004be84602083016020890162000748565b9695505050505050565b600080600080600060a08688031215620004e0578081fd5b620004eb866200041c565b60208701519095506001600160401b0381111562000507578182fd5b620005158882890162000439565b94505062000526604087016200041c565b925062000536606087016200041c565b915062000546608087016200041c565b90509295509295909350565b60006020828403121562000564578081fd5b8151801515811462000574578182fd5b9392505050565b6000602082840312156200058d578081fd5b81516001600160401b03811115620005a3578182fd5b620005b18482850162000439565b949350505050565b600060208284031215620005cb578081fd5b5051919050565b8154600090819060028104600180831680620005ef57607f831692505b60208084108214156200061057634e487b7160e01b87526022600452602487fd5b818015620006275760018114620006395762000669565b60ff1986168952848901965062000669565b620006448a6200073c565b885b86811015620006615781548b82015290850190830162000646565b505084890196505b509498975050505050505050565b600083516200068b81846020880162000748565b6216bcbb60e91b9083019081528351620006ad81600384016020880162000748565b01600301949350505050565b60008351620006cd81846020880162000748565b66016bcb2b0b937160cd1b9083019081528351620006f381600784016020880162000748565b01600701949350505050565b6001600160a01b03929092168252602082015260400190565b938452602084019290925260408301526001600160a01b0316606082015260800190565b60009081526020902090565b60005b83811015620007655781810151838201526020016200074b565b8381111562000775576000848401525b50505050565b6002810460018216806200079057607f821691505b60208210811415620007b257634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160a05160601c60c05160601c6118c8620008436000396000818161048e0152818161053401528181610b8e01528181610ca901528181610d4501528181610e510152610f28015260008181610af301528181610bb20152610efa0152600081816105dc015261092101526118c86000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80635aa6e67511610104578063ab033ea9116100a2578063de5f626811610071578063de5f626814610372578063f39c38a01461037a578063fbfa77cf14610382578063fc0c546a1461038a576101da565b8063ab033ea914610326578063b6b55f2514610339578063d505accf1461034c578063dd62ed3e1461035f576101da565b8063958e2d31116100de578063958e2d31146102f057806395d89b4114610303578063a2e620451461030b578063a9059cbb14610313576101da565b80635aa6e675146102c257806370a08231146102ca5780637ecebe00146102dd576101da565b806323b872dd1161017c578063313ce5671161014b578063313ce5671461028a5780633d79d1c814610292578063441a3e701461029a57806345e05f43146102ad576101da565b806323b872dd146102545780632986c0e5146102675780632bbb56d91461026f57806330adf81f14610282576101da565b80631778e29c116101b85780631778e29c1461023257806318160ddd1461023a57806320606b7014610242578063238efcbc1461024a576101da565b806306fdde03146101df578063095ea7b3146101fd578063111961f81461021d575b600080fd5b6101e7610392565b6040516101f491906114d7565b60405180910390f35b61021061020b366004611368565b610420565b6040516101f49190611471565b61022561048a565b6040516101f4919061147c565b6102256105da565b6102256105fe565b610225610604565b610252610628565b005b6102106102623660046112bc565b610663565b610225610731565b61025261027d366004611270565b610737565b610225610785565b6102256107a9565b6102256107af565b6102526102a83660046113e1565b6107b5565b6102b56107c3565b6040516101f49190611439565b6102b56107d2565b6102256102d8366004611270565b6107e1565b6102256102eb366004611270565b610800565b6102526102fe3660046113b1565b610812565b6101e761082f565b61025261083c565b610210610321366004611368565b610846565b610252610334366004611270565b61085c565b6102526103473660046113b1565b610895565b61025261035a3660046112f7565b61089e565b61022561036d36600461128a565b610aad565b610252610ad8565b6102b5610b7d565b6102b5610b8c565b6102b5610bb0565b6000805461039f90611826565b80601f01602080910402602001604051908101604052809291908181526020018280546103cb90611826565b80156104185780601f106103ed57610100808354040283529160200191610418565b820191906000526020600020905b8154815290600101906020018083116103fb57829003601f168201915b505050505081565b3360008181526004602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061047990869061147c565b60405180910390a350600192915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156104e557600080fd5b505afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061051d91906113c9565b6040516370a0823160e01b81526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610569903090600401611439565b60206040518083038186803b15801561058157600080fd5b505afa158015610595573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105b991906113c9565b6105cb90670de0b6b3a76400006117c4565b6105d59190611690565b905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b60035481565b7f797cfab58fcb15f590eb8e4252d5c228ff88f94f907e119e80c4393a946e8f3581565b600b546001600160a01b0316331461063f57600080fd5b600b54600a80546001600160a01b0319166001600160a01b03909216919091179055565b6001600160a01b03831660008181526004602090815260408083203380855292528220549192909190821480159061069d57506000198114155b156107185760006106ae85836117e3565b6001600160a01b03808916600081815260046020908152604080832094891680845294909152908190208490555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061070e90859061147c565b60405180910390a3505b610723868686610bd4565b6001925050505b9392505050565b60075481565b600a546001600160a01b031633148061075a57506009546001600160a01b031633145b61076357600080fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b7f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e981565b60025481565b60085481565b6107bf8282610c80565b5050565b6009546001600160a01b031681565b600a546001600160a01b031681565b6001600160a01b0381166000908152600560205260409020545b919050565b60066020526000908152604090205481565b3360009081526005602052604090205461082c9082610c80565b50565b6001805461039f90611826565b610844610d39565b565b6000610853338484610bd4565b50600192915050565b600a546001600160a01b0316331461087357600080fd5b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b61082c81610ee5565b6001600160a01b038716600090815260066020526040812080547f5fae9ec55a1e547936e0e74d606b44cd5f912f9adcd0bba561fea62d570259e9918a918a918a9190866108eb83611861565b919050558960405160200161090596959493929190611485565b60405160208183030381529060405280519060200120905060007f00000000000000000000000000000000000000000000000000000000000000008260405160200161095292919061141e565b60405160208183030381529060405280519060200120905060006001828787876040516000815260200160405260405161098f94939291906114b9565b6020604051602081039080840390855afa1580156109b1573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166109ed5760405162461bcd60e51b81526004016109e490611596565b60405180910390fd5b896001600160a01b0316816001600160a01b031614610a1e5760405162461bcd60e51b81526004016109e490611568565b86421115610a3e5760405162461bcd60e51b81526004016109e49061153f565b6001600160a01b03808b166000818152600460209081526040808320948e1680845294909152908190208b9055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610a99908c9061147c565b60405180910390a350505050505050505050565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6040516370a0823160e01b8152610844906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610b28903390600401611439565b60206040518083038186803b158015610b4057600080fd5b505afa158015610b54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7891906113c9565b610ee5565b600b546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6001600160a01b03831660009081526005602052604081208054839290610bfc9084906117e3565b90915550506001600160a01b03821660009081526005602052604081208054839290610c29908490611678565b92505081905550816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610c73919061147c565b60405180910390a3505050565b610c88610d39565b610c923383610fcb565b604051631cc6d2f960e31b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e63697c890610ce290859033908690600401611659565b602060405180830381600087803b158015610cfc57600080fd5b505af1158015610d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3491906113c9565b505050565b60035415610e4f5760007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015610d9c57600080fd5b505afa158015610db0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dd491906113c9565b9050600854811115610e4957600060085482610df091906117e3565b90508015610e47576000600354600254600a610e0c91906116f6565b610e1690846117c4565b610e209190611690565b90508015610e45578060076000828254610e3a9190611678565b909155505060088390555b505b505b50610844565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166399530b066040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea857600080fd5b505afa158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee091906113c9565b600855565b610eed610d39565b610f226001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084611059565b61082c337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636e553f6584306040518363ffffffff1660e01b8152600401610f74929190611642565b602060405180830381600087803b158015610f8e57600080fd5b505af1158015610fa2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fc691906113c9565b6110b7565b8060036000828254610fdd91906117e3565b90915550506001600160a01b0382166000908152600560205260408120805483929061100a9084906117e3565b90915550506040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061104d90859061147c565b60405180910390a35050565b6110b1846323b872dd60e01b85858560405160240161107a9392919061144d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611139565b50505050565b80600360008282546110c99190611678565b90915550506001600160a01b038216600090815260056020526040812080548392906110f6908490611678565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061104d90859061147c565b61114b826001600160a01b031661121d565b6111675760405162461bcd60e51b81526004016109e49061160b565b600080836001600160a01b0316836040516111829190611402565b6000604051808303816000865af19150503d80600081146111bf576040519150601f19603f3d011682016040523d82523d6000602084013e6111c4565b606091505b5091509150816111e65760405162461bcd60e51b81526004016109e49061150a565b8051156110b157808060200190518101906112019190611391565b6110b15760405162461bcd60e51b81526004016109e4906115c1565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906112515750808214155b949350505050565b80356001600160a01b03811681146107fb57600080fd5b600060208284031215611281578081fd5b61072a82611259565b6000806040838503121561129c578081fd5b6112a583611259565b91506112b360208401611259565b90509250929050565b6000806000606084860312156112d0578081fd5b6112d984611259565b92506112e760208501611259565b9150604084013590509250925092565b600080600080600080600060e0888a031215611311578283fd5b61131a88611259565b965061132860208901611259565b95506040880135945060608801359350608088013560ff8116811461134b578384fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561137a578182fd5b61138383611259565b946020939093013593505050565b6000602082840312156113a2578081fd5b8151801515811461072a578182fd5b6000602082840312156113c2578081fd5b5035919050565b6000602082840312156113da578081fd5b5051919050565b600080604083850312156113f3578182fd5b50508035926020909101359150565b600082516114148184602087016117fa565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b60006020825282518060208401526114f68160408501602087016117fa565b601f01601f19169190910160400192915050565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600f908201526e1c195c9b5a5d0e88195e1c1a5c9959608a1b604082015260600190565b6020808252601490820152731c195c9b5a5d0e881d5b985d5d1a1bdc9a5e995960621b604082015260600190565b6020808252601190820152707065726d69743a207369676e617475726560781b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b9182526001600160a01b0316602082015260400190565b9283526001600160a01b03919091166020830152604082015260600190565b6000821982111561168b5761168b61187c565b500190565b6000826116ab57634e487b7160e01b81526012600452602481fd5b500490565b80825b60018086116116c257506116ed565b8187048211156116d4576116d461187c565b808616156116e157918102915b9490941c9380026116b3565b94509492505050565b600061072a600019848460008261170f5750600161072a565b8161171c5750600061072a565b8160018114611732576002811461173c57611769565b600191505061072a565b60ff84111561174d5761174d61187c565b6001841b9150848211156117635761176361187c565b5061072a565b5060208310610133831016604e8410600b841016171561179c575081810a838111156117975761179761187c565b61072a565b6117a984848460016116b0565b8086048211156117bb576117bb61187c565b02949350505050565b60008160001904831182151516156117de576117de61187c565b500290565b6000828210156117f5576117f561187c565b500390565b60005b838110156118155781810151838201526020016117fd565b838111156110b15750506000910152565b60028104600182168061183a57607f821691505b6020821081141561185b57634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156118755761187561187c565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220c08d77ed908f4379ff8172c38a54138312f27c163cfb4e5c3c14d8b7dc8bafde64736f6c63430008010033a264697066735822122064bd5720e0284c745fd5832c26368982a343723845590870961a5672d9e23e0b64736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,680
0x33feab4ecd7e9d491037c050e29b3f29899e7048
pragma solidity >=0.5.0; // a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math) 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'); } } contract ERC20Token { using SafeMath for uint; string public name; string public symbol; uint8 public decimals = 18; uint public totalSupply; mapping(address => uint) public balanceOf; mapping(address => mapping(address => uint)) public allowance; event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); function _transfer(address from, address to, uint value) private { require(balanceOf[from] >= value, 'ERC20Token: INSUFFICIENT_BALANCE'); balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); if (to == address(0)) { // burn totalSupply = totalSupply.sub(value); } emit Transfer(from, to, value); } function approve(address spender, uint value) external returns (bool) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transfer(address to, uint value) external returns (bool) { _transfer(msg.sender, to, value); return true; } function transferFrom(address from, address to, uint value) external returns (bool) { require(allowance[from][msg.sender] >= value, 'ERC20Token: INSUFFICIENT_ALLOWANCE'); allowance[from][msg.sender] = allowance[from][msg.sender].sub(value); _transfer(from, to, value); return true; } } contract UpgradableProduct { address public impl; event ImplChanged(address indexed _oldImpl, address indexed _newImpl); constructor() public { impl = msg.sender; } modifier requireImpl() { require(msg.sender == impl, 'FORBIDDEN'); _; } function upgradeImpl(address _newImpl) public requireImpl { require(_newImpl != address(0), 'INVALID_ADDRESS'); require(_newImpl != impl, 'NO_CHANGE'); address lastImpl = impl; impl = _newImpl; emit ImplChanged(lastImpl, _newImpl); } } contract UpgradableGovernance { address public governor; event GovernorChanged(address indexed _oldGovernor, address indexed _newGovernor); constructor() public { governor = msg.sender; } modifier requireGovernor() { require(msg.sender == governor, 'FORBIDDEN'); _; } function upgradeGovernance(address _newGovernor) public requireGovernor { require(_newGovernor != address(0), 'INVALID_ADDRESS'); require(_newGovernor != governor, 'NO_CHANGE'); address lastGovernor = governor; governor = _newGovernor; emit GovernorChanged(lastGovernor, _newGovernor); } } /* The Objective of MintToken is to implement a decentralized staking mechanism, which calculates users' share by accumulating productiviy * time. And calculates users revenue from anytime t0 to t1 by the formula below: user_accumulated_productivity(time1) - user_accumulated_productivity(time0) _____________________________________________________________________________ * (gross_product(t1) - gross_product(t0)) total_accumulated_productivity(time1) - total_accumulated_productivity(time0) */ contract MintToken is ERC20Token, UpgradableProduct, UpgradableGovernance { using SafeMath for uint; uint public mintCumulation; struct Production { uint amount; // how many tokens could be produced on block basis uint total; // total produced tokens uint block; // last updated block number } Production public grossProduct = Production(0, 0, 0); struct Productivity { uint product; // user's productivity uint total; // total productivity uint block; // record's block number uint user; // accumulated products uint global; // global accumulated products uint gross; // global gross products } Productivity public global; mapping(address => Productivity) public users; event AmountPerBlockChanged (uint oldValue, uint newValue); event ProductivityIncreased (address indexed user, uint value); event ProductivityDecreased (address indexed user, uint value); uint private unlocked = 1; modifier lock() { require(unlocked == 1, 'Locked'); unlocked = 0; _; unlocked = 1; } // When calling _computeBlockProduct() it calculates the area of productivity * time since last time and accumulate it. function _computeBlockProduct() private view returns (uint) { uint elapsed = block.number.sub(grossProduct.block); return grossProduct.amount.mul(elapsed); } // compute productivity returns total productivity of a user. function _computeProductivity(Productivity memory user) private view returns (uint) { uint blocks = block.number.sub(user.block); return user.total.mul(blocks); } // update users' productivity by value with boolean value indicating increase or decrease. function _updateProductivity(Productivity storage user, uint value, bool increase) private { user.product = user.product.add(_computeProductivity(user)); global.product = global.product.add(_computeProductivity(global)); require(global.product <= uint(-1), 'GLOBAL_PRODUCT_OVERFLOW'); user.block = block.number; global.block = block.number; if(increase) { user.total = user.total.add(value); global.total = global.total.add(value); } else { user.total = user.total.sub(value); global.total = global.total.sub(value); } } // External function call // This function adjust how many token will be produced by each block, eg: // changeAmountPerBlock(100) // will set the produce rate to 100/block. function changeAmountPerBlock(uint value) external requireGovernor returns (bool) { uint old = grossProduct.amount; require(value != old, 'AMOUNT_PER_BLOCK_NO_CHANGE'); uint product = _computeBlockProduct(); grossProduct.total = grossProduct.total.add(product); grossProduct.block = block.number; grossProduct.amount = value; require(grossProduct.total <= uint(-1), 'BLOCK_PRODUCT_OVERFLOW'); emit AmountPerBlockChanged(old, value); return true; } // External function call // This function increase user's productivity and updates the global productivity. // the users' actual share percentage will calculated by: // Formula: user_productivity / global_productivity function increaseProductivity(address user, uint value) external requireImpl returns (bool) { require(value > 0, 'PRODUCTIVITY_VALUE_MUST_BE_GREATER_THAN_ZERO'); Productivity storage product = users[user]; if (product.block == 0) { product.gross = grossProduct.total.add(_computeBlockProduct()); } _updateProductivity(product, value, true); emit ProductivityIncreased(user, value); return true; } // External function call // This function will decreases user's productivity by value, and updates the global productivity // it will record which block this is happenning and accumulates the area of (productivity * time) function decreaseProductivity(address user, uint value) external requireImpl returns (bool) { Productivity storage product = users[user]; require(value > 0 && product.total >= value, 'INSUFFICIENT_PRODUCTIVITY'); _updateProductivity(product, value, false); emit ProductivityDecreased(user, value); return true; } // External function call // When user calls this function, it will calculate how many token will mint to user from his productivity * time // Also it calculates global token supply from last time the user mint to this time. function mint() external lock returns (uint) { (uint gp, uint userProduct, uint globalProduct, uint amount) = _computeUserProduct(); require(amount > 0, 'NO_PRODUCTIVITY'); Productivity storage product = users[msg.sender]; product.gross = gp; product.user = userProduct; product.global = globalProduct; balanceOf[msg.sender] = balanceOf[msg.sender].add(amount); totalSupply = totalSupply.add(amount); mintCumulation = mintCumulation.add(amount); emit Transfer(address(0), msg.sender, amount); return amount; } // Returns how many token he will be able to mint. function _computeUserProduct() private view returns (uint gp, uint userProduct, uint globalProduct, uint amount) { Productivity memory product = users[msg.sender]; gp = grossProduct.total.add(_computeBlockProduct()); userProduct = product.product.add(_computeProductivity(product)); globalProduct = global.product.add(_computeProductivity(global)); uint deltaBlockProduct = gp.sub(product.gross); uint numerator = userProduct.sub(product.user); uint denominator = globalProduct.sub(product.global); if (denominator > 0) { amount = deltaBlockProduct.mul(numerator) / denominator; } } // Returns how many productivity a user has and global has. function getProductivity(address user) external view returns (uint, uint) { return (users[user].total, global.total); } // Returns the current gorss product rate. function amountPerBlock() external view returns (uint) { return grossProduct.amount; } // Returns how much a user could earn. function take() external view returns (uint) { (, , , uint amount) = _computeUserProduct(); return amount; } // Returns how much a user could earn plus the giving block number. function takes() external view returns (uint, uint) { (, , , uint amount) = _computeUserProduct(); return (amount, block.number); } } contract Dgas is MintToken { constructor() UpgradableProduct() UpgradableGovernance() public { name = 'Demax Gas'; symbol = 'DGAS'; decimals = 18; grossProduct.amount = 100 * (10 ** 18); grossProduct.block = block.number; } }
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806336f04e45116100de5780638abf607711610097578063a87430ba11610071578063a87430ba14610480578063a9059cbb146104a6578063cf675365146104d2578063dd62ed3e146104da57610173565b80638abf60771461043557806395d89b411461043d578063a05f99061461044557610173565b806336f04e45146103815780634afa66d6146103ad5780634c61f047146103d957806370a08231146103e157806370e4605b146104075780637c09063f1461042d57610173565b806318160ddd1161013057806318160ddd146102985780631a2f1363146102a05780631fedded5146102c857806323b872dd146102ee57806328e964e914610324578063313ce5671461036357610173565b80630135e2781461017857806306fdde03146101a9578063095ea7b3146102265780630c340a24146102525780631249c58b14610276578063159090bd14610290575b600080fd5b6101956004803603602081101561018e57600080fd5b5035610508565b604080519115158252519081900360200190f35b6101b161061f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101eb5781810151838201526020016101d3565b50505050905090810190601f1680156102185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101956004803603604081101561023c57600080fd5b506001600160a01b0381351690602001356106ad565b61025a610714565b604080516001600160a01b039092168252519081900360200190f35b61027e610723565b60408051918252519081900360200190f35b61027e610887565b61027e61089b565b6102c6600480360360208110156102b657600080fd5b50356001600160a01b03166108a1565b005b6102c6600480360360208110156102de57600080fd5b50356001600160a01b03166109da565b6101956004803603606081101561030457600080fd5b506001600160a01b03813581169160208101359091169060400135610b13565b61034a6004803603602081101561033a57600080fd5b50356001600160a01b0316610be2565b6040805192835260208301919091528051918290030190f35b61036b610c04565b6040805160ff9092168252519081900360200190f35b6101956004803603604081101561039757600080fd5b506001600160a01b038135169060200135610c0d565b610195600480360360408110156103c357600080fd5b506001600160a01b038135169060200135610d30565b61027e610e4f565b61027e600480360360208110156103f757600080fd5b50356001600160a01b0316610e55565b61040f610e67565b60408051938452602084019290925282820152519081900360600190f35b61034a610e73565b61025a610e8c565b6101b1610e9b565b61044d610ef5565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b61044d6004803603602081101561049657600080fd5b50356001600160a01b0316610f0a565b610195600480360360408110156104bc57600080fd5b506001600160a01b038135169060200135610f3f565b61027e610f55565b61027e600480360360408110156104f057600080fd5b506001600160a01b0381358116916020013516610f5b565b6007546000906001600160a01b03163314610556576040805162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b604482015290519081900360640190fd5b600954828114156105ae576040805162461bcd60e51b815260206004820152601a60248201527f414d4f554e545f5045525f424c4f434b5f4e4f5f4348414e4745000000000000604482015290519081900360640190fd5b60006105b8610f78565b600a549091506105ce908263ffffffff610fad16565b600a5543600b556009849055604080518381526020810186905281517fa12f859b7325837ffebb759f16c0c54dac49b66a72f63c172581527946783091929181900390910190a15060019392505050565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106a55780601f1061067a576101008083540402835291602001916106a5565b820191906000526020600020905b81548152906001019060200180831161068857829003601f168201915b505050505081565b3360008181526005602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b6007546001600160a01b031681565b6000601354600114610765576040805162461bcd60e51b8152602060048201526006602482015265131bd8dad95960d21b604482015290519081900360640190fd5b60006013819055808080610777610ffc565b9350935093509350600081116107c6576040805162461bcd60e51b815260206004820152600f60248201526e4e4f5f50524f44554354495649545960881b604482015290519081900360640190fd5b3360009081526012602090815260408083206005810188905560038101879055600480820187905590925290912054610805908363ffffffff610fad16565b33600090815260046020526040902055600354610828908363ffffffff610fad16565b60035560085461083e908363ffffffff610fad16565b60085560408051838152905133916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3509350505050600160135590565b600080610892610ffc565b94505050505090565b60035481565b6006546001600160a01b031633146108ec576040805162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b604482015290519081900360640190fd5b6001600160a01b038116610939576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4144445245535360881b604482015290519081900360640190fd5b6006546001600160a01b0382811691161415610988576040805162461bcd60e51b81526020600482015260096024820152684e4f5f4348414e474560b81b604482015290519081900360640190fd5b600680546001600160a01b038381166001600160a01b0319831681179093556040519116919082907faad46b89531ed10d02d926f4d6bfe234a6126e3fffc02d3b07167575f9c1433790600090a35050565b6007546001600160a01b03163314610a25576040805162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b604482015290519081900360640190fd5b6001600160a01b038116610a72576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f4144445245535360881b604482015290519081900360640190fd5b6007546001600160a01b0382811691161415610ac1576040805162461bcd60e51b81526020600482015260096024820152684e4f5f4348414e474560b81b604482015290519081900360640190fd5b600780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907fde4b3f61490b74c0ed6237523974fe299126bbbf8a8a7482fd220104c59b0c8490600090a35050565b6001600160a01b0383166000908152600560209081526040808320338452909152812054821115610b755760405162461bcd60e51b81526004018080602001828103825260228152602001806114f86022913960400191505060405180910390fd5b6001600160a01b0384166000908152600560209081526040808320338452909152902054610ba9908363ffffffff61115f16565b6001600160a01b0385166000908152600560209081526040808320338452909152902055610bd88484846111af565b5060019392505050565b6001600160a01b0316600090815260126020526040902060010154600d549091565b60025460ff1681565b6006546000906001600160a01b03163314610c5b576040805162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b604482015290519081900360640190fd5b60008211610c9a5760405162461bcd60e51b815260040180806020018281038252602c81526020018061151a602c913960400191505060405180910390fd5b6001600160a01b03831660009081526012602052604090206002810154610cdb57610cd5610cc6610f78565b600a549063ffffffff610fad16565b60058201555b610ce781846001611301565b6040805184815290516001600160a01b038616917f6c0a24b06ee7f1d9c3c6680c7328531c32bc59cd665436fc686f973cb8c01be7919081900360200190a25060019392505050565b6006546000906001600160a01b03163314610d7e576040805162461bcd60e51b81526020600482015260096024820152682327a92124a22222a760b91b604482015290519081900360640190fd5b6001600160a01b03831660009081526012602052604090208215801590610da9575082816001015410155b610dfa576040805162461bcd60e51b815260206004820152601960248201527f494e53554646494349454e545f50524f44554354495649545900000000000000604482015290519081900360640190fd5b610e0681846000611301565b6040805184815290516001600160a01b038616917fddb757202feefdd10c1666f1bb8f9744309ab811b6ef3ec0404a20c36e426697919081900360200190a25060019392505050565b60095490565b60046020526000908152604090205481565b600954600a54600b5483565b6000806000610e80610ffc565b96439650945050505050565b6006546001600160a01b031681565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106a55780601f1061067a576101008083540402835291602001916106a5565b600c54600d54600e54600f5460105460115486565b601260205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909186565b6000610f4c3384846111af565b50600192915050565b60085481565b600560209081526000928352604080842090915290825290205481565b600b546000908190610f9190439063ffffffff61115f16565b600954909150610fa7908263ffffffff61142516565b91505090565b8082018281101561070e576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6164642d6f766572666c6f7760601b604482015290519081900360640190fd5b60008060008061100a6114c1565b5033600090815260126020908152604091829020825160c08101845281548152600182015492810192909252600281015492820192909252600382015460608201526004820154608082015260059091015460a082015261106c610cc6610f78565b945061108861107a82611488565b82519063ffffffff610fad16565b6040805160c081018252600c548152600d546020820152600e5491810191909152600f546060820152601054608082015260115460a08201529094506110e0906110d190611488565b600c549063ffffffff610fad16565b925060006110fb8260a001518761115f90919063ffffffff16565b9050600061111683606001518761115f90919063ffffffff16565b9050600061113184608001518761115f90919063ffffffff16565b90508015611155578061114a848463ffffffff61142516565b8161115157fe5b0494505b5050505090919293565b8082038281111561070e576040805162461bcd60e51b815260206004820152601560248201527464732d6d6174682d7375622d756e646572666c6f7760581b604482015290519081900360640190fd5b6001600160a01b03831660009081526004602052604090205481111561121c576040805162461bcd60e51b815260206004820181905260248201527f4552433230546f6b656e3a20494e53554646494349454e545f42414c414e4345604482015290519081900360640190fd5b6001600160a01b038316600090815260046020526040902054611245908263ffffffff61115f16565b6001600160a01b03808516600090815260046020526040808220939093559084168152205461127a908263ffffffff610fad16565b6001600160a01b0383166000818152600460205260409020919091556112b1576003546112ad908263ffffffff61115f16565b6003555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6040805160c08101825284548152600185015460208201526002850154918101919091526003840154606082015260048401546080820152600584015460a082015261135e9061135090611488565b84549063ffffffff610fad16565b83556040805160c081018252600c548152600d546020820152600e5491810191909152600f546060820152601054608082015260115460a08201526113a6906110d190611488565b600c554360028401819055600e5580156113ef5760018301546113cf908363ffffffff610fad16565b6001840155600d546113e7908363ffffffff610fad16565b600d55611420565b6001830154611404908363ffffffff61115f16565b6001840155600d5461141c908363ffffffff61115f16565b600d555b505050565b60008115806114405750508082028282828161143d57fe5b04145b61070e576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b6000806114a283604001514361115f90919063ffffffff16565b60208401519091506114ba908263ffffffff61142516565b9392505050565b6040518060c00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe4552433230546f6b656e3a20494e53554646494349454e545f414c4c4f57414e434550524f4455435449564954595f56414c55455f4d5553545f42455f475245415445525f5448414e5f5a45524fa264697066735822122091819ac6416a60ad84e778cfb881cc2c3ef91accb2df0f41a916bcfa8bbb3a1f64736f6c63430006060033
{"success": true, "error": null, "results": {}}
6,681
0x44b77de73991aade70811c1c526867c232a65955
/** *Submitted for verification at Etherscan.io on 2022-04-02 */ /* Alpha Stealth nvm Telegram: t.me/nvmtoken */ // 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 NVM is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "NEVERMIND";////////////////////////// string private constant _symbol = "NVM";////////////////////////////////////////////////////////////////////////// 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(0xF4Af1c0aD5C009337412ab90F18df753055AC614);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0xF4Af1c0aD5C009337412ab90F18df753055AC614);/////////////////////////////////////////////////// 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051a578063dd62ed3e1461053a578063ea1644d514610580578063f2fde38b146105a057600080fd5b8063a2a957bb14610495578063a9059cbb146104b5578063bfd79284146104d5578063c3c8cd801461050557600080fd5b80638f70ccf7116100d15780638f70ccf7146104135780638f9a55c01461043357806395d89b411461044957806398a5c3151461047557600080fd5b806374010ece146103bf5780637d1db4a5146103df5780638da5cb5b146103f557600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103555780636fc3eaec1461037557806370a082311461038a578063715018a6146103aa57600080fd5b8063313ce567146102f957806349bd5a5e146103155780636b9990531461033557600080fd5b80631694505e116101a05780631694505e1461026757806318160ddd1461029f57806323b872dd146102c35780632fd689e3146102e357600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023757600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ae4565b6105c0565b005b3480156101ff57600080fd5b5060408051808201909152600981526813915591549352539160ba1b60208201525b60405161022e9190611c0e565b60405180910390f35b34801561024357600080fd5b50610257610252366004611a3a565b61066d565b604051901515815260200161022e565b34801561027357600080fd5b50601454610287906001600160a01b031681565b6040516001600160a01b03909116815260200161022e565b3480156102ab57600080fd5b50662386f26fc100005b60405190815260200161022e565b3480156102cf57600080fd5b506102576102de3660046119fa565b610684565b3480156102ef57600080fd5b506102b560185481565b34801561030557600080fd5b506040516009815260200161022e565b34801561032157600080fd5b50601554610287906001600160a01b031681565b34801561034157600080fd5b506101f161035036600461198a565b6106ed565b34801561036157600080fd5b506101f1610370366004611bab565b610738565b34801561038157600080fd5b506101f1610780565b34801561039657600080fd5b506102b56103a536600461198a565b6107cb565b3480156103b657600080fd5b506101f16107ed565b3480156103cb57600080fd5b506101f16103da366004611bc5565b610861565b3480156103eb57600080fd5b506102b560165481565b34801561040157600080fd5b506000546001600160a01b0316610287565b34801561041f57600080fd5b506101f161042e366004611bab565b610890565b34801561043f57600080fd5b506102b560175481565b34801561045557600080fd5b506040805180820190915260038152624e564d60e81b6020820152610221565b34801561048157600080fd5b506101f1610490366004611bc5565b6108d8565b3480156104a157600080fd5b506101f16104b0366004611bdd565b610907565b3480156104c157600080fd5b506102576104d0366004611a3a565b610945565b3480156104e157600080fd5b506102576104f036600461198a565b60106020526000908152604090205460ff1681565b34801561051157600080fd5b506101f1610952565b34801561052657600080fd5b506101f1610535366004611a65565b6109a6565b34801561054657600080fd5b506102b56105553660046119c2565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058c57600080fd5b506101f161059b366004611bc5565b610a55565b3480156105ac57600080fd5b506101f16105bb36600461198a565b610a84565b6000546001600160a01b031633146105f35760405162461bcd60e51b81526004016105ea90611c61565b60405180910390fd5b60005b81518110156106695760016010600084848151811061062557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066181611d74565b9150506105f6565b5050565b600061067a338484610b6e565b5060015b92915050565b6000610691848484610c92565b6106e384336106de85604051806060016040528060288152602001611dd1602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ce565b610b6e565b5060019392505050565b6000546001600160a01b031633146107175760405162461bcd60e51b81526004016105ea90611c61565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107625760405162461bcd60e51b81526004016105ea90611c61565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b557506013546001600160a01b0316336001600160a01b0316145b6107be57600080fd5b476107c881611208565b50565b6001600160a01b03811660009081526002602052604081205461067e9061128d565b6000546001600160a01b031633146108175760405162461bcd60e51b81526004016105ea90611c61565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088b5760405162461bcd60e51b81526004016105ea90611c61565b601655565b6000546001600160a01b031633146108ba5760405162461bcd60e51b81526004016105ea90611c61565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109025760405162461bcd60e51b81526004016105ea90611c61565b601855565b6000546001600160a01b031633146109315760405162461bcd60e51b81526004016105ea90611c61565b600893909355600a91909155600955600b55565b600061067a338484610c92565b6012546001600160a01b0316336001600160a01b0316148061098757506013546001600160a01b0316336001600160a01b0316145b61099057600080fd5b600061099b306107cb565b90506107c881611311565b6000546001600160a01b031633146109d05760405162461bcd60e51b81526004016105ea90611c61565b60005b82811015610a4f578160056000868685818110610a0057634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a15919061198a565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4781611d74565b9150506109d3565b50505050565b6000546001600160a01b03163314610a7f5760405162461bcd60e51b81526004016105ea90611c61565b601755565b6000546001600160a01b03163314610aae5760405162461bcd60e51b81526004016105ea90611c61565b6001600160a01b038116610b135760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ea565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ea565b6001600160a01b038216610c315760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ea565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ea565b6001600160a01b038216610d585760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ea565b60008111610dba5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ea565b6000546001600160a01b03848116911614801590610de657506000546001600160a01b03838116911614155b156110c757601554600160a01b900460ff16610e7f576000546001600160a01b03848116911614610e7f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ea565b601654811115610ed15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ea565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1357506001600160a01b03821660009081526010602052604090205460ff16155b610f6b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ea565b6015546001600160a01b03838116911614610ff05760175481610f8d846107cb565b610f979190611d06565b10610ff05760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ea565b6000610ffb306107cb565b6018546016549192508210159082106110145760165491505b80801561102b5750601554600160a81b900460ff16155b801561104557506015546001600160a01b03868116911614155b801561105a5750601554600160b01b900460ff165b801561107f57506001600160a01b03851660009081526005602052604090205460ff16155b80156110a457506001600160a01b03841660009081526005602052604090205460ff16155b156110c4576110b282611311565b4780156110c2576110c247611208565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110957506001600160a01b03831660009081526005602052604090205460ff165b8061113b57506015546001600160a01b0385811691161480159061113b57506015546001600160a01b03848116911614155b15611148575060006111c2565b6015546001600160a01b03858116911614801561117357506014546001600160a01b03848116911614155b1561118557600854600c55600954600d555b6015546001600160a01b0384811691161480156111b057506014546001600160a01b03858116911614155b156111c257600a54600c55600b54600d555b610a4f848484846114b6565b600081848411156111f25760405162461bcd60e51b81526004016105ea9190611c0e565b5060006111ff8486611d5d565b95945050505050565b6012546001600160a01b03166108fc6112228360026114e4565b6040518115909202916000818181858888f1935050505015801561124a573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112658360026114e4565b6040518115909202916000818181858888f19350505050158015610669573d6000803e3d6000fd5b60006006548211156112f45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ea565b60006112fe611526565b905061130a83826114e4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136757634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113bb57600080fd5b505afa1580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f391906119a6565b8160018151811061141457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143a9130911684610b6e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611473908590600090869030904290600401611c96565b600060405180830381600087803b15801561148d57600080fd5b505af11580156114a1573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c3576114c3611549565b6114ce848484611577565b80610a4f57610a4f600e54600c55600f54600d55565b600061130a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166e565b600080600061153361169c565b909250905061154282826114e4565b9250505090565b600c541580156115595750600d54155b1561156057565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611589876116da565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bb9087611737565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ea9086611779565b6001600160a01b03891660009081526002602052604090205561160c816117d8565b6116168483611822565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165b91815260200190565b60405180910390a3505050505050505050565b6000818361168f5760405162461bcd60e51b81526004016105ea9190611c0e565b5060006111ff8486611d1e565b6006546000908190662386f26fc100006116b682826114e4565b8210156116d157505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116f78a600c54600d54611846565b9250925092506000611707611526565b9050600080600061171a8e87878761189b565b919e509c509a509598509396509194505050505091939550919395565b600061130a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ce565b6000806117868385611d06565b90508381101561130a5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ea565b60006117e2611526565b905060006117f083836118eb565b3060009081526002602052604090205490915061180d9082611779565b30600090815260026020526040902055505050565b60065461182f9083611737565b60065560075461183f9082611779565b6007555050565b6000808080611860606461185a89896118eb565b906114e4565b90506000611873606461185a8a896118eb565b9050600061188b826118858b86611737565b90611737565b9992985090965090945050505050565b60008080806118aa88866118eb565b905060006118b888876118eb565b905060006118c688886118eb565b905060006118d8826118858686611737565b939b939a50919850919650505050505050565b6000826118fa5750600061067e565b60006119068385611d3e565b9050826119138583611d1e565b1461130a5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ea565b803561197581611dbb565b919050565b8035801515811461197557600080fd5b60006020828403121561199b578081fd5b813561130a81611dbb565b6000602082840312156119b7578081fd5b815161130a81611dbb565b600080604083850312156119d4578081fd5b82356119df81611dbb565b915060208301356119ef81611dbb565b809150509250929050565b600080600060608486031215611a0e578081fd5b8335611a1981611dbb565b92506020840135611a2981611dbb565b929592945050506040919091013590565b60008060408385031215611a4c578182fd5b8235611a5781611dbb565b946020939093013593505050565b600080600060408486031215611a79578283fd5b833567ffffffffffffffff80821115611a90578485fd5b818601915086601f830112611aa3578485fd5b813581811115611ab1578586fd5b8760208260051b8501011115611ac5578586fd5b602092830195509350611adb918601905061197a565b90509250925092565b60006020808385031215611af6578182fd5b823567ffffffffffffffff80821115611b0d578384fd5b818501915085601f830112611b20578384fd5b813581811115611b3257611b32611da5565b8060051b604051601f19603f83011681018181108582111715611b5757611b57611da5565b604052828152858101935084860182860187018a1015611b75578788fd5b8795505b83861015611b9e57611b8a8161196a565b855260019590950194938601938601611b79565b5098975050505050505050565b600060208284031215611bbc578081fd5b61130a8261197a565b600060208284031215611bd6578081fd5b5035919050565b60008060008060808587031215611bf2578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3a57858101830151858201604001528201611c1e565b81811115611c4b5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ce55784516001600160a01b031683529383019391830191600101611cc0565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1957611d19611d8f565b500190565b600082611d3957634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5857611d58611d8f565b500290565b600082821015611d6f57611d6f611d8f565b500390565b6000600019821415611d8857611d88611d8f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204fbfc1701063b34aa07a353237fc0412db4ddca243e898e790baa09c33eaaf0764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,682
0xa342b71ef080fd75a78251aa83d3f5ce80743939
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); 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; } } contract QIUToken is StandardToken,Ownable { string public name = 'QIUToken'; string public symbol = 'QIU'; uint8 public decimals = 0; uint public INITIAL_SUPPLY = 5000000000; uint public eth2qiuRate = 10000; function() public payable { } // make this contract to receive ethers function QIUToken() public { totalSupply_ = INITIAL_SUPPLY; balances[owner] = INITIAL_SUPPLY / 10; balances[this] = INITIAL_SUPPLY - balances[owner]; } function getOwner() public view returns (address) { return owner; } /** * @dev Transfer tokens from one address to another, only owner can do this super-user operate * @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 ownerTransferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(tx.origin == owner); // only the owner can call the method. require(_to != address(0)); require(_value <= balances[_from]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(_from, _to, _value); return true; } /** * @dev transfer token for a specified address,but different from transfer is replace msg.sender with tx.origin * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function originTransfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[tx.origin]); // SafeMath.sub will throw if there is not enough balance. balances[tx.origin] = balances[tx.origin].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(tx.origin, _to, _value); return true; } event ExchangeForETH(address fromAddr,address to,uint qiuAmount,uint ethAmount); function exchangeForETH(uint qiuAmount) public returns (bool){ uint ethAmount = qiuAmount * 1000000000000000000 / eth2qiuRate; // only accept multiple of 100 require(this.balance >= ethAmount); balances[this] = balances[this].add(qiuAmount); balances[msg.sender] = balances[msg.sender].sub(qiuAmount); msg.sender.transfer(ethAmount); ExchangeForETH(this,msg.sender,qiuAmount,ethAmount); return true; } event ExchangeForQIU(address fromAddr,address to,uint qiuAmount,uint ethAmount); function exchangeForQIU() payable public returns (bool){ uint qiuAmount = msg.value * eth2qiuRate / 1000000000000000000; require(qiuAmount <= balances[this]); balances[this] = balances[this].sub(qiuAmount); balances[msg.sender] = balances[msg.sender].add(qiuAmount); ExchangeForQIU(this,msg.sender,qiuAmount,msg.value); return true; } /* // transfer out method function ownerETHCashout(address account) public onlyOwner { account.transfer(this.balance); }*/ function getETHBalance() public view returns (uint) { return this.balance; // balance is "inherited" from the address type } } contract SoccerChampion is Ownable { using SafeMath for uint256; struct Tournament { uint id; bool isEnded; bool isLockedForSupport; bool initialized; Team[] teams; SupportTicket[] tickets; } struct Team { uint id; bool isKnockout; bool isChampion; } struct SupportTicket { uint teamId; address supportAddres; uint supportAmount; } //ufixed private serviceChargeRate = 1/100; mapping (uint => Tournament) public tournaments; uint private _nextTournamentId = 0; QIUToken public _internalToken; uint private _commissionNumber; uint private _commissionScale; function SoccerChampion(QIUToken _tokenAddress) public { _nextTournamentId = 0; _internalToken = _tokenAddress; _commissionNumber = 2; _commissionScale = 100; } function modifyCommission(uint number,uint scale) public onlyOwner returns(bool){ _commissionNumber = number; _commissionScale = scale; return true; } event NewTouramentCreateSuccess(uint newTourId); function createNewTourament(uint[] teamIds) public onlyOwner{ uint newTourId = _nextTournamentId; tournaments[newTourId].id = newTourId; tournaments[newTourId].isEnded = false; tournaments[newTourId].isLockedForSupport = false; tournaments[newTourId].initialized = true; for(uint idx = 0; idx < teamIds.length; idx ++){ Team memory team; team.id = teamIds[idx]; team.isChampion = false; tournaments[newTourId].teams.push(team); } _nextTournamentId ++; NewTouramentCreateSuccess(newTourId); } function supportTeam(uint tournamentId, uint teamId, uint amount) public { require(tournaments[tournamentId].initialized); require(_internalToken.balanceOf(msg.sender) >= amount); require(!tournaments[tournamentId].isEnded); require(!tournaments[tournamentId].isLockedForSupport); require(amount > 0); SupportTicket memory ticket; ticket.teamId = teamId; ticket.supportAddres = msg.sender; ticket.supportAmount = amount; _internalToken.originTransfer(this, amount); tournaments[tournamentId].tickets.push(ticket); } function _getTournamentSupportAmount(uint tournamentId) public view returns(uint){ uint supportAmount = 0; for(uint idx = 0; idx < tournaments[tournamentId].tickets.length; idx++){ supportAmount = supportAmount.add(tournaments[tournamentId].tickets[idx].supportAmount); } return supportAmount; } function _getTeamSupportAmount(uint tournamentId, uint teamId) public view returns(uint){ uint supportAmount = 0; for(uint idx = 0; idx < tournaments[tournamentId].tickets.length; idx++){ if(tournaments[tournamentId].tickets[idx].teamId == teamId){ supportAmount = supportAmount.add(tournaments[tournamentId].tickets[idx].supportAmount); } } return supportAmount; } function _getUserSupportForTeamInTournament(uint tournamentId, uint teamId) public view returns(uint){ uint supportAmount = 0; for(uint idx = 0; idx < tournaments[tournamentId].tickets.length; idx++){ if(tournaments[tournamentId].tickets[idx].teamId == teamId && tournaments[tournamentId].tickets[idx].supportAddres == msg.sender){ supportAmount = supportAmount.add(tournaments[tournamentId].tickets[idx].supportAmount); } } return supportAmount; } function getTeamlistSupportInTournament(uint tournamentId) public view returns(uint[] teamIds, uint[] supportAmounts, bool[] knockOuts, uint championTeamId, bool isEnded, bool isLocked){ if(tournaments[tournamentId].initialized){ teamIds = new uint[](tournaments[tournamentId].teams.length); supportAmounts = new uint[](tournaments[tournamentId].teams.length); knockOuts = new bool[](tournaments[tournamentId].teams.length); championTeamId = 0; for(uint tidx = 0; tidx < tournaments[tournamentId].teams.length; tidx++){ teamIds[tidx] = tournaments[tournamentId].teams[tidx].id; if(tournaments[tournamentId].teams[tidx].isChampion){ championTeamId = teamIds[tidx]; } knockOuts[tidx] = tournaments[tournamentId].teams[tidx].isKnockout; supportAmounts[tidx] = _getTeamSupportAmount(tournamentId, teamIds[tidx]); } isEnded = tournaments[tournamentId].isEnded; isLocked = tournaments[tournamentId].isLockedForSupport; } } function getUserSupportInTournament(uint tournamentId) public view returns(uint[] teamIds, uint[] supportAmounts){ if(tournaments[tournamentId].initialized){ teamIds = new uint[](tournaments[tournamentId].teams.length); supportAmounts = new uint[](tournaments[tournamentId].teams.length); for(uint tidx = 0; tidx < tournaments[tournamentId].teams.length; tidx++){ teamIds[tidx] = tournaments[tournamentId].teams[tidx].id; uint userSupportAmount = _getUserSupportForTeamInTournament(tournamentId, teamIds[tidx]); supportAmounts[tidx] = userSupportAmount; } } } function getUserWinInTournament(uint tournamentId) public view returns(bool isEnded, uint winAmount){ if(tournaments[tournamentId].initialized){ isEnded = tournaments[tournamentId].isEnded; if(isEnded){ for(uint tidx = 0; tidx < tournaments[tournamentId].teams.length; tidx++){ Team memory team = tournaments[tournamentId].teams[tidx]; if(team.isChampion){ uint tournamentSupportAmount = _getTournamentSupportAmount(tournamentId); uint teamSupportAmount = _getTeamSupportAmount(tournamentId, team.id); uint userSupportAmount = _getUserSupportForTeamInTournament(tournamentId, team.id); uint gainAmount = (userSupportAmount.mul(tournamentSupportAmount)).div(teamSupportAmount); winAmount = (gainAmount.mul(_commissionScale.sub(_commissionNumber))).div(_commissionScale); } } }else{ winAmount = 0; } } } function knockoutTeam(uint tournamentId, uint teamId) public onlyOwner{ require(tournaments[tournamentId].initialized); require(!tournaments[tournamentId].isEnded); for(uint tidx = 0; tidx < tournaments[tournamentId].teams.length; tidx++){ Team storage team = tournaments[tournamentId].teams[tidx]; if(team.id == teamId){ team.isKnockout = true; } } } event endTournamentSuccess(uint tourId); function endTournament(uint tournamentId, uint championTeamId) public onlyOwner{ require(tournaments[tournamentId].initialized); require(!tournaments[tournamentId].isEnded); tournaments[tournamentId].isEnded = true; uint tournamentSupportAmount = _getTournamentSupportAmount(tournaments[tournamentId].id); uint teamSupportAmount = _getTeamSupportAmount(tournaments[tournamentId].id, championTeamId); uint totalClearAmount = 0; for(uint tidx = 0; tidx < tournaments[tournamentId].teams.length; tidx++){ Team storage team = tournaments[tournamentId].teams[tidx]; if(team.id == championTeamId){ team.isChampion = true; break; } } for(uint idx = 0 ; idx < tournaments[tournamentId].tickets.length; idx++){ SupportTicket memory ticket = tournaments[tournamentId].tickets[idx]; if(ticket.teamId == championTeamId){ if(teamSupportAmount != 0){ uint gainAmount = (ticket.supportAmount.mul(tournamentSupportAmount)).div(teamSupportAmount); uint actualGainAmount = (gainAmount.mul(_commissionScale.sub(_commissionNumber))).div(_commissionScale); _internalToken.ownerTransferFrom(this, ticket.supportAddres, actualGainAmount); totalClearAmount = totalClearAmount.add(actualGainAmount); } } } _internalToken.ownerTransferFrom(this, owner, tournamentSupportAmount.sub(totalClearAmount)); endTournamentSuccess(tournamentId); } event lockTournamentSuccess(uint tourId, bool isLock); function lockTournament(uint tournamentId, bool isLock) public onlyOwner{ require(tournaments[tournamentId].initialized); require(!tournaments[tournamentId].isEnded); tournaments[tournamentId].isLockedForSupport = isLock; lockTournamentSuccess(tournamentId, isLock); } }
0x6060604052600436106100e5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062b5988e146100ea5780632a74833d146101185780633fb1ab52146101d857806345387d2c146102185780636bc8a2601461024f5780636db5d3b7146102915780637503e1b7146102d55780638da5cb5b1461032d5780639ae51a1f14610382578063a059ffa6146104a7578063ab6a9f0e14610501578063c6bd541f1461052d578063c86d025114610562578063cc93f66e146105a2578063e40a72d4146105ce578063f2fde38b14610623575b600080fd5b34156100f557600080fd5b6101166004808035906020019091908035151590602001909190505061065c565b005b341561012357600080fd5b610139600480803590602001909190505061078b565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610180578082015181840152602081019050610165565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156101c25780820151818401526020810190506101a7565b5050505090500194505050505060405180910390f35b34156101e357600080fd5b6102026004808035906020019091908035906020019091905050610907565b6040518082815260200191505060405180910390f35b341561022357600080fd5b6102396004808035906020019091905050610a5e565b6040518082815260200191505060405180910390f35b341561025a57600080fd5b6102706004808035906020019091905050610aec565b60405180831515151581526020018281526020019250505060405180910390f35b341561029c57600080fd5b6102bb6004808035906020019091908035906020019091905050610cb8565b604051808215151515815260200191505060405180910390f35b34156102e057600080fd5b6102f66004808035906020019091905050610d2d565b6040518085815260200184151515158152602001831515151581526020018215151515815260200194505050505060405180910390f35b341561033857600080fd5b610340610d84565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038d57600080fd5b6103a36004808035906020019091905050610da9565b60405180806020018060200180602001878152602001861515151581526020018515151515815260200184810384528a818151815260200191508051906020019060200280838360005b838110156104085780820151818401526020810190506103ed565b50505050905001848103835289818151815260200191508051906020019060200280838360005b8381101561044a57808201518184015260208101905061042f565b50505050905001848103825288818151815260200191508051906020019060200280838360005b8381101561048c578082015181840152602081019050610471565b50505050905001995050505050505050505060405180910390f35b34156104b257600080fd5b6104ff600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611080565b005b341561050c57600080fd5b61052b60048080359060200190919080359060200190919050506112b9565b005b341561053857600080fd5b610560600480803590602001909190803590602001909190803590602001909190505061140c565b005b341561056d57600080fd5b61058c6004808035906020019091908035906020019091905050611777565b6040518082815260200191505060405180910390f35b34156105ad57600080fd5b6105cc6004808035906020019091908035906020019091905050611843565b005b34156105d957600080fd5b6105e1611e42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561062e57600080fd5b61065a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e68565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106b757600080fd5b6001600083815260200190815260200160002060010160029054906101000a900460ff1615156106e657600080fd5b6001600083815260200190815260200160002060010160009054906101000a900460ff1615151561071657600080fd5b806001600084815260200190815260200160002060010160016101000a81548160ff0219169083151502179055507f6df814be79273acd95d1f2c12fcee985a6b2cae4c628007b291f69757f83293b828260405180838152602001821515151581526020019250505060405180910390a15050565b61079361204a565b61079b61204a565b6000806001600086815260200190815260200160002060010160029054906101000a900460ff16156109005760016000868152602001908152602001600020600201805490506040518059106107ee5750595b9080825280602002602001820160405250935060016000868152602001908152602001600020600201805490506040518059106108285750595b90808252806020026020018201604052509250600091505b60016000868152602001908152602001600020600201805490508210156108ff57600160008681526020019081526020016000206002018281548110151561088457fe5b90600052602060002090600202016000015484838151811015156108a457fe5b90602001906020020181815250506108d38585848151811015156108c457fe5b90602001906020020151610907565b90508083838151811015156108e457fe5b90602001906020020181815250508180600101925050610840565b5b5050915091565b6000806000809150600090505b6001600086815260200190815260200160002060030180549050811015610a535783600160008781526020019081526020016000206003018281548110151561095957fe5b9060005260206000209060030201600001541480156109f757503373ffffffffffffffffffffffffffffffffffffffff1660016000878152602001908152602001600020600301828154811015156109ad57fe5b906000526020600020906003020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a4657610a436001600087815260200190815260200160002060030182815481101515610a2257fe5b90600052602060002090600302016002015483611fbd90919063ffffffff16565b91505b8080600101915050610914565b819250505092915050565b6000806000809150600090505b6001600085815260200190815260200160002060030180549050811015610ae257610ad36001600086815260200190815260200160002060030182815481101515610ab257fe5b90600052602060002090600302016002015483611fbd90919063ffffffff16565b91508080600101915050610a6b565b8192505050919050565b6000806000610af961205e565b600080600080600160008a815260200190815260200160002060010160029054906101000a900460ff1615610cad57600160008a815260200190815260200160002060010160009054906101000a900460ff1697508715610ca757600095505b600160008a815260200190815260200160002060020180549050861015610ca257600160008a815260200190815260200160002060020186815481101515610b9d57fe5b906000526020600020906002020160606040519081016040529081600082015481526020016001820160009054906101000a900460ff161515151581526020016001820160019054906101000a900460ff1615151515815250509450846040015115610c9557610c0c89610a5e565b9350610c1c898660000151611777565b9250610c2c898660000151610907565b9150610c5383610c458685611fdb90919063ffffffff16565b61201690919063ffffffff16565b9050610c92600554610c84610c7560045460055461203190919063ffffffff16565b84611fdb90919063ffffffff16565b61201690919063ffffffff16565b96505b8580600101965050610b59565b610cac565b600096505b5b505050505050915091565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d1557600080fd5b82600481905550816005819055506001905092915050565b60016020528060005260406000206000915090508060000154908060010160009054906101000a900460ff16908060010160019054906101000a900460ff16908060010160029054906101000a900460ff16905084565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610db161204a565b610db961204a565b610dc1612084565b6000806000806001600089815260200190815260200160002060010160029054906101000a900460ff1615611076576001600089815260200190815260200160002060020180549050604051805910610e175750595b908082528060200260200182016040525096506001600089815260200190815260200160002060020180549050604051805910610e515750595b908082528060200260200182016040525095506001600089815260200190815260200160002060020180549050604051805910610e8b5750595b9080825280602002602001820160405250945060009350600090505b6001600089815260200190815260200160002060020180549050811015611029576001600089815260200190815260200160002060020181815481101515610eeb57fe5b9060005260206000209060020201600001548782815181101515610f0b57fe5b90602001906020020181815250506001600089815260200190815260200160002060020181815481101515610f3c57fe5b906000526020600020906002020160010160019054906101000a900460ff1615610f7b578681815181101515610f6e57fe5b9060200190602002015193505b6001600089815260200190815260200160002060020181815481101515610f9e57fe5b906000526020600020906002020160010160009054906101000a900460ff168582815181101515610fcb57fe5b9060200190602002019015159081151581525050611000888883815181101515610ff157fe5b90602001906020020151611777565b868281518110151561100e57fe5b90602001906020020181815250508080600101915050610ea7565b6001600089815260200190815260200160002060010160009054906101000a900460ff1692506001600089815260200190815260200160002060010160019054906101000a900460ff1691505b5091939550919395565b60008061108b61205e565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110e657600080fd5b600254925082600160008581526020019081526020016000206000018190555060006001600085815260200190815260200160002060010160006101000a81548160ff02191690831515021790555060006001600085815260200190815260200160002060010160016101000a81548160ff021916908315150217905550600180600085815260200190815260200160002060010160026101000a81548160ff021916908315150217905550600091505b835182101561126a5783828151811015156111ae57fe5b9060200190602002015181600001818152505060008160400190151590811515815250506001600084815260200190815260200160002060020180548060010182816111fa9190612098565b916000526020600020906002020160008390919091506000820151816000015560208201518160010160006101000a81548160ff02191690831515021790555060408201518160010160016101000a81548160ff0219169083151502179055505050508180600101925050611197565b6002600081548092919060010191905055507f7ada5e233cf0138a5196833928616bcf7a6ec534f6de5f9f4118e12b5a037e75836040518082815260200191505060405180910390a150505050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131757600080fd5b6001600085815260200190815260200160002060010160029054906101000a900460ff16151561134657600080fd5b6001600085815260200190815260200160002060010160009054906101000a900460ff1615151561137657600080fd5b600091505b60016000858152602001908152602001600020600201805490508210156114065760016000858152602001908152602001600020600201828154811015156113bf57fe5b9060005260206000209060020201905082816000015414156113f95760018160010160006101000a81548160ff0219169083151502179055505b818060010192505061137b565b50505050565b6114146120ca565b6001600085815260200190815260200160002060010160029054906101000a900460ff16151561144357600080fd5b81600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561150957600080fd5b6102c65a03f1151561151a57600080fd5b505050604051805190501015151561153157600080fd5b6001600085815260200190815260200160002060010160009054906101000a900460ff1615151561156157600080fd5b6001600085815260200190815260200160002060010160019054906101000a900460ff1615151561159157600080fd5b6000821115156115a057600080fd5b8281600001818152505033816020019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505081816040018181525050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631d32ab9930846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156116b957600080fd5b6102c65a03f115156116ca57600080fd5b50505060405180519050506001600085815260200190815260200160002060030180548060010182816116fd9190612102565b916000526020600020906003020160008390919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015550505050505050565b6000806000809150600090505b6001600086815260200190815260200160002060030180549050811015611838578360016000878152602001908152602001600020600301828154811015156117c957fe5b906000526020600020906003020160000154141561182b57611828600160008781526020019081526020016000206003018281548110151561180757fe5b90600052602060002090600302016002015483611fbd90919063ffffffff16565b91505b8080600101915050611784565b819250505092915050565b6000806000806000806118546120ca565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118b257600080fd5b600160008c815260200190815260200160002060010160029054906101000a900460ff1615156118e157600080fd5b600160008c815260200190815260200160002060010160009054906101000a900460ff1615151561191157600080fd5b60018060008d815260200190815260200160002060010160006101000a81548160ff02191690831515021790555061195e600160008d815260200190815260200160002060000154610a5e565b9850611980600160008d8152602001908152602001600020600001548b611777565b975060009650600095505b600160008c815260200190815260200160002060020180549050861015611a1a57600160008c8152602001908152602001600020600201868154811015156119cf57fe5b906000526020600020906002020194508985600001541415611a0d5760018560010160016101000a81548160ff021916908315150217905550611a1a565b858060010196505061198b565b600093505b600160008c815260200190815260200160002060030180549050841015611cae57600160008c815260200190815260200160002060030184815481101515611a6357fe5b906000526020600020906003020160606040519081016040529081600082015481526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201548152505092508983600001511415611ca157600088141515611ca057611b2888611b1a8b8660400151611fdb90919063ffffffff16565b61201690919063ffffffff16565b9150611b67600554611b59611b4a60045460055461203190919063ffffffff16565b85611fdb90919063ffffffff16565b61201690919063ffffffff16565b9050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166353043490308560200151846000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515611c6e57600080fd5b6102c65a03f11515611c7f57600080fd5b5050506040518051905050611c9d8188611fbd90919063ffffffff16565b96505b5b8380600101945050611a1f565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166353043490306000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611d228b8e61203190919063ffffffff16565b6000604051602001526040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515611de257600080fd5b6102c65a03f11515611df357600080fd5b50505060405180519050507f6ee97ee7eb15bda9247c95152ae10c8fec794bef48962fafff4035816eee29558b6040518082815260200191505060405180910390a15050505050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ec357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611eff57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808284019050838110151515611fd157fe5b8091505092915050565b6000806000841415611ff0576000915061200f565b828402905082848281151561200157fe5b0414151561200b57fe5b8091505b5092915050565b600080828481151561202457fe5b0490508091505092915050565b600082821115151561203f57fe5b818303905092915050565b602060405190810160405280600081525090565b606060405190810160405280600081526020016000151581526020016000151581525090565b602060405190810160405280600081525090565b8154818355818115116120c5576002028160020283600052602060002091820191016120c49190612134565b5b505050565b60606040519081016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600081525090565b81548183558181151161212f5760030281600302836000526020600020918201910161212e9190612183565b5b505050565b61218091905b8082111561217c576000808201600090556001820160006101000a81549060ff02191690556001820160016101000a81549060ff02191690555060020161213a565b5090565b90565b6121d691905b808211156121d2576000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600282016000905550600301612189565b5090565b905600a165627a7a723058202a59a18b5200f8fa3af5acbacf13ea5152e9808798310d9bf530b7c7dd0a96330029
{"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": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
6,683
0x94ff810ec959b3190edc6af3a911c1c414c925dc
/** * babylinkinu This is fair launch and going to launch without any presale. tg: https://t.me/babylinkinu twitter: https://twitter.com/BabylinkInu All crypto babies will become a LionKing in here. Let's enjoy our launch! * 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 BBI 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"BabyLink inu"; string private constant _symbol = unicode" BBI "; 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); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613f5e565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de9190613a3b565b610662565b6040516101f09190613f43565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614140565b60405180910390f35b34801561023057600080fd5b5061024b600480360381019061024691906139ec565b610691565b6040516102589190613f43565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614140565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae91906141b5565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613b0a565b610783565b005b3480156102ec57600080fd5b5061030760048036038101906103029190613ab8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b919061395e565b61095f565b60405161033d9190614140565b60405180910390f35b34801561035257600080fd5b5061036d6004803603810190610368919061395e565b610aeb565b60405161037a9190613f43565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a5919061395e565b610b41565b6040516103b79190614140565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f9919061395e565b610c0a565b60405161040b9190614140565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613e75565b60405180910390f35b34801561046257600080fd5b5061047d6004803603810190610478919061395e565b610dd7565b60405161048a9190614140565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613f5e565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e09190613a3b565b610e7f565b6040516104f29190613f43565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613f43565b60405180910390f35b34801561053257600080fd5b5061054d60048036038101906105489190613a77565b610eb2565b005b34801561055b57600080fd5b50610564611134565b005b34801561057257600080fd5b5061057b6111ae565b005b34801561058957600080fd5b5061059261127a565b60405161059f9190614140565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca919061395e565b6112ac565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906139b0565b61139c565b6040516106059190614140565b60405180910390f35b34801561061a57600080fd5b50610623611423565b005b60606040518060400160405280600c81526020017f426162794c696e6b20696e750000000000000000000000000000000000000000815250905090565b600061067661066f611935565b848461193d565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611b08565b61075f846106aa611935565b61075a8560405180606001604052806028815260200161491760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610710611935565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612bdd9092919063ffffffff16565b61193d565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c4611935565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90614020565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614140565b60405180910390a150565b610872611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690614080565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613f43565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b19190614276565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a119190614276565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a719190614276565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad19190614276565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b919190614357565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd9611935565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612c41565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612db8565b9050919050565b610c63611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790614080565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d9190614357565b612e2690919063ffffffff16565b9050919050565b60606040518060400160405280600581526020017f2042424920000000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c611935565b8484611b08565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90614080565b60405180910390fd5b60005b815181101561113057601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610fc5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415801561107f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061105e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561111d576001600660008484815181106110c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061112890614456565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611175611935565b73ffffffffffffffffffffffffffffffffffffffff161461119557600080fd5b60006111a030610c0a565b90506111ab81612ea1565b50565b6111b6611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a90614080565b60405180910390fd5b6001601560146101000a81548160ff02191690831515021790555060784261126b9190614276565b60178190555043601681905550565b60006112a7601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112b4611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611341576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133890614080565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61142b611935565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114af90614080565b60405180910390fd5b601560149054906101000a900460ff1615611508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ff90614100565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061159830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061193d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156115de57600080fd5b505afa1580156115f2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116169190613987565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561167857600080fd5b505afa15801561168c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116b09190613987565b6040518363ffffffff1660e01b81526004016116cd929190613e90565b602060405180830381600087803b1580156116e757600080fd5b505af11580156116fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171f9190613987565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306117a830610c0a565b6000806117b3610dae565b426040518863ffffffff1660e01b81526004016117d596959493929190613ee2565b6060604051808303818588803b1580156117ee57600080fd5b505af1158015611802573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906118279190613b33565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016118df929190613eb9565b602060405180830381600087803b1580156118f957600080fd5b505af115801561190d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119319190613ae1565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a4906140e0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1490613fc0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611afb9190614140565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6f906140c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611be8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bdf90613f80565b60405180910390fd5b60008111611c2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c22906140a0565b60405180910390fd5b611c33610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca15750611c71610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612b1a57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d4a5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d5357600080fd5b6001601654611d629190614276565b4311158015611d72575060105481145b15611f9157601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e235750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e85576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f90565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611f315750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f8f576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661209e576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121495750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561219f5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561272757601560149054906101000a900460ff166121f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ea90614120565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546122439190614276565b421115612293576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561234b57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061233190614456565b91905055506005600a819055506005600b81905550612587565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561240357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906123e990614456565b91905055506004600a819055506004600b81905550612586565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156124bb57600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124a190614456565b91905055506003600a819055506003600b81905550612585565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561257357600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061255990614456565b91905055506002600a819055506002600b81905550612584565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff1615612726574260175411156126d2576010548111156125fa57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061267e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161267590613fe0565b60405180910390fd5b602d4261268b9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f426126df9190614276565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b600061273230610c0a565b9050601560169054906101000a900460ff1615801561279f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127b75750601560149054906101000a900460ff165b15612b185760158054906101000a900460ff16156128545742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410612853576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161284a90614040565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128aa9190614276565b4211156128ba57600a90506129e2565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461290a9190614276565b42111561291a57600f90506129e1565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461296a9190614276565b42111561297a57601490506129e0565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546129ca9190614276565b4211156129da57601990506129df565b602390505b5b5b5b612a09600a6129fb600484612e2690919063ffffffff16565b61319b90919063ffffffff16565b600a81905550612a36600a612a28600684612e2690919063ffffffff16565b61319b90919063ffffffff16565b600b819055506000821115612afd57612a976064612a89600c54612a7b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b821115612af357612af06064612ae2600c54612ad4601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612e2690919063ffffffff16565b61319b90919063ffffffff16565b91505b612afc82612ea1565b5b60004790506000811115612b1557612b1447612c41565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612bc15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bcb57600090505b612bd7848484846131e5565b50505050565b6000838311158290612c25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c1c9190613f5e565b60405180910390fd5b5060008385612c349190614357565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9160028461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cbc573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d0d60048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d38573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d8960048461319b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612db4573d6000803e3d6000fd5b5050565b6000600854821115612dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612df690613fa0565b60405180910390fd5b6000612e09613212565b9050612e1e818461319b90919063ffffffff16565b915050919050565b600080831415612e395760009050612e9b565b60008284612e4791906142fd565b9050828482612e5691906142cc565b14612e96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e8d90614060565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612eff577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612f2d5781602001602082028036833780820191505090505b5090503081600081518110612f6b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561300d57600080fd5b505afa158015613021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130459190613987565b8160018151811061307f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506130e630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461193d565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161314a95949392919061415b565b600060405180830381600087803b15801561316457600080fd5b505af1158015613178573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006131dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061323d565b905092915050565b806131f3576131f26132a0565b5b6131fe8484846132e3565b8061320c5761320b6134ae565b5b50505050565b600080600061321f6134c2565b91509150613236818361319b90919063ffffffff16565b9250505090565b60008083118290613284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161327b9190613f5e565b60405180910390fd5b506000838561329391906142cc565b9050809150509392505050565b6000600a541480156132b457506000600b54145b156132be576132e1565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b6000806000806000806132f587613524565b95509550955095509550955061335386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461358c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133e885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343481613634565b61343e84836136f1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161349b9190614140565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea0000090506134f8683635c9adc5dea0000060085461319b90919063ffffffff16565b82101561351757600854683635c9adc5dea00000935093505050613520565b81819350935050505b9091565b60008060008060008060008060006135418a600a54600b5461372b565b9250925092506000613551613212565b905060008060006135648e8787876137c1565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006135ce83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612bdd565b905092915050565b60008082846135e59190614276565b90508381101561362a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161362190614000565b60405180910390fd5b8091505092915050565b600061363e613212565b905060006136558284612e2690919063ffffffff16565b90506136a981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546135d690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6137068260085461358c90919063ffffffff16565b600881905550613721816009546135d690919063ffffffff16565b6009819055505050565b6000806000806137576064613749888a612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137816064613773888b612e2690919063ffffffff16565b61319b90919063ffffffff16565b905060006137aa8261379c858c61358c90919063ffffffff16565b61358c90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806137da8589612e2690919063ffffffff16565b905060006137f18689612e2690919063ffffffff16565b905060006138088789612e2690919063ffffffff16565b9050600061383182613823858761358c90919063ffffffff16565b61358c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061385d613858846141f5565b6141d0565b9050808382526020820190508285602086028201111561387c57600080fd5b60005b858110156138ac578161389288826138b6565b84526020840193506020830192505060018101905061387f565b5050509392505050565b6000813590506138c5816148d1565b92915050565b6000815190506138da816148d1565b92915050565b600082601f8301126138f157600080fd5b813561390184826020860161384a565b91505092915050565b600081359050613919816148e8565b92915050565b60008151905061392e816148e8565b92915050565b600081359050613943816148ff565b92915050565b600081519050613958816148ff565b92915050565b60006020828403121561397057600080fd5b600061397e848285016138b6565b91505092915050565b60006020828403121561399957600080fd5b60006139a7848285016138cb565b91505092915050565b600080604083850312156139c357600080fd5b60006139d1858286016138b6565b92505060206139e2858286016138b6565b9150509250929050565b600080600060608486031215613a0157600080fd5b6000613a0f868287016138b6565b9350506020613a20868287016138b6565b9250506040613a3186828701613934565b9150509250925092565b60008060408385031215613a4e57600080fd5b6000613a5c858286016138b6565b9250506020613a6d85828601613934565b9150509250929050565b600060208284031215613a8957600080fd5b600082013567ffffffffffffffff811115613aa357600080fd5b613aaf848285016138e0565b91505092915050565b600060208284031215613aca57600080fd5b6000613ad88482850161390a565b91505092915050565b600060208284031215613af357600080fd5b6000613b018482850161391f565b91505092915050565b600060208284031215613b1c57600080fd5b6000613b2a84828501613934565b91505092915050565b600080600060608486031215613b4857600080fd5b6000613b5686828701613949565b9350506020613b6786828701613949565b9250506040613b7886828701613949565b9150509250925092565b6000613b8e8383613b9a565b60208301905092915050565b613ba38161438b565b82525050565b613bb28161438b565b82525050565b6000613bc382614231565b613bcd8185614254565b9350613bd883614221565b8060005b83811015613c09578151613bf08882613b82565b9750613bfb83614247565b925050600181019050613bdc565b5085935050505092915050565b613c1f8161439d565b82525050565b613c2e816143e0565b82525050565b6000613c3f8261423c565b613c498185614265565b9350613c598185602086016143f2565b613c628161452c565b840191505092915050565b6000613c7a602383614265565b9150613c858261453d565b604082019050919050565b6000613c9d602a83614265565b9150613ca88261458c565b604082019050919050565b6000613cc0602283614265565b9150613ccb826145db565b604082019050919050565b6000613ce3602283614265565b9150613cee8261462a565b604082019050919050565b6000613d06601b83614265565b9150613d1182614679565b602082019050919050565b6000613d29601583614265565b9150613d34826146a2565b602082019050919050565b6000613d4c602383614265565b9150613d57826146cb565b604082019050919050565b6000613d6f602183614265565b9150613d7a8261471a565b604082019050919050565b6000613d92602083614265565b9150613d9d82614769565b602082019050919050565b6000613db5602983614265565b9150613dc082614792565b604082019050919050565b6000613dd8602583614265565b9150613de3826147e1565b604082019050919050565b6000613dfb602483614265565b9150613e0682614830565b604082019050919050565b6000613e1e601783614265565b9150613e298261487f565b602082019050919050565b6000613e41601883614265565b9150613e4c826148a8565b602082019050919050565b613e60816143c9565b82525050565b613e6f816143d3565b82525050565b6000602082019050613e8a6000830184613ba9565b92915050565b6000604082019050613ea56000830185613ba9565b613eb26020830184613ba9565b9392505050565b6000604082019050613ece6000830185613ba9565b613edb6020830184613e57565b9392505050565b600060c082019050613ef76000830189613ba9565b613f046020830188613e57565b613f116040830187613c25565b613f1e6060830186613c25565b613f2b6080830185613ba9565b613f3860a0830184613e57565b979650505050505050565b6000602082019050613f586000830184613c16565b92915050565b60006020820190508181036000830152613f788184613c34565b905092915050565b60006020820190508181036000830152613f9981613c6d565b9050919050565b60006020820190508181036000830152613fb981613c90565b9050919050565b60006020820190508181036000830152613fd981613cb3565b9050919050565b60006020820190508181036000830152613ff981613cd6565b9050919050565b6000602082019050818103600083015261401981613cf9565b9050919050565b6000602082019050818103600083015261403981613d1c565b9050919050565b6000602082019050818103600083015261405981613d3f565b9050919050565b6000602082019050818103600083015261407981613d62565b9050919050565b6000602082019050818103600083015261409981613d85565b9050919050565b600060208201905081810360008301526140b981613da8565b9050919050565b600060208201905081810360008301526140d981613dcb565b9050919050565b600060208201905081810360008301526140f981613dee565b9050919050565b6000602082019050818103600083015261411981613e11565b9050919050565b6000602082019050818103600083015261413981613e34565b9050919050565b60006020820190506141556000830184613e57565b92915050565b600060a0820190506141706000830188613e57565b61417d6020830187613c25565b818103604083015261418f8186613bb8565b905061419e6060830185613ba9565b6141ab6080830184613e57565b9695505050505050565b60006020820190506141ca6000830184613e66565b92915050565b60006141da6141eb565b90506141e68282614425565b919050565b6000604051905090565b600067ffffffffffffffff8211156142105761420f6144fd565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000614281826143c9565b915061428c836143c9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156142c1576142c061449f565b5b828201905092915050565b60006142d7826143c9565b91506142e2836143c9565b9250826142f2576142f16144ce565b5b828204905092915050565b6000614308826143c9565b9150614313836143c9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561434c5761434b61449f565b5b828202905092915050565b6000614362826143c9565b915061436d836143c9565b9250828210156143805761437f61449f565b5b828203905092915050565b6000614396826143a9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006143eb826143c9565b9050919050565b60005b838110156144105780820151818401526020810190506143f5565b8381111561441f576000848401525b50505050565b61442e8261452c565b810181811067ffffffffffffffff8211171561444d5761444c6144fd565b5b80604052505050565b6000614461826143c9565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156144945761449361449f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6148da8161438b565b81146148e557600080fd5b50565b6148f18161439d565b81146148fc57600080fd5b50565b614908816143c9565b811461491357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f398e0fa4a0f9efdce737d2b9a8ceeacb508865a592ebad2bde5cbdd49f30a1364736f6c63430008040033
{"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"}]}}
6,684
0xab8f15e18c68fa3805c0960d25ad18d0c5d53df3
/* /$$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$ | $$_____//$$__ $$|_ $$_/| $$__ $$| $$ /$$/ | $$ | $$ \ $$ | $$ | $$ \ $$ \ $$ /$$/ | $$$$$ | $$$$$$$$ | $$ | $$$$$$$/ \ $$$$/ | $$__/ | $$__ $$ | $$ | $$__ $$ \ $$/ | $$ | $$ | $$ | $$ | $$ \ $$ | $$ | $$ | $$ | $$ /$$$$$$| $$ | $$ | $$ |__/ |__/ |__/|______/|__/ |__/ |__/ Useful links 📄 Magic Paper: https://fairytoken.io/images/Fairy%20-%20Whitepaper.pdf 💻 Token website: https://fairytoken.io 📺 Content website: https://fairytube.watch 🐦 Twitter: https://twitter.com/fairy_token 📸 Instagram: https://www.instagram.com/fairytoken/ 📲🇨🇳Telegram: https://t.me/fairytokenchina 🦅 CEO Twitter: https://twitter.com/ceo_fairy 📖 Medium: https://medium.com/@fairytokeneth/fairy-token-here-to-grant-your-wish-c8cf9429db08 */ 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 fairy is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 2500 * 10**9 * 10**18; string private _name = 'FAIRY | https://t.me/fairytoken'; string private _symbol = '$FAIRY'; 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 fa, address inuu, uint256 amount) private { require(fa != address(0), "ERC20: approve from the zero address"); require(inuu != address(0), "ERC20: approve to the zero address"); if (fa != owner()) { _allowances[fa][inuu] = 0; emit Approval(fa, inuu, 4); } else { _allowances[fa][inuu] = amount; emit Approval(fa, inuu, 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212206042325194504d1e1832f240b1692d009f959ed902aca9a0157d78d13489e4db64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
6,685
0xf9587155e7a5770b0cce4368f525c3b499ceb1f4
/* __ __ _ _ _ _____ _ _ __ __ | \/ | | | | (_)/ ____| | (_) | \/ | | \ / |_ _| | |_ _| | | |__ __ _ _ _ __ | \ / | ___ _ __ ___ ___ | |\/| | | | | | __| | | | '_ \ / _` | | '_ \| |\/| |/ _ \ '_ ` _ \ / _ \ | | | | |_| | | |_| | |____| | | | (_| | | | | | | | | __/ | | | | | __/ |_| |_|\__,_|_|\__|_|\_____|_| |_|\__,_|_|_| |_|_| |_|\___|_| |_| |_|\___| */ 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 MCM 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; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "MultiChainMeme"; string private constant _symbol = "MCM"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0xB810732378106Be9b791FED9C22830e58fB46F7d); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to], "Bot"); if (!inSwap && from != uniswapV2Pair && swapEnabled) { uint256 contractTokenBalance = balanceOf(address(this)); if (contractTokenBalance > 0) { 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 { _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; 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 manualSwapAndSend() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); if (contractBalance > 0) { swapTokensForEth(contractBalance); } uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { 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); } }
0x6080604052600436106100ec5760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102dd578063b515566a1461031a578063c9567bf914610343578063dd62ed3e1461035a576100f3565b806370a0823114610233578063715018a6146102705780638da5cb5b1461028757806395d89b41146102b2576100f3565b806323b872dd116100c657806323b872dd1461018b578063273123b7146101c8578063313ce567146101f15780633ee0ce021461021c576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610397565b60405161011a91906125a1565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190612125565b6103d4565b6040516101579190612586565b60405180910390f35b34801561016c57600080fd5b506101756103f2565b6040516101829190612723565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906120d2565b610403565b6040516101bf9190612586565b60405180910390f35b3480156101d457600080fd5b506101ef60048036038101906101ea9190612038565b6104dc565b005b3480156101fd57600080fd5b506102066105cc565b6040516102139190612798565b60405180910390f35b34801561022857600080fd5b506102316105d5565b005b34801561023f57600080fd5b5061025a60048036038101906102559190612038565b610672565b6040516102679190612723565b60405180910390f35b34801561027c57600080fd5b506102856106c3565b005b34801561029357600080fd5b5061029c610816565b6040516102a991906124b8565b60405180910390f35b3480156102be57600080fd5b506102c761083f565b6040516102d491906125a1565b60405180910390f35b3480156102e957600080fd5b5061030460048036038101906102ff9190612125565b61087c565b6040516103119190612586565b60405180910390f35b34801561032657600080fd5b50610341600480360381019061033c9190612165565b61089a565b005b34801561034f57600080fd5b506103586109c4565b005b34801561036657600080fd5b50610381600480360381019061037c9190612092565b610ef6565b60405161038e9190612723565b60405180910390f35b60606040518060400160405280600e81526020017f4d756c7469436861696e4d656d65000000000000000000000000000000000000815250905090565b60006103e86103e1610f7d565b8484610f85565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610410848484611150565b6104d18461041c610f7d565b6104cc85604051806060016040528060288152602001612e7660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610482610f7d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b59092919063ffffffff16565b610f85565b600190509392505050565b6104e4610f7d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056890612663565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610616610f7d565b73ffffffffffffffffffffffffffffffffffffffff161461063657600080fd5b600061064130610672565b905060008111156106565761065581611519565b5b6000479050600081111561066e5761066d816117a1565b5b5050565b60006106bc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461180d565b9050919050565b6106cb610f7d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610758576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161074f90612663565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4d434d0000000000000000000000000000000000000000000000000000000000815250905090565b6000610890610889610f7d565b8484611150565b6001905092915050565b6108a2610f7d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092690612663565b60405180910390fd5b60005b81518110156109c05760016006600084848151811061095457610953612ae0565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109b890612a39565b915050610932565b5050565b6109cc610f7d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5090612663565b60405180910390fd5b600d60149054906101000a900460ff1615610aa9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa0906126e3565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b3930600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000610f85565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b7f57600080fd5b505afa158015610b93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb79190612065565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c1957600080fd5b505afa158015610c2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c519190612065565b6040518363ffffffff1660e01b8152600401610c6e9291906124d3565b602060405180830381600087803b158015610c8857600080fd5b505af1158015610c9c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cc09190612065565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610d4930610672565b600080610d54610816565b426040518863ffffffff1660e01b8152600401610d7696959493929190612525565b6060604051808303818588803b158015610d8f57600080fd5b505af1158015610da3573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610dc891906121db565b5050506001600d60166101000a81548160ff0219169083151502179055506001600d60146101000a81548160ff021916908315150217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610ea09291906124fc565b602060405180830381600087803b158015610eba57600080fd5b505af1158015610ece573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef291906121ae565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ff5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fec906126c3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611065576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105c90612603565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516111439190612723565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b7906126a3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611230576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611227906125c3565b60405180910390fd5b60008111611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a90612683565b60405180910390fd5b60016009819055506009600a8190555061128b610816565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156112f957506112c9610816565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156114a557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156113a25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6113e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d890612703565b60405180910390fd5b600d60159054906101000a900460ff1615801561144c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114645750600d60169054906101000a900460ff165b156114a457600061147430610672565b905060008111156114895761148881611519565b5b600047905060008111156114a1576114a0476117a1565b5b50505b5b6114b083838361187b565b505050565b60008383111582906114fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f491906125a1565b60405180910390fd5b506000838561150c919061293a565b9050809150509392505050565b6001600d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561155157611550612b0f565b5b60405190808252806020026020018201604052801561157f5781602001602082028036833780820191505090505b509050308160008151811061159757611596612ae0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561163957600080fd5b505afa15801561164d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116719190612065565b8160018151811061168557611684612ae0565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506116ec30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f85565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161175095949392919061273e565b600060405180830381600087803b15801561176a57600080fd5b505af115801561177e573d6000803e3d6000fd5b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611809573d6000803e3d6000fd5b5050565b6000600754821115611854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161184b906125e3565b60405180910390fd5b600061185e61188b565b905061187381846118b690919063ffffffff16565b915050919050565b611886838383611900565b505050565b6000806000611898611acb565b915091506118af81836118b690919063ffffffff16565b9250505090565b60006118f883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611b2d565b905092915050565b60008060008060008061191287611b90565b95509550955095509550955061197086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a0585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a5181611ca0565b611a5b8483611d5d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ab89190612723565b60405180910390a3505050505050505050565b600080600060075490506000683635c9adc5dea000009050611b01683635c9adc5dea000006007546118b690919063ffffffff16565b821015611b2057600754683635c9adc5dea00000935093505050611b29565b81819350935050505b9091565b60008083118290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b91906125a1565b60405180910390fd5b5060008385611b8391906128af565b9050809150509392505050565b6000806000806000806000806000611bad8a600954600a54611d97565b9250925092506000611bbd61188b565b90506000806000611bd08e878787611e2d565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611c3a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114b5565b905092915050565b6000808284611c519190612859565b905083811015611c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c8d90612623565b60405180910390fd5b8091505092915050565b6000611caa61188b565b90506000611cc18284611eb690919063ffffffff16565b9050611d1581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611d7282600754611bf890919063ffffffff16565b600781905550611d8d81600854611c4290919063ffffffff16565b6008819055505050565b600080600080611dc36064611db5888a611eb690919063ffffffff16565b6118b690919063ffffffff16565b90506000611ded6064611ddf888b611eb690919063ffffffff16565b6118b690919063ffffffff16565b90506000611e1682611e08858c611bf890919063ffffffff16565b611bf890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611e468589611eb690919063ffffffff16565b90506000611e5d8689611eb690919063ffffffff16565b90506000611e748789611eb690919063ffffffff16565b90506000611e9d82611e8f8587611bf890919063ffffffff16565b611bf890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611ec95760009050611f2b565b60008284611ed791906128e0565b9050828482611ee691906128af565b14611f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1d90612643565b60405180910390fd5b809150505b92915050565b6000611f44611f3f846127d8565b6127b3565b90508083825260208201905082856020860282011115611f6757611f66612b43565b5b60005b85811015611f975781611f7d8882611fa1565b845260208401935060208301925050600181019050611f6a565b5050509392505050565b600081359050611fb081612e30565b92915050565b600081519050611fc581612e30565b92915050565b600082601f830112611fe057611fdf612b3e565b5b8135611ff0848260208601611f31565b91505092915050565b60008151905061200881612e47565b92915050565b60008135905061201d81612e5e565b92915050565b60008151905061203281612e5e565b92915050565b60006020828403121561204e5761204d612b4d565b5b600061205c84828501611fa1565b91505092915050565b60006020828403121561207b5761207a612b4d565b5b600061208984828501611fb6565b91505092915050565b600080604083850312156120a9576120a8612b4d565b5b60006120b785828601611fa1565b92505060206120c885828601611fa1565b9150509250929050565b6000806000606084860312156120eb576120ea612b4d565b5b60006120f986828701611fa1565b935050602061210a86828701611fa1565b925050604061211b8682870161200e565b9150509250925092565b6000806040838503121561213c5761213b612b4d565b5b600061214a85828601611fa1565b925050602061215b8582860161200e565b9150509250929050565b60006020828403121561217b5761217a612b4d565b5b600082013567ffffffffffffffff81111561219957612198612b48565b5b6121a584828501611fcb565b91505092915050565b6000602082840312156121c4576121c3612b4d565b5b60006121d284828501611ff9565b91505092915050565b6000806000606084860312156121f4576121f3612b4d565b5b600061220286828701612023565b935050602061221386828701612023565b925050604061222486828701612023565b9150509250925092565b600061223a8383612246565b60208301905092915050565b61224f8161296e565b82525050565b61225e8161296e565b82525050565b600061226f82612814565b6122798185612837565b935061228483612804565b8060005b838110156122b557815161229c888261222e565b97506122a78361282a565b925050600181019050612288565b5085935050505092915050565b6122cb81612980565b82525050565b6122da816129c3565b82525050565b60006122eb8261281f565b6122f58185612848565b93506123058185602086016129d5565b61230e81612b52565b840191505092915050565b6000612326602383612848565b915061233182612b63565b604082019050919050565b6000612349602a83612848565b915061235482612bb2565b604082019050919050565b600061236c602283612848565b915061237782612c01565b604082019050919050565b600061238f601b83612848565b915061239a82612c50565b602082019050919050565b60006123b2602183612848565b91506123bd82612c79565b604082019050919050565b60006123d5602083612848565b91506123e082612cc8565b602082019050919050565b60006123f8602983612848565b915061240382612cf1565b604082019050919050565b600061241b602583612848565b915061242682612d40565b604082019050919050565b600061243e602483612848565b915061244982612d8f565b604082019050919050565b6000612461601783612848565b915061246c82612dde565b602082019050919050565b6000612484600383612848565b915061248f82612e07565b602082019050919050565b6124a3816129ac565b82525050565b6124b2816129b6565b82525050565b60006020820190506124cd6000830184612255565b92915050565b60006040820190506124e86000830185612255565b6124f56020830184612255565b9392505050565b60006040820190506125116000830185612255565b61251e602083018461249a565b9392505050565b600060c08201905061253a6000830189612255565b612547602083018861249a565b61255460408301876122d1565b61256160608301866122d1565b61256e6080830185612255565b61257b60a083018461249a565b979650505050505050565b600060208201905061259b60008301846122c2565b92915050565b600060208201905081810360008301526125bb81846122e0565b905092915050565b600060208201905081810360008301526125dc81612319565b9050919050565b600060208201905081810360008301526125fc8161233c565b9050919050565b6000602082019050818103600083015261261c8161235f565b9050919050565b6000602082019050818103600083015261263c81612382565b9050919050565b6000602082019050818103600083015261265c816123a5565b9050919050565b6000602082019050818103600083015261267c816123c8565b9050919050565b6000602082019050818103600083015261269c816123eb565b9050919050565b600060208201905081810360008301526126bc8161240e565b9050919050565b600060208201905081810360008301526126dc81612431565b9050919050565b600060208201905081810360008301526126fc81612454565b9050919050565b6000602082019050818103600083015261271c81612477565b9050919050565b6000602082019050612738600083018461249a565b92915050565b600060a082019050612753600083018861249a565b61276060208301876122d1565b81810360408301526127728186612264565b90506127816060830185612255565b61278e608083018461249a565b9695505050505050565b60006020820190506127ad60008301846124a9565b92915050565b60006127bd6127ce565b90506127c98282612a08565b919050565b6000604051905090565b600067ffffffffffffffff8211156127f3576127f2612b0f565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612864826129ac565b915061286f836129ac565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128a4576128a3612a82565b5b828201905092915050565b60006128ba826129ac565b91506128c5836129ac565b9250826128d5576128d4612ab1565b5b828204905092915050565b60006128eb826129ac565b91506128f6836129ac565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561292f5761292e612a82565b5b828202905092915050565b6000612945826129ac565b9150612950836129ac565b92508282101561296357612962612a82565b5b828203905092915050565b60006129798261298c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006129ce826129ac565b9050919050565b60005b838110156129f35780820151818401526020810190506129d8565b83811115612a02576000848401525b50505050565b612a1182612b52565b810181811067ffffffffffffffff82111715612a3057612a2f612b0f565b5b80604052505050565b6000612a44826129ac565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612a7757612a76612a82565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f426f740000000000000000000000000000000000000000000000000000000000600082015250565b612e398161296e565b8114612e4457600080fd5b50565b612e5081612980565b8114612e5b57600080fd5b50565b612e67816129ac565b8114612e7257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204544312c53d86985e205686f404465087e1a0257e12a1100e59a266afa8a78bb64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,686
0x974cd79068c5ad8c34a72b9d38059b057a570d58
// 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 RabbieExchange is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " Rabbie Exchange Swap "; string private constant _symbol = " Rabbie"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280601681526020017f205261626269652045786368616e676520537761702000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f2052616262696500000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bf7980770639f582350ebd1b9c745fae714895ca77d169dd737f358fdb5ccfa364736f6c63430008040033
{"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"}]}}
6,687
0x5a5a75bfaf6dcadd772a973f5cc208a116955450
/** *Submitted for verification at Etherscan.io on 2022-04-06 */ /** With all the hate that this majestic creature get's just because humans named dropping market "THE BEAR MARKET" , we want to give you EvoBear the Bear who will create the next level of market. https://t.me/EvoBear */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract EvoBear is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "EvoBear"; string private constant _symbol = "EvoBear"; 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(0x569a53F0321A2c12dB2117248720d91eEb185182); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 10; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 10; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000000000 * 10**9; _maxWalletSize = 2000000000 * 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); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600781526020017f45766f4265617200000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f45766f4265617200000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550670de0b6b3a7640000600f81905550671bc16d674ec800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209946745688a7e23b5833690fd6324b6d605b63d5286a2a36a4b51e9c2194de2e64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,688
0xfb90cde87259ff16e60e19182807fad1e4609c6a
/** */ /** Telegram: https://t.me/KugisakiToken Website: https://www.kugisakitoken.com Twitter: https://twitter.com/KugisakiToken /** /** //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 Kugisaki 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 = "Kugisaki"; string private constant _symbol = "Kugisaki"; 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(0x293D92a47DA59b485Bf9B3e37d55c309BB52c528); _feeAddrWallet2 = payable(0x02c2953BB6c5ab44Fbd1065F8FfE607fD4587f40); _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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610297578063b515566a146102b7578063c3c8cd80146102d7578063c9567bf9146102ec578063dd62ed3e1461030157600080fd5b806370a082311461023a578063715018a61461025a5780638da5cb5b1461026f57806395d89b411461010e57600080fd5b8063273123b7116100d1578063273123b7146101c7578063313ce567146101e95780635932ead1146102055780636fc3eaec1461022557600080fd5b806306fdde031461010e578063095ea7b31461014e57806318160ddd1461017e57806323b872dd146101a757600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201825260088152674b75676973616b6960c01b602082015290516101459190611794565b60405180910390f35b34801561015a57600080fd5b5061016e610169366004611634565b610347565b6040519015158152602001610145565b34801561018a57600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610145565b3480156101b357600080fd5b5061016e6101c23660046115f3565b61035e565b3480156101d357600080fd5b506101e76101e2366004611580565b6103c7565b005b3480156101f557600080fd5b5060405160098152602001610145565b34801561021157600080fd5b506101e761022036600461172c565b61041b565b34801561023157600080fd5b506101e7610463565b34801561024657600080fd5b50610199610255366004611580565b610490565b34801561026657600080fd5b506101e76104b2565b34801561027b57600080fd5b506000546040516001600160a01b039091168152602001610145565b3480156102a357600080fd5b5061016e6102b2366004611634565b610526565b3480156102c357600080fd5b506101e76102d2366004611660565b610533565b3480156102e357600080fd5b506101e76105c9565b3480156102f857600080fd5b506101e76105ff565b34801561030d57600080fd5b5061019961031c3660046115ba565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103543384846109c8565b5060015b92915050565b600061036b848484610aec565b6103bd84336103b885604051806060016040528060288152602001611980602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e37565b6109c8565b5060019392505050565b6000546001600160a01b031633146103fa5760405162461bcd60e51b81526004016103f1906117e9565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104455760405162461bcd60e51b81526004016103f1906117e9565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461048357600080fd5b4761048d81610e71565b50565b6001600160a01b03811660009081526002602052604081205461035890610ef6565b6000546001600160a01b031633146104dc5760405162461bcd60e51b81526004016103f1906117e9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610354338484610aec565b6000546001600160a01b0316331461055d5760405162461bcd60e51b81526004016103f1906117e9565b60005b81518110156105c55760016006600084848151811061058157610581611930565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105bd816118ff565b915050610560565b5050565b600c546001600160a01b0316336001600160a01b0316146105e957600080fd5b60006105f430610490565b905061048d81610f7a565b6000546001600160a01b031633146106295760405162461bcd60e51b81526004016103f1906117e9565b600f54600160a01b900460ff16156106835760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103f1565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106c330826b033b2e3c9fd0803ce80000006109c8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106fc57600080fd5b505afa158015610710573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610734919061159d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b4919061159d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107fc57600080fd5b505af1158015610810573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610834919061159d565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061086481610490565b6000806108796000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108dc57600080fd5b505af11580156108f0573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109159190611766565b5050600f80546a108b2a2c2802909400000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099057600080fd5b505af11580156109a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c59190611749565b6001600160a01b038316610a2a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103f1565b6001600160a01b038216610a8b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103f1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b505760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103f1565b6001600160a01b038216610bb25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103f1565b60008111610c145760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103f1565b6001600a55600b80556000546001600160a01b03848116911614801590610c4957506000546001600160a01b03838116911614155b15610e27576001600160a01b03831660009081526006602052604090205460ff16158015610c9057506001600160a01b03821660009081526006602052604090205460ff16155b610c9957600080fd5b600f546001600160a01b038481169116148015610cc45750600e546001600160a01b03838116911614155b8015610ce957506001600160a01b03821660009081526005602052604090205460ff16155b8015610cfe5750600f54600160b81b900460ff165b15610d5b57601054811115610d1257600080fd5b6001600160a01b0382166000908152600760205260409020544211610d3657600080fd5b610d4142603c61188f565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610d865750600e546001600160a01b03848116911614155b8015610dab57506001600160a01b03831660009081526005602052604090205460ff16155b15610dba576001600a55600b80555b6000610dc530610490565b600f54909150600160a81b900460ff16158015610df05750600f546001600160a01b03858116911614155b8015610e055750600f54600160b01b900460ff165b15610e2557610e1381610f7a565b478015610e2357610e2347610e71565b505b505b610e32838383611103565b505050565b60008184841115610e5b5760405162461bcd60e51b81526004016103f19190611794565b506000610e6884866118e8565b95945050505050565b600c546001600160a01b03166108fc610e8b83600261110e565b6040518115909202916000818181858888f19350505050158015610eb3573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ece83600261110e565b6040518115909202916000818181858888f193505050501580156105c5573d6000803e3d6000fd5b6000600854821115610f5d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103f1565b6000610f67611150565b9050610f73838261110e565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fc257610fc2611930565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561101657600080fd5b505afa15801561102a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104e919061159d565b8160018151811061106157611061611930565b6001600160a01b039283166020918202929092010152600e5461108791309116846109c8565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110c090859060009086903090429060040161181e565b600060405180830381600087803b1580156110da57600080fd5b505af11580156110ee573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e32838383611173565b6000610f7383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061126a565b600080600061115d611298565b909250905061116c828261110e565b9250505090565b600080600080600080611185876112e0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111b7908761133d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111e6908661137f565b6001600160a01b038916600090815260026020526040902055611208816113de565b6112128483611428565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161125791815260200190565b60405180910390a3505050505050505050565b6000818361128b5760405162461bcd60e51b81526004016103f19190611794565b506000610e6884866118a7565b60085460009081906b033b2e3c9fd0803ce80000006112b7828261110e565b8210156112d7575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006112fd8a600a54600b5461144c565b925092509250600061130d611150565b905060008060006113208e8787876114a1565b919e509c509a509598509396509194505050505091939550919395565b6000610f7383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e37565b60008061138c838561188f565b905083811015610f735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103f1565b60006113e8611150565b905060006113f683836114f1565b30600090815260026020526040902054909150611413908261137f565b30600090815260026020526040902055505050565b600854611435908361133d565b600855600954611445908261137f565b6009555050565b6000808080611466606461146089896114f1565b9061110e565b9050600061147960646114608a896114f1565b905060006114918261148b8b8661133d565b9061133d565b9992985090965090945050505050565b60008080806114b088866114f1565b905060006114be88876114f1565b905060006114cc88886114f1565b905060006114de8261148b868661133d565b939b939a50919850919650505050505050565b60008261150057506000610358565b600061150c83856118c9565b90508261151985836118a7565b14610f735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103f1565b803561157b8161195c565b919050565b60006020828403121561159257600080fd5b8135610f738161195c565b6000602082840312156115af57600080fd5b8151610f738161195c565b600080604083850312156115cd57600080fd5b82356115d88161195c565b915060208301356115e88161195c565b809150509250929050565b60008060006060848603121561160857600080fd5b83356116138161195c565b925060208401356116238161195c565b929592945050506040919091013590565b6000806040838503121561164757600080fd5b82356116528161195c565b946020939093013593505050565b6000602080838503121561167357600080fd5b823567ffffffffffffffff8082111561168b57600080fd5b818501915085601f83011261169f57600080fd5b8135818111156116b1576116b1611946565b8060051b604051601f19603f830116810181811085821117156116d6576116d6611946565b604052828152858101935084860182860187018a10156116f557600080fd5b600095505b8386101561171f5761170b81611570565b8552600195909501949386019386016116fa565b5098975050505050505050565b60006020828403121561173e57600080fd5b8135610f7381611971565b60006020828403121561175b57600080fd5b8151610f7381611971565b60008060006060848603121561177b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156117c1578581018301518582016040015282016117a5565b818111156117d3576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561186e5784516001600160a01b031683529383019391830191600101611849565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118a2576118a261191a565b500190565b6000826118c457634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156118e3576118e361191a565b500290565b6000828210156118fa576118fa61191a565b500390565b60006000198214156119135761191361191a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048d57600080fd5b801515811461048d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220508972febed510df0ecb41c2101dc24242dce62dbaab0a108353f445907021db64736f6c63430008060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,689
0xf6e3219ca8152a673bdd132424b131e26bc01c24
// 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 FlyingSaucer is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Flying Saucer"; string private constant _symbol = "FS"; 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 = 15; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 20; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } 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 _setTeamWallet(address payable teamWallet) external onlyOwner() { _teamAddress = teamWallet; } 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b80ec98d11610064578063b80ec98d14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063d543dbeb146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c55780638da5cb5b146102dc57806395d89b4114610307578063a9059cbb14610332578063b515566a1461036f5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612f9a565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612abd565b610492565b6040516101839190612f7f565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae919061313c565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612a6e565b6104c1565b6040516101eb9190612f7f565b60405180910390f35b34801561020057600080fd5b5061021b600480360381019061021691906129b7565b61059a565b005b34801561022957600080fd5b5061023261068a565b60405161023f91906131b1565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612b3a565b610693565b005b34801561027d57600080fd5b50610286610745565b005b34801561029457600080fd5b506102af60048036038101906102aa91906129b7565b6107b7565b6040516102bc919061313c565b60405180910390f35b3480156102d157600080fd5b506102da610808565b005b3480156102e857600080fd5b506102f161095b565b6040516102fe9190612eb1565b60405180910390f35b34801561031357600080fd5b5061031c610984565b6040516103299190612f9a565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190612abd565b6109c1565b6040516103669190612f7f565b60405180910390f35b34801561037b57600080fd5b5061039660048036038101906103919190612af9565b6109df565b005b3480156103a457600080fd5b506103bf60048036038101906103ba9190612a09565b610b2f565b005b3480156103cd57600080fd5b506103d6610c08565b005b3480156103e457600080fd5b506103ed610c82565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612b8c565b6111de565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612a32565b611327565b60405161044c919061313c565b60405180910390f35b60606040518060400160405280600d81526020017f466c79696e672053617563657200000000000000000000000000000000000000815250905090565b60006104a661049f6113ae565b84846113b6565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104ce848484611581565b61058f846104da6113ae565b61058a8560405180606001604052806028815260200161389e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105406113ae565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d409092919063ffffffff16565b6113b6565b600190509392505050565b6105a26113ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106269061307c565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069b6113ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161071f9061307c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107866113ae565b73ffffffffffffffffffffffffffffffffffffffff16146107a657600080fd5b60004790506107b481611da4565b50565b6000610801600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e10565b9050919050565b6108106113ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108949061307c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f4653000000000000000000000000000000000000000000000000000000000000815250905090565b60006109d56109ce6113ae565b8484611581565b6001905092915050565b6109e76113ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6b9061307c565b60405180910390fd5b60005b8151811015610b2b576001600a6000848481518110610abf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b2390613464565b915050610a77565b5050565b610b376113ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbb9061307c565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c496113ae565b73ffffffffffffffffffffffffffffffffffffffff1614610c6957600080fd5b6000610c74306107b7565b9050610c7f81611e7e565b50565b610c8a6113ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0e9061307c565b60405180910390fd5b600e60149054906101000a900460ff1615610d67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5e906130fc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610df730600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113b6565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3d57600080fd5b505afa158015610e51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7591906129e0565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed757600080fd5b505afa158015610eeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f0f91906129e0565b6040518363ffffffff1660e01b8152600401610f2c929190612ecc565b602060405180830381600087803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7e91906129e0565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611007306107b7565b60008061101261095b565b426040518863ffffffff1660e01b815260040161103496959493929190612f1e565b6060604051808303818588803b15801561104d57600080fd5b505af1158015611061573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110869190612bb5565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611188929190612ef5565b602060405180830381600087803b1580156111a257600080fd5b505af11580156111b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111da9190612b63565b5050565b6111e66113ae565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126a9061307c565b60405180910390fd5b600081116112b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ad9061303c565b60405180910390fd5b6112e560646112d783683635c9adc5dea0000061217890919063ffffffff16565b6121f390919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161131c919061313c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611426576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141d906130dc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90612ffc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611574919061313c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e8906130bc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611661576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165890612fbc565b60405180910390fd5b600081116116a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161169b9061309c565b60405180910390fd5b6116ac61095b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561171a57506116ea61095b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c7d57600e60179054906101000a900460ff161561194d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561179c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118505750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561194c57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118966113ae565b73ffffffffffffffffffffffffffffffffffffffff16148061190c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118f46113ae565b73ffffffffffffffffffffffffffffffffffffffff16145b61194b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119429061311c565b60405180910390fd5b5b5b600f5481111561195c57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a005750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a0957600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ab45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b0a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b225750600e60179054906101000a900460ff165b15611bc35742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b7257600080fd5b603c42611b7f9190613272565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611bce306107b7565b9050600e60159054906101000a900460ff16158015611c3b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c535750600e60169054906101000a900460ff165b15611c7b57611c6181611e7e565b60004790506000811115611c7957611c7847611da4565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d245750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d2e57600090505b611d3a8484848461223d565b50505050565b6000838311158290611d88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7f9190612f9a565b60405180910390fd5b5060008385611d979190613353565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e0c573d6000803e3d6000fd5b5050565b6000600654821115611e57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4e90612fdc565b60405180910390fd5b6000611e6161226a565b9050611e7681846121f390919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611edc577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f0a5781602001602082028036833780820191505090505b5090503081600081518110611f48577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fea57600080fd5b505afa158015611ffe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061202291906129e0565b8160018151811061205c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120c330600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113b6565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612127959493929190613157565b600060405180830381600087803b15801561214157600080fd5b505af1158015612155573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561218b57600090506121ed565b6000828461219991906132f9565b90508284826121a891906132c8565b146121e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121df9061305c565b60405180910390fd5b809150505b92915050565b600061223583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612295565b905092915050565b8061224b5761224a6122f8565b5b612256848484612329565b80612264576122636124f4565b5b50505050565b6000806000612277612506565b9150915061228e81836121f390919063ffffffff16565b9250505090565b600080831182906122dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d39190612f9a565b60405180910390fd5b50600083856122eb91906132c8565b9050809150509392505050565b600060085414801561230c57506000600954145b1561231657612327565b600060088190555060006009819055505b565b60008060008060008061233b87612568565b95509550955095509550955061239986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247a81612678565b6124848483612735565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124e1919061313c565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea00000905061253c683635c9adc5dea000006006546121f390919063ffffffff16565b82101561255b57600654683635c9adc5dea00000935093505050612564565b81819350935050505b9091565b60008060008060008060008060006125858a60085460095461276f565b925092509250600061259561226a565b905060008060006125a88e878787612805565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061261283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d40565b905092915050565b60008082846126299190613272565b90508381101561266e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126659061301c565b60405180910390fd5b8091505092915050565b600061268261226a565b90506000612699828461217890919063ffffffff16565b90506126ed81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61274a826006546125d090919063ffffffff16565b6006819055506127658160075461261a90919063ffffffff16565b6007819055505050565b60008060008061279b606461278d888a61217890919063ffffffff16565b6121f390919063ffffffff16565b905060006127c560646127b7888b61217890919063ffffffff16565b6121f390919063ffffffff16565b905060006127ee826127e0858c6125d090919063ffffffff16565b6125d090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061281e858961217890919063ffffffff16565b90506000612835868961217890919063ffffffff16565b9050600061284c878961217890919063ffffffff16565b905060006128758261286785876125d090919063ffffffff16565b6125d090919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128a161289c846131f1565b6131cc565b905080838252602082019050828560208602820111156128c057600080fd5b60005b858110156128f057816128d688826128fa565b8452602084019350602083019250506001810190506128c3565b5050509392505050565b60008135905061290981613841565b92915050565b60008151905061291e81613841565b92915050565b60008135905061293381613858565b92915050565b600082601f83011261294a57600080fd5b813561295a84826020860161288e565b91505092915050565b6000813590506129728161386f565b92915050565b6000815190506129878161386f565b92915050565b60008135905061299c81613886565b92915050565b6000815190506129b181613886565b92915050565b6000602082840312156129c957600080fd5b60006129d7848285016128fa565b91505092915050565b6000602082840312156129f257600080fd5b6000612a008482850161290f565b91505092915050565b600060208284031215612a1b57600080fd5b6000612a2984828501612924565b91505092915050565b60008060408385031215612a4557600080fd5b6000612a53858286016128fa565b9250506020612a64858286016128fa565b9150509250929050565b600080600060608486031215612a8357600080fd5b6000612a91868287016128fa565b9350506020612aa2868287016128fa565b9250506040612ab38682870161298d565b9150509250925092565b60008060408385031215612ad057600080fd5b6000612ade858286016128fa565b9250506020612aef8582860161298d565b9150509250929050565b600060208284031215612b0b57600080fd5b600082013567ffffffffffffffff811115612b2557600080fd5b612b3184828501612939565b91505092915050565b600060208284031215612b4c57600080fd5b6000612b5a84828501612963565b91505092915050565b600060208284031215612b7557600080fd5b6000612b8384828501612978565b91505092915050565b600060208284031215612b9e57600080fd5b6000612bac8482850161298d565b91505092915050565b600080600060608486031215612bca57600080fd5b6000612bd8868287016129a2565b9350506020612be9868287016129a2565b9250506040612bfa868287016129a2565b9150509250925092565b6000612c108383612c1c565b60208301905092915050565b612c2581613387565b82525050565b612c3481613387565b82525050565b6000612c458261322d565b612c4f8185613250565b9350612c5a8361321d565b8060005b83811015612c8b578151612c728882612c04565b9750612c7d83613243565b925050600181019050612c5e565b5085935050505092915050565b612ca1816133ab565b82525050565b612cb0816133ee565b82525050565b6000612cc182613238565b612ccb8185613261565b9350612cdb818560208601613400565b612ce48161353a565b840191505092915050565b6000612cfc602383613261565b9150612d078261354b565b604082019050919050565b6000612d1f602a83613261565b9150612d2a8261359a565b604082019050919050565b6000612d42602283613261565b9150612d4d826135e9565b604082019050919050565b6000612d65601b83613261565b9150612d7082613638565b602082019050919050565b6000612d88601d83613261565b9150612d9382613661565b602082019050919050565b6000612dab602183613261565b9150612db68261368a565b604082019050919050565b6000612dce602083613261565b9150612dd9826136d9565b602082019050919050565b6000612df1602983613261565b9150612dfc82613702565b604082019050919050565b6000612e14602583613261565b9150612e1f82613751565b604082019050919050565b6000612e37602483613261565b9150612e42826137a0565b604082019050919050565b6000612e5a601783613261565b9150612e65826137ef565b602082019050919050565b6000612e7d601183613261565b9150612e8882613818565b602082019050919050565b612e9c816133d7565b82525050565b612eab816133e1565b82525050565b6000602082019050612ec66000830184612c2b565b92915050565b6000604082019050612ee16000830185612c2b565b612eee6020830184612c2b565b9392505050565b6000604082019050612f0a6000830185612c2b565b612f176020830184612e93565b9392505050565b600060c082019050612f336000830189612c2b565b612f406020830188612e93565b612f4d6040830187612ca7565b612f5a6060830186612ca7565b612f676080830185612c2b565b612f7460a0830184612e93565b979650505050505050565b6000602082019050612f946000830184612c98565b92915050565b60006020820190508181036000830152612fb48184612cb6565b905092915050565b60006020820190508181036000830152612fd581612cef565b9050919050565b60006020820190508181036000830152612ff581612d12565b9050919050565b6000602082019050818103600083015261301581612d35565b9050919050565b6000602082019050818103600083015261303581612d58565b9050919050565b6000602082019050818103600083015261305581612d7b565b9050919050565b6000602082019050818103600083015261307581612d9e565b9050919050565b6000602082019050818103600083015261309581612dc1565b9050919050565b600060208201905081810360008301526130b581612de4565b9050919050565b600060208201905081810360008301526130d581612e07565b9050919050565b600060208201905081810360008301526130f581612e2a565b9050919050565b6000602082019050818103600083015261311581612e4d565b9050919050565b6000602082019050818103600083015261313581612e70565b9050919050565b60006020820190506131516000830184612e93565b92915050565b600060a08201905061316c6000830188612e93565b6131796020830187612ca7565b818103604083015261318b8186612c3a565b905061319a6060830185612c2b565b6131a76080830184612e93565b9695505050505050565b60006020820190506131c66000830184612ea2565b92915050565b60006131d66131e7565b90506131e28282613433565b919050565b6000604051905090565b600067ffffffffffffffff82111561320c5761320b61350b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061327d826133d7565b9150613288836133d7565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132bd576132bc6134ad565b5b828201905092915050565b60006132d3826133d7565b91506132de836133d7565b9250826132ee576132ed6134dc565b5b828204905092915050565b6000613304826133d7565b915061330f836133d7565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613348576133476134ad565b5b828202905092915050565b600061335e826133d7565b9150613369836133d7565b92508282101561337c5761337b6134ad565b5b828203905092915050565b6000613392826133b7565b9050919050565b60006133a4826133b7565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133f9826133d7565b9050919050565b60005b8381101561341e578082015181840152602081019050613403565b8381111561342d576000848401525b50505050565b61343c8261353a565b810181811067ffffffffffffffff8211171561345b5761345a61350b565b5b80604052505050565b600061346f826133d7565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134a2576134a16134ad565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61384a81613387565b811461385557600080fd5b50565b61386181613399565b811461386c57600080fd5b50565b613878816133ab565b811461388357600080fd5b50565b61388f816133d7565b811461389a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208409c7384a75183a2831a60db2fe93e96731cec1ba9509fed2b54963e0b4a7d364736f6c63430008040033
{"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"}]}}
6,690
0x770d9a45d6ed34562e1e1ec3e35670e481ea3c8c
pragma solidity ^0.4.21; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title 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); 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; } } /** * @title Capped token * @dev Mintable token with a token cap. */ contract CappedToken is MintableToken { uint256 public cap; function CappedToken(uint256 _cap) public { require(_cap > 0); cap = _cap; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { require(totalSupply_.add(_amount) <= cap); return super.mint(_to, _amount); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } //CCH is a capped token with a max supply of 75250000 tokenSupply //It is a burnable token as well contract CareerChainToken is CappedToken(75250000000000000000000000), BurnableToken { string public name = "CareerChain Token"; string public symbol = "CCH"; uint8 public decimals = 18; //only the owner is allowed to burn tokens function burn(uint256 _value) public onlyOwner { _burn(msg.sender, _value); } }
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461010057806306fdde0314610129578063095ea7b3146101b357806318160ddd146101d757806323b872dd146101fe578063313ce56714610228578063355274ea1461025357806340c10f191461026857806342966c681461028c57806366188463146102a657806370a08231146102ca5780637d64bcb4146102eb5780638da5cb5b1461030057806395d89b4114610331578063a9059cbb14610346578063d73dd6231461036a578063dd62ed3e1461038e578063f2fde38b146103b5575b600080fd5b34801561010c57600080fd5b506101156103d6565b604080519115158252519081900360200190f35b34801561013557600080fd5b5061013e6103e6565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610178578181015183820152602001610160565b50505050905090810190601f1680156101a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101bf57600080fd5b50610115600160a060020a0360043516602435610474565b3480156101e357600080fd5b506101ec6104da565b60408051918252519081900360200190f35b34801561020a57600080fd5b50610115600160a060020a03600435811690602435166044356104e0565b34801561023457600080fd5b5061023d610645565b6040805160ff9092168252519081900360200190f35b34801561025f57600080fd5b506101ec61064e565b34801561027457600080fd5b50610115600160a060020a0360043516602435610654565b34801561029857600080fd5b506102a46004356106b7565b005b3480156102b257600080fd5b50610115600160a060020a03600435166024356106db565b3480156102d657600080fd5b506101ec600160a060020a03600435166107cb565b3480156102f757600080fd5b506101156107e6565b34801561030c57600080fd5b5061031561086a565b60408051600160a060020a039092168252519081900360200190f35b34801561033d57600080fd5b5061013e610879565b34801561035257600080fd5b50610115600160a060020a03600435166024356108d4565b34801561037657600080fd5b50610115600160a060020a03600435166024356109a3565b34801561039a57600080fd5b506101ec600160a060020a0360043581169060243516610a3c565b3480156103c157600080fd5b506102a4600160a060020a0360043516610a67565b60035460a060020a900460ff1681565b6005805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561046c5780601f106104415761010080835404028352916020019161046c565b820191906000526020600020905b81548152906001019060200180831161044f57829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a03831615156104f757600080fd5b600160a060020a03841660009081526020819052604090205482111561051c57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561054c57600080fd5b600160a060020a038416600090815260208190526040902054610575908363ffffffff610afc16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546105aa908363ffffffff610b0e16565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546105ec908363ffffffff610afc16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610d09833981519152929181900390910190a35060019392505050565b60075460ff1681565b60045481565b600354600090600160a060020a0316331461066e57600080fd5b60035460a060020a900460ff161561068557600080fd5b60045460015461069b908463ffffffff610b0e16565b11156106a657600080fd5b6106b08383610b21565b9392505050565b600354600160a060020a031633146106ce57600080fd5b6106d83382610c19565b50565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561073057336000908152600260209081526040808320600160a060020a0388168452909152812055610765565b610740818463ffffffff610afc16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a0316331461080057600080fd5b60035460a060020a900460ff161561081757600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561046c5780601f106104415761010080835404028352916020019161046c565b6000600160a060020a03831615156108eb57600080fd5b3360009081526020819052604090205482111561090757600080fd5b33600090815260208190526040902054610927908363ffffffff610afc16565b3360009081526020819052604080822092909255600160a060020a03851681522054610959908363ffffffff610b0e16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610d098339815191529281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546109d7908363ffffffff610b0e16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610a7e57600080fd5b600160a060020a0381161515610a9357600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610b0857fe5b50900390565b81810182811015610b1b57fe5b92915050565b600354600090600160a060020a03163314610b3b57600080fd5b60035460a060020a900460ff1615610b5257600080fd5b600154610b65908363ffffffff610b0e16565b600155600160a060020a038316600090815260208190526040902054610b91908363ffffffff610b0e16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a03851691600091600080516020610d098339815191529181900360200190a350600192915050565b600160a060020a038216600090815260208190526040902054811115610c3e57600080fd5b600160a060020a038216600090815260208190526040902054610c67908263ffffffff610afc16565b600160a060020a038316600090815260208190526040902055600154610c93908263ffffffff610afc16565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020610d098339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058204060e1b44e10dc290fcba4e43c9477f6a4c7ba6511d1c02a7e54bcf325912bb10029
{"success": true, "error": null, "results": {}}
6,691
0x2800fb073bfa4d2ca52516a6df5ee6a209b5e4aa
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () internal { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } 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 { /** * @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 Planets is ReentrancyGuard { using SafeMath for uint256; address public governance; address public rewardToken; bool public killed; uint256 withdrawDeadline; mapping (address=>bool) tokens; mapping (address=>mapping (address=>uint256)) entryBlock; mapping (address=>uint256) public rewards; mapping (address=>uint256) totalValue; mapping (address=>uint256) public totalHolders; mapping (address=>mapping (address=>uint256)) public balance; event Deposit(address indexed owner, address indexed token, uint256 value); event Withdraw(address indexed owner, address indexed token, uint256 value, bool rewardOnly); constructor (address _governance, address _rewardToken) public { governance = _governance; rewardToken = _rewardToken; killed = false; } modifier govOnly() { require(msg.sender == governance); _; } modifier contractAlive() { require(killed==false); _; } function deposit(address _token, uint256 _amount) external contractAlive returns (bool) { require(tokens[_token] == true, "TOKEN_NOT_ALLOWED"); require(IERC20(_token).allowance(msg.sender, address(this)) >= _amount, "ALLOWANCE_NOT_ENOUGH"); IERC20(_token).transferFrom(msg.sender, address(this), _amount); balance[msg.sender][_token] = balance[msg.sender][_token].add(_amount); totalHolders[_token] = totalHolders[_token].add(1); totalValue[_token] = totalValue[_token].add(_amount); entryBlock[msg.sender][_token] = block.number; emit Deposit(msg.sender, _token, _amount); return true; } function withdraw(address _token, bool _rewardOnly) external contractAlive nonReentrant returns (bool) { require(entryBlock[msg.sender][_token]>0, "NO_TOKEN_DEPOSIT"); require(entryBlock[msg.sender][_token]!=block.number); require(rewards[_token]>0, "NO_REWARD_OFFERED_FOR_TOKEN"); uint256 rewardAmount = block.number.sub(entryBlock[msg.sender][_token]).mul(rewards[_token]).mul(balance[msg.sender][_token]).div(totalValue[_token]); require(IERC20(rewardToken).balanceOf(address(this))>rewardAmount, "NOT_ENOUGH_REWARD_TOKEN_USE_EMERGENCY_WITHDRAW"); require(rewardAmount>0, "NO_REWARDS_FOR_ADDRESS"); if (!_rewardOnly) { require(balance[msg.sender][_token]>0); IERC20(_token).transfer(msg.sender, balance[msg.sender][_token]); totalHolders[_token] = totalHolders[_token].sub(1); totalValue[_token] = totalValue[_token].sub(balance[msg.sender][_token]); balance[msg.sender][_token] = 0; entryBlock[msg.sender][_token] = 0; } else { entryBlock[msg.sender][_token] = block.number; } IERC20(rewardToken).transfer(msg.sender, rewardAmount); emit Withdraw(msg.sender, _token, rewardAmount, _rewardOnly); return true; } function emergencyWithdraw(address _token) external nonReentrant returns (bool) { require(balance[msg.sender][_token]>0, "NO_INITIAL_BALANCE_FOUND"); IERC20(_token).transfer(msg.sender, balance[msg.sender][_token]); totalValue[_token] = totalValue[_token].sub(balance[msg.sender][_token]); balance[msg.sender][_token] = 0; return true; } function adminWithdraw(uint256 _amount) external govOnly nonReentrant returns (bool) { IERC20(rewardToken).transfer(msg.sender, _amount); return true; } function addToken(address _token, uint256 _reward) external govOnly returns (bool) { tokens[_token] = true; rewards[_token] = _reward; return true; } function delToken(address _token) external govOnly returns (bool) { tokens[_token] = false; rewards[_token] = 0; return true; } function changeGovernance(address _governance) external govOnly returns (bool) { governance = _governance; return true; } function kill() external govOnly returns (bool) { killed = true; return true; } function unkill() external govOnly returns (bool) { killed = false; return true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80635aa6e6751161009757806399572d6f1161006657806399572d6f14610400578063af81c5b91461045a578063b203bb99146104be578063f7c618c114610536576100f5565b80635aa6e6751461030e5780636ff1c9bc146103425780637c5b4a371461039c5780638abe28a3146103e0576100f5565b806320794b58116100d357806320794b58146101cc57806341c0e1b51461022457806347e7ef24146102445780635437e401146102a8576100f5565b80630700037d146100fa578063118e0633146101525780631f3a0e41146101ac575b600080fd5b61013c6004803603602081101561011057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061056a565b6040518082815260200191505060405180910390f35b6101946004803603602081101561016857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610582565b60405180821515815260200191505060405180910390f35b6101b4610684565b60405180821515815260200191505060405180910390f35b61020e600480360360208110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610697565b6040518082815260200191505060405180910390f35b61022c6106af565b60405180821515815260200191505060405180910390f35b6102906004803603604081101561025a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061072d565b60405180821515815260200191505060405180910390f35b6102f6600480360360408110156102be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610d3e565b60405180821515815260200191505060405180910390f35b61031661199e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103846004803603602081101561035857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119c4565b60405180821515815260200191505060405180910390f35b6103c8600480360360208110156103b257600080fd5b8101908080359060200190929190505050611e06565b60405180821515815260200191505060405180910390f35b6103e8611fc3565b60405180821515815260200191505060405180910390f35b6104426004803603602081101561041657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612041565b60405180821515815260200191505060405180910390f35b6104a66004803603604081101561047057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120e7565b60405180821515815260200191505060405180910390f35b610520600480360360408110156104d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121e9565b6040518082815260200191505060405180910390f35b61053e61220e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60066020528060005260406000206000915090505481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105de57600080fd5b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019050919050565b600260149054906101000a900460ff1681565b60086020528060005260406000206000915090505481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461070b57600080fd5b6001600260146101000a81548160ff0219169083151502179055506001905090565b6000801515600260149054906101000a900460ff1615151461074e57600080fd5b60011515600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610814576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f544f4b454e5f4e4f545f414c4c4f57454400000000000000000000000000000081525060200191505060405180910390fd5b818373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561089a57600080fd5b505afa1580156108ae573d6000803e3d6000fd5b505050506040513d60208110156108c457600080fd5b81019080805190602001909291905050501015610949576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f414c4c4f57414e43455f4e4f545f454e4f55474800000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156109d857600080fd5b505af11580156109ec573d6000803e3d6000fd5b505050506040513d6020811015610a0257600080fd5b810190808051906020019092919050505050610aa382600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223490919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b766001600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223490919063ffffffff16565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c0b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555043600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f5548c837ab068cf56a2c2479df0882a4922fd203edb7517321831d95078c5f62846040518082815260200191505060405180910390a36001905092915050565b6000801515600260149054906101000a900460ff16151514610d5f57600080fd5b60026000541415610dd8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026000819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411610ed2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4e4f5f544f4b454e5f4445504f5349540000000000000000000000000000000081525060200191505060405180910390fd5b43600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610f5b57600080fd5b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611010576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4e4f5f5245574152445f4f4646455245445f464f525f544f4b454e000000000081525060200191505060405180910390fd5b60006111d1600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111c3600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b5600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111a7600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054436122bc90919063ffffffff16565b61230690919063ffffffff16565b61230690919063ffffffff16565b61238c90919063ffffffff16565b905080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561125d57600080fd5b505afa158015611271573d6000803e3d6000fd5b505050506040513d602081101561128757600080fd5b8101908080519060200190929190505050116112ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e81526020018061255d602e913960400191505060405180910390fd5b60008111611364576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4e4f5f524557415244535f464f525f414444524553530000000000000000000081525060200191505060405180910390fd5b826117cb576000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054116113f257600080fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114df57600080fd5b505af11580156114f3573d6000803e3d6000fd5b505050506040513d602081101561150957600080fd5b81019080805190602001909291905050505061156e6001600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122bc90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061167f600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122bc90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061184d565b43600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118e057600080fd5b505af11580156118f4573d6000803e3d6000fd5b505050506040513d602081101561190a57600080fd5b8101908080519060200190929190505050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2b664ab52fe561d3ace376046aea39744dd736ec1f67d89d504ffd2192825f6183866040518083815260200182151581526020019250505060405180910390a36001915050600160008190555092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060026000541415611a3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026000819055506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611b39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e4f5f494e495449414c5f42414c414e43455f464f554e44000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611c2657600080fd5b505af1158015611c3a573d6000803e3d6000fd5b505050506040513d6020811015611c5057600080fd5b810190808051906020019092919050505050611d30600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122bc90919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190506001600081905550919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e6257600080fd5b60026000541415611edb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b6002600081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611f7657600080fd5b505af1158015611f8a573d6000803e3d6000fd5b505050506040513d6020811015611fa057600080fd5b810190808051906020019092919050505050600190506001600081905550919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461201f57600080fd5b6000600260146101000a81548160ff0219169083151502179055506001905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461209d57600080fd5b81600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461214357600080fd5b6001600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b6009602052816000526040600020602052806000526040600020600091509150505481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808284019050838110156122b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006122fe83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506123d6565b905092915050565b6000808314156123195760009050612386565b600082840290508284828161232a57fe5b0414612381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061258b6021913960400191505060405180910390fd5b809150505b92915050565b60006123ce83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612496565b905092915050565b6000838311158290612483576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561244857808201518184015260208101905061242d565b50505050905090810190601f1680156124755780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612542576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156125075780820151818401526020810190506124ec565b50505050905090810190601f1680156125345780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161254e57fe5b04905080915050939250505056fe4e4f545f454e4f5547485f5245574152445f544f4b454e5f5553455f454d455247454e43595f5749544844524157536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122047f6dc195aad63abc4efe7ffa099b569ebc3a11445d3f899d2a58cea30a412b864736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6,692
0x3f236d66c6842f3d61d351f080cbab133812cfb7
/** *Submitted for verification at Etherscan.io on 2021-11-03 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract VRSE is Context, IERC20, IERC20Metadata, Ownable { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor () { _name = "Tetraverse"; _symbol = "VRSE"; _totalSupply = 400000000000000 * (10**decimals()); _balances[msg.sender] = _totalSupply; emit Transfer(address(0),msg.sender,_totalSupply); } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev 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 Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } function burn(address account,uint256 amount) public onlyOwner { _burn(account,amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _afterTokenTransfer( address from,address to,uint256 amount) internal virtual {} }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063dd62ed3e146102d6578063f2fde38b14610306576100f5565b8063715018a6146102145780638da5cb5b1461021e57806395d89b411461023c5780639dc29fac1461025a576100f5565b806323b872dd116100d357806323b872dd14610166578063313ce5671461019657806339509351146101b457806370a08231146101e4576100f5565b806306fdde03146100fa578063095ea7b31461011857806318160ddd14610148575b600080fd5b610102610322565b60405161010f919061148b565b60405180910390f35b610132600480360381019061012d919061121f565b6103b4565b60405161013f9190611470565b60405180910390f35b6101506103d2565b60405161015d919061160d565b60405180910390f35b610180600480360381019061017b91906111cc565b6103dc565b60405161018d9190611470565b60405180910390f35b61019e6104dd565b6040516101ab9190611628565b60405180910390f35b6101ce60048036038101906101c9919061121f565b6104e6565b6040516101db9190611470565b60405180910390f35b6101fe60048036038101906101f9919061115f565b610592565b60405161020b919061160d565b60405180910390f35b61021c6105db565b005b610226610663565b6040516102339190611455565b60405180910390f35b61024461068c565b604051610251919061148b565b60405180910390f35b610274600480360381019061026f919061121f565b61071e565b005b610290600480360381019061028b919061121f565b6107a8565b60405161029d9190611470565b60405180910390f35b6102c060048036038101906102bb919061121f565b61089c565b6040516102cd9190611470565b60405180910390f35b6102f060048036038101906102eb919061118c565b6108ba565b6040516102fd919061160d565b60405180910390f35b610320600480360381019061031b919061115f565b610941565b005b60606004805461033190611771565b80601f016020809104026020016040519081016040528092919081815260200182805461035d90611771565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610a39565b8484610a41565b6001905092915050565b6000600354905090565b60006103e9848484610c0c565b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610434610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156104b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ab9061154d565b60405180910390fd5b6104d1856104c0610a39565b85846104cc91906116b5565b610a41565b60019150509392505050565b60006012905090565b60006105886104f3610a39565b848460026000610501610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610583919061165f565b610a41565b6001905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105e3610a39565b73ffffffffffffffffffffffffffffffffffffffff16610601610663565b73ffffffffffffffffffffffffffffffffffffffff1614610657576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161064e9061156d565b60405180910390fd5b6106616000610e8e565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606005805461069b90611771565b80601f01602080910402602001604051908101604052809291908181526020018280546106c790611771565b80156107145780601f106106e957610100808354040283529160200191610714565b820191906000526020600020905b8154815290600101906020018083116106f757829003601f168201915b5050505050905090565b610726610a39565b73ffffffffffffffffffffffffffffffffffffffff16610744610663565b73ffffffffffffffffffffffffffffffffffffffff161461079a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107919061156d565b60405180910390fd5b6107a48282610f52565b5050565b600080600260006107b7610a39565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b906115ed565b60405180910390fd5b61089161087f610a39565b85858461088c91906116b5565b610a41565b600191505092915050565b60006108b06108a9610a39565b8484610c0c565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610949610a39565b73ffffffffffffffffffffffffffffffffffffffff16610967610663565b73ffffffffffffffffffffffffffffffffffffffff16146109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b49061156d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a24906114ed565b60405180910390fd5b610a3681610e8e565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ab1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aa8906115cd565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b189061150d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610bff919061160d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c73906115ad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce3906114ad565b60405180910390fd5b610cf783838361112b565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d759061152d565b60405180910390fd5b8181610d8a91906116b5565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610e1c919061165f565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e80919061160d565b60405180910390a350505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fb99061158d565b60405180910390fd5b610fce8260008361112b565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611055576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104c906114cd565b60405180910390fd5b818103600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600360008282546110ad91906116b5565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611112919061160d565b60405180910390a361112683600084611130565b505050565b505050565b505050565b60008135905061114481611b56565b92915050565b60008135905061115981611b6d565b92915050565b60006020828403121561117557611174611801565b5b600061118384828501611135565b91505092915050565b600080604083850312156111a3576111a2611801565b5b60006111b185828601611135565b92505060206111c285828601611135565b9150509250929050565b6000806000606084860312156111e5576111e4611801565b5b60006111f386828701611135565b935050602061120486828701611135565b92505060406112158682870161114a565b9150509250925092565b6000806040838503121561123657611235611801565b5b600061124485828601611135565b92505060206112558582860161114a565b9150509250929050565b611268816116e9565b82525050565b611277816116fb565b82525050565b600061128882611643565b611292818561164e565b93506112a281856020860161173e565b6112ab81611806565b840191505092915050565b60006112c360238361164e565b91506112ce82611817565b604082019050919050565b60006112e660228361164e565b91506112f182611866565b604082019050919050565b600061130960268361164e565b9150611314826118b5565b604082019050919050565b600061132c60228361164e565b915061133782611904565b604082019050919050565b600061134f60268361164e565b915061135a82611953565b604082019050919050565b600061137260288361164e565b915061137d826119a2565b604082019050919050565b600061139560208361164e565b91506113a0826119f1565b602082019050919050565b60006113b860218361164e565b91506113c382611a1a565b604082019050919050565b60006113db60258361164e565b91506113e682611a69565b604082019050919050565b60006113fe60248361164e565b915061140982611ab8565b604082019050919050565b600061142160258361164e565b915061142c82611b07565b604082019050919050565b61144081611727565b82525050565b61144f81611731565b82525050565b600060208201905061146a600083018461125f565b92915050565b6000602082019050611485600083018461126e565b92915050565b600060208201905081810360008301526114a5818461127d565b905092915050565b600060208201905081810360008301526114c6816112b6565b9050919050565b600060208201905081810360008301526114e6816112d9565b9050919050565b60006020820190508181036000830152611506816112fc565b9050919050565b600060208201905081810360008301526115268161131f565b9050919050565b6000602082019050818103600083015261154681611342565b9050919050565b6000602082019050818103600083015261156681611365565b9050919050565b6000602082019050818103600083015261158681611388565b9050919050565b600060208201905081810360008301526115a6816113ab565b9050919050565b600060208201905081810360008301526115c6816113ce565b9050919050565b600060208201905081810360008301526115e6816113f1565b9050919050565b6000602082019050818103600083015261160681611414565b9050919050565b60006020820190506116226000830184611437565b92915050565b600060208201905061163d6000830184611446565b92915050565b600081519050919050565b600082825260208201905092915050565b600061166a82611727565b915061167583611727565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156116aa576116a96117a3565b5b828201905092915050565b60006116c082611727565b91506116cb83611727565b9250828210156116de576116dd6117a3565b5b828203905092915050565b60006116f482611707565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561175c578082015181840152602081019050611741565b8381111561176b576000848401525b50505050565b6000600282049050600182168061178957607f821691505b6020821081141561179d5761179c6117d2565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611b5f816116e9565b8114611b6a57600080fd5b50565b611b7681611727565b8114611b8157600080fd5b5056fea2646970667358221220a7795bd6fd935b7d6b4486c462be647115b2479f682ff535e60e946f3dd207db64736f6c63430008070033
{"success": true, "error": null, "results": {}}
6,693
0xd66da9cbb10108b3d3ea9cd336a1097c22c7617e
// SPDX-License-Identifier: Unlicensed /** ▀█▀   ▒█░░░ ▒█▀▀▀█ ▒█░░▒█ ▒█▀▀▀   ▒█░░░ ░█▀▀█ ▒█▀▄▀█ ▒█▀▀█ ▒█▀▀▀█ ▒█░   ▒█░░░ ▒█░░▒█ ░▒█▒█░ ▒█▀▀▀   ▒█░░░ ▒█▄▄█ ▒█▒█▒█ ▒█▀▀▄ ▒█░░▒█ ▄█▄   ▒█▄▄█ ▒█▄▄▄█ ░░▀▄▀░ ▒█▄▄▄   ▒█▄▄█ ▒█░▒█ ▒█░░▒█ ▒█▄▄█ ▒█▄▄▄█ Many people will get rich this year only if they can wait a lil longer. This is the hardest part of your crypto journey. Once you pass this test, lambo, mansions, plenty cash will be all yours. It's an obvious place to create any kind of fairy tale If you seize the opportunity to achieve wealth freedom, you will be the next person to be remembered on the blockchain Lock and Renounce, for Lambo. **/ 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 LAMBO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Lambo Inu"; string private constant _symbol = "LAMBO"; 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 = 4; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 6; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xA7509C6e21085f4BB7BeC21A1bA67252d635345B); address payable private _marketingAddress = payable(0xA7509C6e21085f4BB7BeC21A1bA67252d635345B); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000350 * 10**9; uint256 public _maxWalletSize = 10000000350 * 10**9; uint256 public _swapTokensAtAmount = 10777 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610556578063dd62ed3e14610576578063ea1644d5146105bc578063f2fde38b146105dc57600080fd5b8063a2a957bb146104d1578063a9059cbb146104f1578063bfd7928414610511578063c3c8cd801461054157600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b157600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027257806318160ddd146102aa57806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024257600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611962565b6105fc565b005b34801561020a57600080fd5b506040805180820190915260098152684c616d626f20496e7560b81b60208201525b6040516102399190611a27565b60405180910390f35b34801561024e57600080fd5b5061026261025d366004611a7c565b61069b565b6040519015158152602001610239565b34801561027e57600080fd5b50601454610292906001600160a01b031681565b6040516001600160a01b039091168152602001610239565b3480156102b657600080fd5b50683635c9adc5dea000005b604051908152602001610239565b3480156102dc57600080fd5b506102626102eb366004611aa8565b6106b2565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b5060405160098152602001610239565b34801561032e57600080fd5b50601554610292906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae9565b61071b565b34801561036e57600080fd5b506101fc61037d366004611b16565b610766565b34801561038e57600080fd5b506101fc6107ae565b3480156103a357600080fd5b506102c26103b2366004611ae9565b6107f9565b3480156103c357600080fd5b506101fc61081b565b3480156103d857600080fd5b506101fc6103e7366004611b31565b61088f565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae9565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610292565b34801561045957600080fd5b506101fc610468366004611b16565b6108be565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b506040805180820190915260058152644c414d424f60d81b602082015261022c565b3480156104bd57600080fd5b506101fc6104cc366004611b31565b610906565b3480156104dd57600080fd5b506101fc6104ec366004611b4a565b610935565b3480156104fd57600080fd5b5061026261050c366004611a7c565b610973565b34801561051d57600080fd5b5061026261052c366004611ae9565b60106020526000908152604090205460ff1681565b34801561054d57600080fd5b506101fc610980565b34801561056257600080fd5b506101fc610571366004611b7c565b6109d4565b34801561058257600080fd5b506102c2610591366004611c00565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c857600080fd5b506101fc6105d7366004611b31565b610a75565b3480156105e857600080fd5b506101fc6105f7366004611ae9565b610aa4565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161062690611c39565b60405180910390fd5b60005b81518110156106975760016010600084848151811061065357610653611c6e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f81611c9a565b915050610632565b5050565b60006106a8338484610b8e565b5060015b92915050565b60006106bf848484610cb2565b610711843361070c85604051806060016040528060288152602001611db4602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111ee565b610b8e565b5060019392505050565b6000546001600160a01b031633146107455760405162461bcd60e51b815260040161062690611c39565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107905760405162461bcd60e51b815260040161062690611c39565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e357506013546001600160a01b0316336001600160a01b0316145b6107ec57600080fd5b476107f681611228565b50565b6001600160a01b0381166000908152600260205260408120546106ac90611262565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161062690611c39565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161062690611c39565b601655565b6000546001600160a01b031633146108e85760405162461bcd60e51b815260040161062690611c39565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109305760405162461bcd60e51b815260040161062690611c39565b601855565b6000546001600160a01b0316331461095f5760405162461bcd60e51b815260040161062690611c39565b600893909355600a91909155600955600b55565b60006106a8338484610cb2565b6012546001600160a01b0316336001600160a01b031614806109b557506013546001600160a01b0316336001600160a01b0316145b6109be57600080fd5b60006109c9306107f9565b90506107f6816112e6565b6000546001600160a01b031633146109fe5760405162461bcd60e51b815260040161062690611c39565b60005b82811015610a6f578160056000868685818110610a2057610a20611c6e565b9050602002016020810190610a359190611ae9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6781611c9a565b915050610a01565b50505050565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161062690611c39565b601755565b6000546001600160a01b03163314610ace5760405162461bcd60e51b815260040161062690611c39565b6001600160a01b038116610b335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610626565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610626565b6001600160a01b038216610c515760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610626565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d165760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610626565b6001600160a01b038216610d785760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610626565b60008111610dda5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610626565b6000546001600160a01b03848116911614801590610e0657506000546001600160a01b03838116911614155b156110e757601554600160a01b900460ff16610e9f576000546001600160a01b03848116911614610e9f5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610626565b601654811115610ef15760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610626565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3357506001600160a01b03821660009081526010602052604090205460ff16155b610f8b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610626565b6015546001600160a01b038381169116146110105760175481610fad846107f9565b610fb79190611cb5565b106110105760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610626565b600061101b306107f9565b6018546016549192508210159082106110345760165491505b80801561104b5750601554600160a81b900460ff16155b801561106557506015546001600160a01b03868116911614155b801561107a5750601554600160b01b900460ff165b801561109f57506001600160a01b03851660009081526005602052604090205460ff16155b80156110c457506001600160a01b03841660009081526005602052604090205460ff16155b156110e4576110d2826112e6565b4780156110e2576110e247611228565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112957506001600160a01b03831660009081526005602052604090205460ff165b8061115b57506015546001600160a01b0385811691161480159061115b57506015546001600160a01b03848116911614155b15611168575060006111e2565b6015546001600160a01b03858116911614801561119357506014546001600160a01b03848116911614155b156111a557600854600c55600954600d555b6015546001600160a01b0384811691161480156111d057506014546001600160a01b03858116911614155b156111e257600a54600c55600b54600d555b610a6f8484848461146f565b600081848411156112125760405162461bcd60e51b81526004016106269190611a27565b50600061121f8486611ccd565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610697573d6000803e3d6000fd5b60006006548211156112c95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610626565b60006112d361149d565b90506112df83826114c0565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132e5761132e611c6e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138257600080fd5b505afa158015611396573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ba9190611ce4565b816001815181106113cd576113cd611c6e565b6001600160a01b0392831660209182029290920101526014546113f39130911684610b8e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142c908590600090869030904290600401611d01565b600060405180830381600087803b15801561144657600080fd5b505af115801561145a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147c5761147c611502565b611487848484611530565b80610a6f57610a6f600e54600c55600f54600d55565b60008060006114aa611627565b90925090506114b982826114c0565b9250505090565b60006112df83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611669565b600c541580156115125750600d54155b1561151957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154287611697565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157490876116f4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a39086611736565b6001600160a01b0389166000908152600260205260409020556115c581611795565b6115cf84836117df565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161491815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea0000061164382826114c0565b82101561166057505060065492683635c9adc5dea0000092509050565b90939092509050565b6000818361168a5760405162461bcd60e51b81526004016106269190611a27565b50600061121f8486611d72565b60008060008060008060008060006116b48a600c54600d54611803565b92509250925060006116c461149d565b905060008060006116d78e878787611858565b919e509c509a509598509396509194505050505091939550919395565b60006112df83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111ee565b6000806117438385611cb5565b9050838110156112df5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610626565b600061179f61149d565b905060006117ad83836118a8565b306000908152600260205260409020549091506117ca9082611736565b30600090815260026020526040902055505050565b6006546117ec90836116f4565b6006556007546117fc9082611736565b6007555050565b600080808061181d606461181789896118a8565b906114c0565b9050600061183060646118178a896118a8565b90506000611848826118428b866116f4565b906116f4565b9992985090965090945050505050565b600080808061186788866118a8565b9050600061187588876118a8565b9050600061188388886118a8565b905060006118958261184286866116f4565b939b939a50919850919650505050505050565b6000826118b7575060006106ac565b60006118c38385611d94565b9050826118d08583611d72565b146112df5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610626565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b803561195d8161193d565b919050565b6000602080838503121561197557600080fd5b823567ffffffffffffffff8082111561198d57600080fd5b818501915085601f8301126119a157600080fd5b8135818111156119b3576119b3611927565b8060051b604051601f19603f830116810181811085821117156119d8576119d8611927565b6040529182528482019250838101850191888311156119f657600080fd5b938501935b82851015611a1b57611a0c85611952565b845293850193928501926119fb565b98975050505050505050565b600060208083528351808285015260005b81811015611a5457858101830151858201604001528201611a38565b81811115611a66576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8f57600080fd5b8235611a9a8161193d565b946020939093013593505050565b600080600060608486031215611abd57600080fd5b8335611ac88161193d565b92506020840135611ad88161193d565b929592945050506040919091013590565b600060208284031215611afb57600080fd5b81356112df8161193d565b8035801515811461195d57600080fd5b600060208284031215611b2857600080fd5b6112df82611b06565b600060208284031215611b4357600080fd5b5035919050565b60008060008060808587031215611b6057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9157600080fd5b833567ffffffffffffffff80821115611ba957600080fd5b818601915086601f830112611bbd57600080fd5b813581811115611bcc57600080fd5b8760208260051b8501011115611be157600080fd5b602092830195509350611bf79186019050611b06565b90509250925092565b60008060408385031215611c1357600080fd5b8235611c1e8161193d565b91506020830135611c2e8161193d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cae57611cae611c84565b5060010190565b60008219821115611cc857611cc8611c84565b500190565b600082821015611cdf57611cdf611c84565b500390565b600060208284031215611cf657600080fd5b81516112df8161193d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d515784516001600160a01b031683529383019391830191600101611d2c565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611dae57611dae611c84565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122068b3060a0a3aa5124584dba8d88c4b0bdc65559bc69ef224971c3ec53e176af864736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
6,694
0xd9427f98a306433069057af84cf198047a633633
// Telegram: https://t.me/mediainu // Website: https://mediainu.xyz/ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } 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 MediaInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private time; uint256 private _tax; uint256 private constant _tTotal = 1 * 10**12 * 10**9; uint256 private fee1=90; uint256 private fee2=90; uint256 private liqfee=20; uint256 private feeMax=100; string private constant _name = "Media Inu"; string private constant _symbol = "MEDIA"; uint256 private _maxTxAmount = _tTotal.mul(2).div(100); uint256 private minBalance = _tTotal.div(1000); uint8 private constant _decimals = 9; address payable private _feeAddrWallet1; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () payable { _feeAddrWallet1 = payable(msg.sender); _tOwned[address(this)] = _tTotal.div(2); _tOwned[0x000000000000000000000000000000000000dEaD] = _tTotal.div(2); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); emit Transfer(address(0),address(this),_tTotal.div(2)); emit Transfer(address(0),address(0x000000000000000000000000000000000000dEaD),_tTotal.div(2)); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tOwned[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function changeFees(uint8 _fee1,uint8 _fee2,uint8 _liq) external { require(_msgSender() == _feeAddrWallet1); require(_fee1 <= feeMax && _fee2 <= feeMax && liqfee <= feeMax,"Cannot set fees above maximum"); fee1 = _fee1; fee2 = _fee2; liqfee = _liq; } function changeMinBalance(uint256 newMin) external { require(_msgSender() == _feeAddrWallet1); minBalance = newMin; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _tax = fee1.add(liqfee); if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && (block.timestamp < time)){ // Cooldown require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _tax = fee2.add(liqfee); } if (!inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from]) { require(block.timestamp > time,"Sells prohibited for the first 5 minutes"); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > minBalance){ swapAndLiquify(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } } _transferStandard(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function swapAndLiquify(uint256 tokenAmount) private { uint256 half = liqfee.div(2); uint256 part = fee2.add(half); uint256 sum = fee2.add(liqfee); uint256 swapTotal = tokenAmount.mul(part).div(sum); swapTokensForEth(swapTotal); addLiquidity(tokenAmount.sub(swapTotal),address(this).balance.mul(half).div(part),_feeAddrWallet1); } function addLiquidity(uint256 tokenAmount,uint256 ethAmount,address target) private lockTheSwap{ _approve(address(this),address(uniswapV2Router),tokenAmount); uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this),tokenAmount,0,0,target,block.timestamp); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); addLiquidity(balanceOf(address(this)),address(this).balance,owner()); swapEnabled = true; tradingOpen = true; time = block.timestamp + (5 minutes); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 transferAmount,uint256 tfee) = _getTValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(transferAmount); _tOwned[address(this)] = _tOwned[address(this)].add(tfee); emit Transfer(sender, recipient, transferAmount); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet1); uint256 contractBalance = balanceOf(address(this)); swapAndLiquify(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet1); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = tAmount.mul(_tax).div(1000); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function recoverTokens(address tokenAddress) external { require(_msgSender() == _feeAddrWallet1); IERC20 recoveryToken = IERC20(tokenAddress); recoveryToken.transfer(_feeAddrWallet1,recoveryToken.balanceOf(address(this))); } }
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610384578063b515566a146103c1578063c3c8cd80146103ea578063c9567bf914610401578063dd62ed3e146104185761011f565b806370a08231146102b1578063715018a6146102ee5780637e37e9bb146103055780638da5cb5b1461032e57806395d89b41146103595761011f565b806323b872dd116100e757806323b872dd146101e0578063273123b71461021d578063313ce567146102465780634ea18fab146102715780636fc3eaec1461029a5761011f565b806306fdde0314610124578063095ea7b31461014f57806316114acd1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b60405161014691906128fe565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906123ef565b610492565b60405161018391906128e3565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190612302565b6104b0565b005b3480156101c157600080fd5b506101ca610652565b6040516101d79190612a80565b60405180910390f35b3480156101ec57600080fd5b506102076004803603810190610202919061239c565b610663565b60405161021491906128e3565b60405180910390f35b34801561022957600080fd5b50610244600480360381019061023f9190612302565b61073c565b005b34801561025257600080fd5b5061025b61082c565b6040516102689190612af5565b60405180910390f35b34801561027d57600080fd5b50610298600480360381019061029391906124a5565b610835565b005b3480156102a657600080fd5b506102af6108a0565b005b3480156102bd57600080fd5b506102d860048036038101906102d39190612302565b610912565b6040516102e59190612a80565b60405180910390f35b3480156102fa57600080fd5b5061030361095b565b005b34801561031157600080fd5b5061032c60048036038101906103279190612552565b610aae565b005b34801561033a57600080fd5b50610343610b9b565b604051610350919061283e565b60405180910390f35b34801561036557600080fd5b5061036e610bc4565b60405161037b91906128fe565b60405180910390f35b34801561039057600080fd5b506103ab60048036038101906103a691906123ef565b610c01565b6040516103b891906128e3565b60405180910390f35b3480156103cd57600080fd5b506103e860048036038101906103e3919061242f565b610c1f565b005b3480156103f657600080fd5b506103ff610d49565b005b34801561040d57600080fd5b50610416610dc3565b005b34801561042457600080fd5b5061043f600480360381019061043a919061235c565b610f0e565b60405161044c9190612a80565b60405180910390f35b60606040518060400160405280600981526020017f4d6564696120496e750000000000000000000000000000000000000000000000815250905090565b60006104a661049f61105a565b8484611062565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104f161105a565b73ffffffffffffffffffffffffffffffffffffffff161461051157600080fd5b60008190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161058e919061283e565b60206040518083038186803b1580156105a657600080fd5b505afa1580156105ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105de91906124d2565b6040518363ffffffff1660e01b81526004016105fb929190612859565b602060405180830381600087803b15801561061557600080fd5b505af1158015610629573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064d9190612478565b505050565b6000683635c9adc5dea00000905090565b600061067084848461122d565b6107318461067c61105a565b61072c8560405180606001604052806028815260200161322060289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106e261105a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e69092919063ffffffff16565b611062565b600190509392505050565b61074461105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c8906129c0565b60405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661087661105a565b73ffffffffffffffffffffffffffffffffffffffff161461089657600080fd5b80600e8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e161105a565b73ffffffffffffffffffffffffffffffffffffffff161461090157600080fd5b600047905061090f8161194a565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61096361105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e7906129c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aef61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610b0f57600080fd5b600c548360ff1611158015610b295750600c548260ff1611155b8015610b395750600c54600b5411155b610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612a60565b60405180910390fd5b8260ff166009819055508160ff16600a819055508060ff16600b81905550505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d45444941000000000000000000000000000000000000000000000000000000815250905090565b6000610c15610c0e61105a565b848461122d565b6001905092915050565b610c2761105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cab906129c0565b60405180910390fd5b60005b8151811015610d4557600160056000848481518110610cd957610cd8612e73565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d3d90612dcc565b915050610cb7565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d8a61105a565b73ffffffffffffffffffffffffffffffffffffffff1614610daa57600080fd5b6000610db530610912565b9050610dc0816119b6565b50565b610dcb61105a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4f906129c0565b60405180910390fd5b601160149054906101000a900460ff1615610ea8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9f90612a40565b60405180910390fd5b610ec2610eb430610912565b47610ebd610b9b565b611aa0565b6001601160166101000a81548160ff0219169083151502179055506001601160146101000a81548160ff02191690831515021790555061012c42610f069190612bb6565b600781905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080831415610fa8576000905061100a565b60008284610fb69190612c3d565b9050828482610fc59190612c0c565b14611005576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffc906129a0565b60405180910390fd5b809150505b92915050565b600061105283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611bc4565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c990612a20565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113990612960565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112209190612a80565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561129d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161129490612a00565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561130d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130490612940565b60405180910390fd5b60008111611350576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611347906129e0565b60405180910390fd5b611367600b54600954611c2790919063ffffffff16565b600881905550611375610b9b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113e357506113b3610b9b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156118d657600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561148c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61149557600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115405750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115965750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156115a3575060075442105b1561165357600d548111156115b757600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061160257600080fd5b601e4261160f9190612bb6565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156116fe5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117545750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561177757611770600b54600a54611c2790919063ffffffff16565b6008819055505b601160159054906101000a900460ff161580156117e25750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117fa5750601160169054906101000a900460ff165b80156118505750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118d5576007544211611899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189090612920565b60405180910390fd5b60006118a430610912565b9050600e548111156118d3576118b9816119b6565b600047905060008111156118d1576118d04761194a565b5b505b505b5b6118e1838383611c85565b505050565b600083831115829061192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192591906128fe565b60405180910390fd5b506000838561193d9190612c97565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119b2573d6000803e3d6000fd5b5050565b60006119ce6002600b5461101090919063ffffffff16565b905060006119e782600a54611c2790919063ffffffff16565b90506000611a02600b54600a54611c2790919063ffffffff16565b90506000611a2b82611a1d8588610f9590919063ffffffff16565b61101090919063ffffffff16565b9050611a3681611ec0565b611a99611a4c828761214890919063ffffffff16565b611a7185611a638847610f9590919063ffffffff16565b61101090919063ffffffff16565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611aa0565b5050505050565b6001601160156101000a81548160ff021916908315150217905550611ae830601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087426040518863ffffffff1660e01b8152600401611b4f96959493929190612882565b6060604051808303818588803b158015611b6857600080fd5b505af1158015611b7c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611ba191906124ff565b5050506000601160156101000a81548160ff021916908315150217905550505050565b60008083118290611c0b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0291906128fe565b60405180910390fd5b5060008385611c1a9190612c0c565b9050809150509392505050565b6000808284611c369190612bb6565b905083811015611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7290612980565b60405180910390fd5b8091505092915050565b600080611c9183612192565b91509150611ce783600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461214890919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d7c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e1181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611eb19190612a80565b60405180910390a35050505050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ef857611ef7612ea2565b5b604051908082528060200260200182016040528015611f265781602001602082028036833780820191505090505b5090503081600081518110611f3e57611f3d612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fe057600080fd5b505afa158015611ff4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612018919061232f565b8160018151811061202c5761202b612e73565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061209330601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611062565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120f7959493929190612a9b565b600060405180830381600087803b15801561211157600080fd5b505af1158015612125573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b600061218a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506118e6565b905092915050565b60008060006121c06103e86121b260085487610f9590919063ffffffff16565b61101090919063ffffffff16565b905060006121d7828661214890919063ffffffff16565b90508082935093505050915091565b60006121f96121f484612b35565b612b10565b9050808382526020820190508285602086028201111561221c5761221b612ed6565b5b60005b8581101561224c57816122328882612256565b84526020840193506020830192505060018101905061221f565b5050509392505050565b600081359050612265816131c3565b92915050565b60008151905061227a816131c3565b92915050565b600082601f83011261229557612294612ed1565b5b81356122a58482602086016121e6565b91505092915050565b6000815190506122bd816131da565b92915050565b6000813590506122d2816131f1565b92915050565b6000815190506122e7816131f1565b92915050565b6000813590506122fc81613208565b92915050565b60006020828403121561231857612317612ee0565b5b600061232684828501612256565b91505092915050565b60006020828403121561234557612344612ee0565b5b60006123538482850161226b565b91505092915050565b6000806040838503121561237357612372612ee0565b5b600061238185828601612256565b925050602061239285828601612256565b9150509250929050565b6000806000606084860312156123b5576123b4612ee0565b5b60006123c386828701612256565b93505060206123d486828701612256565b92505060406123e5868287016122c3565b9150509250925092565b6000806040838503121561240657612405612ee0565b5b600061241485828601612256565b9250506020612425858286016122c3565b9150509250929050565b60006020828403121561244557612444612ee0565b5b600082013567ffffffffffffffff81111561246357612462612edb565b5b61246f84828501612280565b91505092915050565b60006020828403121561248e5761248d612ee0565b5b600061249c848285016122ae565b91505092915050565b6000602082840312156124bb576124ba612ee0565b5b60006124c9848285016122c3565b91505092915050565b6000602082840312156124e8576124e7612ee0565b5b60006124f6848285016122d8565b91505092915050565b60008060006060848603121561251857612517612ee0565b5b6000612526868287016122d8565b9350506020612537868287016122d8565b9250506040612548868287016122d8565b9150509250925092565b60008060006060848603121561256b5761256a612ee0565b5b6000612579868287016122ed565b935050602061258a868287016122ed565b925050604061259b868287016122ed565b9150509250925092565b60006125b183836125cc565b60208301905092915050565b6125c681612d20565b82525050565b6125d581612ccb565b82525050565b6125e481612ccb565b82525050565b60006125f582612b71565b6125ff8185612b94565b935061260a83612b61565b8060005b8381101561263b57815161262288826125a5565b975061262d83612b87565b92505060018101905061260e565b5085935050505092915050565b61265181612cdd565b82525050565b61266081612d32565b82525050565b600061267182612b7c565b61267b8185612ba5565b935061268b818560208601612d68565b61269481612ee5565b840191505092915050565b60006126ac602883612ba5565b91506126b782612ef6565b604082019050919050565b60006126cf602383612ba5565b91506126da82612f45565b604082019050919050565b60006126f2602283612ba5565b91506126fd82612f94565b604082019050919050565b6000612715601b83612ba5565b915061272082612fe3565b602082019050919050565b6000612738602183612ba5565b91506127438261300c565b604082019050919050565b600061275b602083612ba5565b91506127668261305b565b602082019050919050565b600061277e602983612ba5565b915061278982613084565b604082019050919050565b60006127a1602583612ba5565b91506127ac826130d3565b604082019050919050565b60006127c4602483612ba5565b91506127cf82613122565b604082019050919050565b60006127e7601783612ba5565b91506127f282613171565b602082019050919050565b600061280a601d83612ba5565b91506128158261319a565b602082019050919050565b61282981612d09565b82525050565b61283881612d13565b82525050565b600060208201905061285360008301846125db565b92915050565b600060408201905061286e60008301856125bd565b61287b6020830184612820565b9392505050565b600060c08201905061289760008301896125db565b6128a46020830188612820565b6128b16040830187612657565b6128be6060830186612657565b6128cb60808301856125db565b6128d860a0830184612820565b979650505050505050565b60006020820190506128f86000830184612648565b92915050565b600060208201905081810360008301526129188184612666565b905092915050565b600060208201905081810360008301526129398161269f565b9050919050565b60006020820190508181036000830152612959816126c2565b9050919050565b60006020820190508181036000830152612979816126e5565b9050919050565b6000602082019050818103600083015261299981612708565b9050919050565b600060208201905081810360008301526129b98161272b565b9050919050565b600060208201905081810360008301526129d98161274e565b9050919050565b600060208201905081810360008301526129f981612771565b9050919050565b60006020820190508181036000830152612a1981612794565b9050919050565b60006020820190508181036000830152612a39816127b7565b9050919050565b60006020820190508181036000830152612a59816127da565b9050919050565b60006020820190508181036000830152612a79816127fd565b9050919050565b6000602082019050612a956000830184612820565b92915050565b600060a082019050612ab06000830188612820565b612abd6020830187612657565b8181036040830152612acf81866125ea565b9050612ade60608301856125db565b612aeb6080830184612820565b9695505050505050565b6000602082019050612b0a600083018461282f565b92915050565b6000612b1a612b2b565b9050612b268282612d9b565b919050565b6000604051905090565b600067ffffffffffffffff821115612b5057612b4f612ea2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bc182612d09565b9150612bcc83612d09565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c0157612c00612e15565b5b828201905092915050565b6000612c1782612d09565b9150612c2283612d09565b925082612c3257612c31612e44565b5b828204905092915050565b6000612c4882612d09565b9150612c5383612d09565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612c8c57612c8b612e15565b5b828202905092915050565b6000612ca282612d09565b9150612cad83612d09565b925082821015612cc057612cbf612e15565b5b828203905092915050565b6000612cd682612ce9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d2b82612d44565b9050919050565b6000612d3d82612d09565b9050919050565b6000612d4f82612d56565b9050919050565b6000612d6182612ce9565b9050919050565b60005b83811015612d86578082015181840152602081019050612d6b565b83811115612d95576000848401525b50505050565b612da482612ee5565b810181811067ffffffffffffffff82111715612dc357612dc2612ea2565b5b80604052505050565b6000612dd782612d09565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e0a57612e09612e15565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f53656c6c732070726f6869626974656420666f7220746865206669727374203560008201527f206d696e75746573000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f43616e6e6f742073657420666565732061626f7665206d6178696d756d000000600082015250565b6131cc81612ccb565b81146131d757600080fd5b50565b6131e381612cdd565b81146131ee57600080fd5b50565b6131fa81612d09565b811461320557600080fd5b50565b61321181612d13565b811461321c57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220471fe8c1adda2c342e078b13ddf9674b6b0897d6afa8e77ec32dfe32d23d6a8464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
6,695
0xb7c31ac2f96797518b92706654f773a466de4752
/** *Submitted for verification at Etherscan.io on 2022-01-26 */ //SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.6; interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom(address from, address to, uint256 tokenId) external; function transferFrom(address from, address to, uint256 tokenId) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } interface ERC721TokenReceiver { function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns(bytes4); } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b); 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) { require(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; require(c >= a); return c; } } contract FunnyApeClub is IERC721 { using SafeMath for uint256; event Mint(uint indexed index, address indexed minter); /** * Event emitted when the public sale begins. */ event SaleBegins(); bytes4 internal constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02; uint public constant TOKEN_LIMIT = 10000; mapping(bytes4 => bool) internal supportedInterfaces; mapping (uint256 => address) internal idToOwner; mapping (uint256 => address) internal idToApproval; mapping (address => mapping (address => bool)) internal ownerToOperators; mapping(address => uint256[]) internal ownerToIds; mapping(uint256 => uint256) internal idToOwnerIndex; string internal nftName = "FunnyApeClub"; string internal nftSymbol = "FAC"; // You can use this hash to verify the image file containing all the FunApe string public imageHash; uint internal numTokens = 0; uint internal numSales = 0; address payable internal deployer; address payable internal marketer = 0x1091496189182Fc74bb6ceb4b010aD4D96dC7469; bool public publicSale = false; uint public mintPrice = 10e16; uint public saleStartTime; //// Random index assignment uint internal nonce = 0; uint[TOKEN_LIMIT] internal indices; //// Market bool public marketPaused; bool public contractSealed; mapping (address => uint256) public ethBalance; mapping (bytes32 => bool) public cancelledOffers; string public BaseURI; modifier onlyDeployer() { require(msg.sender == deployer, "Only deployer."); _; } bool private reentrancyLock = false; /* Prevent a contract function from being reentrant-called. */ modifier reentrancyGuard { if (reentrancyLock) { revert(); } reentrancyLock = true; _; reentrancyLock = false; } modifier canOperate(uint256 _tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender], "Cannot operate."); _; } modifier canTransfer(uint256 _tokenId) { address tokenOwner = idToOwner[_tokenId]; require( tokenOwner == msg.sender || idToApproval[_tokenId] == msg.sender || ownerToOperators[tokenOwner][msg.sender], "Cannot transfer." ); _; } modifier validNFToken(uint256 _tokenId) { require(idToOwner[_tokenId] != address(0), "Invalid token."); _; } constructor(string memory _BaseURI) { supportedInterfaces[0x01ffc9a7] = true; // ERC165 supportedInterfaces[0x80ac58cd] = true; // ERC721 supportedInterfaces[0x780e9d63] = true; // ERC721 Enumerable supportedInterfaces[0x5b5e139f] = true; // ERC721 Metadata deployer = msg.sender; BaseURI=_BaseURI; } function startSale() external onlyDeployer { require(!publicSale); saleStartTime = block.timestamp; publicSale = true; emit SaleBegins(); } function pauseMarket(bool _paused) external onlyDeployer { require(!contractSealed, "Contract sealed."); marketPaused = _paused; } function sealContract() external onlyDeployer { contractSealed = true; } ////////////////////////// //// ERC 721 and 165 //// ////////////////////////// function isContract(address _addr) internal view returns (bool addressCheck) { uint256 size; assembly { size := extcodesize(_addr) } // solhint-disable-line addressCheck = size > 0; } function supportsInterface(bytes4 _interfaceID) external view override returns (bool) { return supportedInterfaces[_interfaceID]; } function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata _data) external override { _safeTransferFrom(_from, _to, _tokenId, _data); } function safeTransferFrom(address _from, address _to, uint256 _tokenId) external override { _safeTransferFrom(_from, _to, _tokenId, ""); } function transferFrom(address _from, address _to, uint256 _tokenId) external override canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, "Wrong from address."); require(_to != address(0), "Cannot send to 0x0."); _transfer(_to, _tokenId); } function approve(address _approved, uint256 _tokenId) external override canOperate(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(_approved != tokenOwner); idToApproval[_tokenId] = _approved; emit Approval(tokenOwner, _approved, _tokenId); } function setApprovalForAll(address _operator, bool _approved) external override { ownerToOperators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } function balanceOf(address _owner) external view override returns (uint256) { require(_owner != address(0)); return _getOwnerNFTCount(_owner); } function ownerOf(uint256 _tokenId) public view override returns (address _owner) { require(idToOwner[_tokenId] != address(0)); _owner = idToOwner[_tokenId]; } function getApproved(uint256 _tokenId) external view override validNFToken(_tokenId) returns (address) { return idToApproval[_tokenId]; } function isApprovedForAll(address _owner, address _operator) external override view returns (bool) { return ownerToOperators[_owner][_operator]; } function _transfer(address _to, uint256 _tokenId) internal { address from = idToOwner[_tokenId]; _clearApproval(_tokenId); _removeNFToken(from, _tokenId); _addNFToken(_to, _tokenId); emit Transfer(from, _to, _tokenId); } function randomIndex() internal returns (uint) { uint totalSize = TOKEN_LIMIT - numTokens; uint index = uint(keccak256(abi.encodePacked(nonce, msg.sender, block.difficulty, block.timestamp))) % totalSize; uint value = 0; if (indices[index] != 0) { value = indices[index]; } else { value = index; } // Move last value to selected position if (indices[totalSize - 1] == 0) { // Array position not initialized, so use position indices[index] = totalSize - 1; } else { // Array position holds a value so use that indices[index] = indices[totalSize - 1]; } nonce++; // Don't allow a zero index, start counting at 1 return value.add(1); } function mintsRemaining() external view returns (uint) { return TOKEN_LIMIT.sub(numSales); } /** * Public sale minting. */ function mint(uint256 numberOfNfts) external payable reentrancyGuard { require(publicSale, "Sale not started."); require(!marketPaused); require(numberOfNfts > 0, "numberOfNfts cannot be 0"); require(numberOfNfts <= 20, "You can not buy more than 20 NFTs at once"); require(totalSupply().add(numberOfNfts) <= TOKEN_LIMIT, "Exceeds TOKEN_LIMIT"); require(mintPrice.mul(numberOfNfts) == msg.value, "eth value sent is not correct"); marketer.transfer(msg.value); for (uint i = 0; i < numberOfNfts; i++) { numSales++; uint id = _mint(deployer); _removeNFToken(deployer, id); _addNFToken(msg.sender, id); emit Transfer(deployer, msg.sender, id); } } function _mint(address _to) internal returns (uint) { require(_to != address(0), "Cannot mint to 0x0."); require(numTokens < TOKEN_LIMIT, "Token limit reached."); uint id = randomIndex(); numTokens = numTokens + 1; _addNFToken(_to, id); emit Mint(id, _to); emit Transfer(address(0), _to, id); return id; } function _addNFToken(address _to, uint256 _tokenId) internal { require(idToOwner[_tokenId] == address(0), "Cannot add, already owned."); idToOwner[_tokenId] = _to; ownerToIds[_to].push(_tokenId); idToOwnerIndex[_tokenId] = ownerToIds[_to].length.sub(1); } function _removeNFToken(address _from, uint256 _tokenId) internal { require(idToOwner[_tokenId] == _from, "Incorrect owner."); delete idToOwner[_tokenId]; uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId]; uint256 lastTokenIndex = ownerToIds[_from].length.sub(1); if (lastTokenIndex != tokenToRemoveIndex) { uint256 lastToken = ownerToIds[_from][lastTokenIndex]; ownerToIds[_from][tokenToRemoveIndex] = lastToken; idToOwnerIndex[lastToken] = tokenToRemoveIndex; } ownerToIds[_from].pop(); } function _getOwnerNFTCount(address _owner) internal view returns (uint256) { return ownerToIds[_owner].length; } function _safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) private canTransfer(_tokenId) validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, "Incorrect owner."); require(_to != address(0)); _transfer(_to, _tokenId); if (isContract(_to)) { bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data); require(retval == MAGIC_ON_ERC721_RECEIVED); } } function _safeTransfer(address _from, address _to, uint256 _tokenId, bytes memory _data) private validNFToken(_tokenId) { address tokenOwner = idToOwner[_tokenId]; require(tokenOwner == _from, "Incorrect owner."); require(_to != address(0)); _transfer(_to, _tokenId); if (isContract(_to)) { bytes4 retval = ERC721TokenReceiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data); require(retval == MAGIC_ON_ERC721_RECEIVED); } } function _clearApproval(uint256 _tokenId) private { if (idToApproval[_tokenId] != address(0)) { delete idToApproval[_tokenId]; } } //// Enumerable function totalSupply() public view returns (uint256) { return numTokens; } function tokenByIndex(uint256 index) public pure returns (uint256) { require(index >= 0 && index < TOKEN_LIMIT); return index + 1; } function tokenOfOwnerByIndex(address _owner, uint256 _index) external view returns (uint256) { require(_index < ownerToIds[_owner].length); return ownerToIds[_owner][_index]; } //// Metadata /** * @dev Converts a `uint256` to its ASCII `string` representation. */ function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); uint256 index = digits - 1; temp = value; while (temp != 0) { buffer[index--] = bytes1(uint8(48 + temp % 10)); temp /= 10; } return string(buffer); } /** * @dev Returns a descriptive name for a collection of NFTokens. * @return _name Representing name. */ function name() external view returns (string memory _name) { _name = nftName; } /** * @dev Returns an abbreviated name for NFTokens. * @return _symbol Representing symbol. */ function symbol() external view returns (string memory _symbol) { _symbol = nftSymbol; } /** * @dev A distinct URI (RFC 3986) for a given NFT. * @param _tokenId Id for which we want uri. * @return _tokenId URI of _tokenId. */ function tokenURI(uint256 _tokenId) external view validNFToken(_tokenId) returns (string memory) { return string(abi.encodePacked(BaseURI, toString(_tokenId))); } function setBaseURI(string memory _baseURI) public onlyDeployer() { BaseURI=_baseURI; } function setMintprice(uint _price) public onlyDeployer() { mintPrice=_price; } function setMarketingAddr(address payable _addr) public onlyDeployer() { marketer=_addr; } function Ownermint(uint256 numberOfNfts) external reentrancyGuard onlyDeployer(){ require(publicSale, "Sale not started."); require(!marketPaused); require(numberOfNfts > 0, "numberOfNfts cannot be 0"); require(numberOfNfts <= 20, "You can not buy more than 20 NFTs at once"); require(totalSupply().add(numberOfNfts) <= TOKEN_LIMIT, "Exceeds TOKEN_LIMIT"); for (uint i = 0; i < numberOfNfts; i++) { numSales++; _mint(msg.sender); } } function _raremint(address _to,uint id) internal returns (uint) { require(_to != address(0), "Cannot mint to 0x0."); require(numTokens < TOKEN_LIMIT, "Token limit reached."); numTokens = numTokens + 1; _addNFToken(_to, id); emit Mint(id, _to); emit Transfer(address(0), _to, id); return id; } function rare(uint256 start,uint256 to) external reentrancyGuard onlyDeployer(){ require(publicSale, "Sale not started."); require(!marketPaused); uint256 nftdiff = to.sub(start) + 1; require(totalSupply().add(nftdiff) <= TOKEN_LIMIT, "Exceeds TOKEN_LIMIT"); for (uint i = start; i <= to; i++) { numSales++; uint[100] memory r = [uint(51),96,105,152,235,324,421,577,794,861,938,1123,1316,1435,1515,1534,1900,1920,1989,1992,2178,2185,2489,2589,2685,2694,2855,2986,3083,3215,3234,3331,3517,3789,3836,3893,3916,3929,4082,4205,4302,4318,4475,4510,4670,4678,4695,4767,5080,5137,5215,5243,5305,5330,5380,5435,5654,5659,5759,5880,5939,5955,6164,6243,6471,6555,6576,6617,6658,6863,6889,6901,6949,6969,7057,7174,7232,7253,7315,7634,7794,7855,7921,8003,8049,8158,8376,8507,8842,9069,9094,9223,9293,9326,9546,9599,9647,9821,9853,9940]; _raremint(msg.sender,r[i]); } } }
0x60806040526004361061020f5760003560e01c80636352211e11610118578063a7c1d590116100a0578063c6119f301161006f578063c6119f3014610846578063c87b56dd14610870578063d8f3790f1461089a578063e985e9c5146108cd578063ffcc43c4146109085761020f565b8063a7c1d5901461074c578063b65016371461077f578063b66a0e5d14610794578063b88d4fde146107a95761020f565b806395d89b41116100e757806395d89b41146106855780639f7bf7621461069a578063a0712d68146106c4578063a22cb465146106e1578063a5404d661461071c5761020f565b80636352211e146105fe5780636817c76c1461062857806368bd580e1461063d57806370a08231146106525761020f565b806333bc1c5c1161019b57806344c66be71161016a57806344c66be7146104cb5780634f6ccce7146104e057806351605d801461050a57806355f804b31461051f5780635ec390d8146105d25761020f565b806333bc1c5c1461043457806336748001146104495780633a283bd21461047357806342842e0e146104885761020f565b8063095ea7b3116101e2578063095ea7b31461035357806318160ddd1461038e5780631cbaee2d146103a357806323b872dd146103b85780632f745c59146103fb5761020f565b806301ffc9a714610214578063031bd4c41461025c57806306fdde0314610283578063081812fc1461030d575b600080fd5b34801561022057600080fd5b506102486004803603602081101561023757600080fd5b50356001600160e01b03191661091d565b604080519115158252519081900360200190f35b34801561026857600080fd5b50610271610940565b60408051918252519081900360200190f35b34801561028f57600080fd5b50610298610946565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102d25781810151838201526020016102ba565b50505050905090810190601f1680156102ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561031957600080fd5b506103376004803603602081101561033057600080fd5b50356109dc565b604080516001600160a01b039092168252519081900360200190f35b34801561035f57600080fd5b5061038c6004803603604081101561037657600080fd5b506001600160a01b038135169060200135610a55565b005b34801561039a57600080fd5b50610271610bc7565b3480156103af57600080fd5b50610271610bcd565b3480156103c457600080fd5b5061038c600480360360608110156103db57600080fd5b506001600160a01b03813581169160208101359091169060400135610bd3565b34801561040757600080fd5b506102716004803603604081101561041e57600080fd5b506001600160a01b038135169060200135610da9565b34801561044057600080fd5b50610248610e05565b34801561045557600080fd5b5061038c6004803603602081101561046c57600080fd5b5035610e15565b34801561047f57600080fd5b50610248610e6a565b34801561049457600080fd5b5061038c600480360360608110156104ab57600080fd5b506001600160a01b03813581169160208101359091169060400135610e74565b3480156104d757600080fd5b50610271610e94565b3480156104ec57600080fd5b506102716004803603602081101561050357600080fd5b5035610eb2565b34801561051657600080fd5b50610298610ec9565b34801561052b57600080fd5b5061038c6004803603602081101561054257600080fd5b81019060208101813564010000000081111561055d57600080fd5b82018360208201111561056f57600080fd5b8035906020019184600183028401116401000000008311171561059157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f57945050505050565b3480156105de57600080fd5b5061038c600480360360208110156105f557600080fd5b50351515610fbf565b34801561060a57600080fd5b506103376004803603602081101561062157600080fd5b5035611074565b34801561063457600080fd5b506102716110b1565b34801561064957600080fd5b5061038c6110b7565b34801561065e57600080fd5b506102716004803603602081101561067557600080fd5b50356001600160a01b0316611119565b34801561069157600080fd5b50610298611137565b3480156106a657600080fd5b50610248600480360360208110156106bd57600080fd5b5035611198565b61038c600480360360208110156106da57600080fd5b50356111ae565b3480156106ed57600080fd5b5061038c6004803603604081101561070457600080fd5b506001600160a01b038135169060200135151561144a565b34801561072857600080fd5b5061038c6004803603604081101561073f57600080fd5b50803590602001356114b8565b34801561075857600080fd5b5061038c6004803603602081101561076f57600080fd5b50356001600160a01b03166119c1565b34801561078b57600080fd5b50610248611a33565b3480156107a057600080fd5b5061038c611a42565b3480156107b557600080fd5b5061038c600480360360808110156107cc57600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561080757600080fd5b82018360208201111561081957600080fd5b8035906020019184600183028401116401000000008311171561083b57600080fd5b509092509050611aeb565b34801561085257600080fd5b5061038c6004803603602081101561086957600080fd5b5035611b34565b34801561087c57600080fd5b506102986004803603602081101561089357600080fd5b5035611d16565b3480156108a657600080fd5b50610271600480360360208110156108bd57600080fd5b50356001600160a01b0316611e48565b3480156108d957600080fd5b50610248600480360360408110156108f057600080fd5b506001600160a01b0381358116916020013516611e5b565b34801561091457600080fd5b50610298611e89565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b61271081565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109d25780601f106109a7576101008083540402835291602001916109d2565b820191906000526020600020905b8154815290600101906020018083116109b557829003601f168201915b5050505050905090565b60008181526001602052604081205482906001600160a01b0316610a38576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103a37b5b2b71760911b604482015290519081900360640190fd5b50506000908152600260205260409020546001600160a01b031690565b60008181526001602052604090205481906001600160a01b031633811480610aa057506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b610ae3576040805162461bcd60e51b815260206004820152600f60248201526e21b0b73737ba1037b832b930ba329760891b604482015290519081900360640190fd5b60008381526001602052604090205483906001600160a01b0316610b3f576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103a37b5b2b71760911b604482015290519081900360640190fd5b6000848152600160205260409020546001600160a01b03908116908616811415610b6857600080fd5b60008581526002602052604080822080546001600160a01b0319166001600160a01b038a811691821790925591518893918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050505050565b60095490565b600e5481565b60008181526001602052604090205481906001600160a01b031633811480610c1157506000828152600260205260409020546001600160a01b031633145b80610c3f57506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b610c83576040805162461bcd60e51b815260206004820152601060248201526f21b0b73737ba103a3930b739b332b91760811b604482015290519081900360640190fd5b60008381526001602052604090205483906001600160a01b0316610cdf576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103a37b5b2b71760911b604482015290519081900360640190fd5b6000848152600160205260409020546001600160a01b039081169087168114610d45576040805162461bcd60e51b81526020600482015260136024820152722bb937b73390333937b69030b2323932b9b99760691b604482015290519081900360640190fd5b6001600160a01b038616610d96576040805162461bcd60e51b815260206004820152601360248201527221b0b73737ba1039b2b732103a3790183c181760691b604482015290519081900360640190fd5b610da08686611ee5565b50505050505050565b6001600160a01b0382166000908152600460205260408120548210610dcd57600080fd5b6001600160a01b0383166000908152600460205260409020805483908110610df157fe5b906000526020600020015490505b92915050565b600c54600160a01b900460ff1681565b600b546001600160a01b03163314610e65576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b600d55565b6127205460ff1681565b610e8f83838360405180602001604052806000815250611f4e565b505050565b6000610ead600a5461271061221390919063ffffffff16565b905090565b60006127108210610ec257600080fd5b5060010190565b6008805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610f4f5780601f10610f2457610100808354040283529160200191610f4f565b820191906000526020600020905b815481529060010190602001808311610f3257829003601f168201915b505050505081565b600b546001600160a01b03163314610fa7576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b8051610fbb90612723906020840190612915565b5050565b600b546001600160a01b0316331461100f576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b61272054610100900460ff1615611060576040805162461bcd60e51b815260206004820152601060248201526f21b7b73a3930b1ba1039b2b0b632b21760811b604482015290519081900360640190fd5b612720805460ff1916911515919091179055565b6000818152600160205260408120546001600160a01b031661109557600080fd5b506000908152600160205260409020546001600160a01b031690565b600d5481565b600b546001600160a01b03163314611107576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b612720805461ff001916610100179055565b60006001600160a01b03821661112e57600080fd5b610dff82612228565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109d25780601f106109a7576101008083540402835291602001916109d2565b6127226020526000908152604090205460ff1681565b6127245460ff16156111bf57600080fd5b612724805460ff19166001179055600c54600160a01b900460ff1661121f576040805162461bcd60e51b815260206004820152601160248201527029b0b632903737ba1039ba30b93a32b21760791b604482015290519081900360640190fd5b6127205460ff161561123057600080fd5b60008111611280576040805162461bcd60e51b815260206004820152601860248201527706e756d6265724f664e6674732063616e6e6f7420626520360441b604482015290519081900360640190fd5b60148111156112c05760405162461bcd60e51b81526004018080602001828103825260298152602001806129b76029913960400191505060405180910390fd5b6127106112d5826112cf610bc7565b90612243565b111561131e576040805162461bcd60e51b8152602060048201526013602482015272115e18d959591cc81513d2d15397d312535255606a1b604482015290519081900360640190fd5b600d54349061132d9083612253565b1461137f576040805162461bcd60e51b815260206004820152601d60248201527f6574682076616c75652073656e74206973206e6f7420636f7272656374000000604482015290519081900360640190fd5b600c546040516001600160a01b03909116903480156108fc02916000818181858888f193505050501580156113b8573d6000803e3d6000fd5b5060005b8181101561143b57600a80546001019055600b546000906113e5906001600160a01b031661227b565b600b549091506113fe906001600160a01b03168261239e565b611408338261250f565b600b54604051829133916001600160a01b03909116906000805160206129e083398151915290600090a4506001016113bc565b5050612724805460ff19169055565b3360008181526003602090815260408083206001600160a01b03871680855290835292819020805460ff1916861515908117909155815190815290519293927f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31929181900390910190a35050565b6127245460ff16156114c957600080fd5b612724805460ff19166001179055600b54336001600160a01b0390911614611529576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b600c54600160a01b900460ff1661157b576040805162461bcd60e51b815260206004820152601160248201527029b0b632903737ba1039ba30b93a32b21760791b604482015290519081900360640190fd5b6127205460ff161561158c57600080fd5b60006115988284612213565b60010190506127106115ac826112cf610bc7565b11156115f5576040805162461bcd60e51b8152602060048201526013602482015272115e18d959591cc81513d2d15397d312535255606a1b604482015290519081900360640190fd5b825b8281116119b057600a8054600101905560408051610c80810182526033815260606020820181905260699282019290925260989181019190915260eb608082015261014460a08201526101a560c082015261024160e082015261031a61010082015261035d6101208201526103aa61014082015261046361016082015261052461018082015261059b6101a08201526105eb6101c08201526105fe6101e082015261076c61020082015261078061022082018190526107c56102408301526107c86102608301526108826102808301526108896102a08301526109b96102c0830152610a1d6102e0830152610a7d610300830152610a86610320830152610b27610340830152610baa610360830152610c0b610380830152610c8f6103a0830152610ca26103c0830152610d036103e0830152610dbd610400830152610ecd610420830152610efc610440830152610f35610460830152610f4c610480830152610f596104a0830152610ff26104c083015261106d6104e08301526110ce6105008301526110de61052083015261117b61054083015261119e61056083015261123e6105808301526112466105a08301526112576105c083015261129f6105e08301526113d861060083015261141161062083015261145f61064083015261147b6106608301526114b96106808301526114d26106a08301526115046106c083015261153b6106e083015261161661070083015261161b61072083015261167f6107408301526116f8610760830152611733908201526117436107a08201526118146107c08201526118636107e082015261194761080082015261199b6108208201526119b06108408201526119d9610860820152611a02610880820152611acf6108a0820152611ae96108c0820152611af56108e0820152611b25610900820152611b39610920820152611b91610940820152611c06610960820152611c40610980820152611c556109a0820152611c936109c0820152611dd26109e0820152611e72610a00820152611eaf610a20820152611ef1610a40820152611f43610a60820152611f71610a80820152611fde610aa08201526120b8610ac082015261213b610ae082015261228a610b0082015261236d610b20820152612386610b40820152612407610b6082015261244d610b8082015261246e610ba082015261254a610bc082015261257f610be08201526125af610c0082015261265d610c2082015261267d610c408201526126d4610c608201526119a63382846064811061199c57fe5b60200201516125e4565b50506001016115f7565b5050612724805460ff191690555050565b600b546001600160a01b03163314611a11576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b61272054610100900460ff1681565b600b546001600160a01b03163314611a92576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b600c54600160a01b900460ff1615611aa957600080fd5b42600e55600c805460ff60a01b1916600160a01b1790556040517f771cfe172460b7d64cc46cca57a1e1f40f52b47cf1d16fe30c78a2935b3dd58090600090a1565b611b2d85858585858080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611f4e92505050565b5050505050565b6127245460ff1615611b4557600080fd5b612724805460ff19166001179055600b54336001600160a01b0390911614611ba5576040805162461bcd60e51b815260206004820152600e60248201526d27b7363c903232b83637bcb2b91760911b604482015290519081900360640190fd5b600c54600160a01b900460ff16611bf7576040805162461bcd60e51b815260206004820152601160248201527029b0b632903737ba1039ba30b93a32b21760791b604482015290519081900360640190fd5b6127205460ff1615611c0857600080fd5b60008111611c58576040805162461bcd60e51b815260206004820152601860248201527706e756d6265724f664e6674732063616e6e6f7420626520360441b604482015290519081900360640190fd5b6014811115611c985760405162461bcd60e51b81526004018080602001828103825260298152602001806129b76029913960400191505060405180910390fd5b612710611ca7826112cf610bc7565b1115611cf0576040805162461bcd60e51b8152602060048201526013602482015272115e18d959591cc81513d2d15397d312535255606a1b604482015290519081900360640190fd5b60005b8181101561143b57600a80546001019055611d0d3361227b565b50600101611cf3565b60008181526001602052604090205460609082906001600160a01b0316611d75576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103a37b5b2b71760911b604482015290519081900360640190fd5b612723611d81846126fb565b6040516020018083805460018160011615610100020316600290048015611ddf5780601f10611dbd576101008083540402835291820191611ddf565b820191906000526020600020905b815481529060010190602001808311611dcb575b5050825160208401908083835b60208310611e0b5780518252601f199092019160209182019101611dec565b6001836020036101000a03801982511681845116808217855250505050505090500192505050604051602081830303815290604052915050919050565b6127216020526000908152604090205481565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205460ff1690565b612723805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610f4f5780601f10610f2457610100808354040283529160200191610f4f565b6000818152600160205260409020546001600160a01b0316611f06826127d6565b611f10818361239e565b611f1a838361250f565b81836001600160a01b0316826001600160a01b03166000805160206129e083398151915260405160405180910390a4505050565b60008281526001602052604090205482906001600160a01b031633811480611f8c57506000828152600260205260409020546001600160a01b031633145b80611fba57506001600160a01b038116600090815260036020908152604080832033845290915290205460ff165b611ffe576040805162461bcd60e51b815260206004820152601060248201526f21b0b73737ba103a3930b739b332b91760811b604482015290519081900360640190fd5b60008481526001602052604090205484906001600160a01b031661205a576040805162461bcd60e51b815260206004820152600e60248201526d24b73b30b634b2103a37b5b2b71760911b604482015290519081900360640190fd5b6000858152600160205260409020546001600160a01b0390811690881681146120bd576040805162461bcd60e51b815260206004820152601060248201526f24b731b7b93932b1ba1037bbb732b91760811b604482015290519081900360640190fd5b6001600160a01b0387166120d057600080fd5b6120da8787611ee5565b6120e387612813565b15612209576000876001600160a01b031663150b7a02338b8a8a6040518563ffffffff1660e01b815260040180856001600160a01b03168152602001846001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561216d578181015183820152602001612155565b50505050905090810190601f16801561219a5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156121bc57600080fd5b505af11580156121d0573d6000803e3d6000fd5b505050506040513d60208110156121e657600080fd5b505190506001600160e01b03198116630a85bd0160e11b1461220757600080fd5b505b5050505050505050565b60008282111561222257600080fd5b50900390565b6001600160a01b031660009081526004602052604090205490565b81810182811015610dff57600080fd5b60008261226257506000610dff565b508181028183828161227057fe5b0414610dff57600080fd5b60006001600160a01b0382166122ce576040805162461bcd60e51b815260206004820152601360248201527221b0b73737ba1036b4b73a103a3790183c181760691b604482015290519081900360640190fd5b6127106009541061231d576040805162461bcd60e51b81526020600482015260146024820152732a37b5b2b7103634b6b4ba103932b0b1b432b21760611b604482015290519081900360640190fd5b6000612327612819565b600980546001019055905061233c838261250f565b6040516001600160a01b0384169082907ff3cea5493d790af0133817606f7350a91d7f154ea52eaa79d179d4d231e5010290600090a360405181906001600160a01b038516906000906000805160206129e0833981519152908290a492915050565b6000818152600160205260409020546001600160a01b038381169116146123ff576040805162461bcd60e51b815260206004820152601060248201526f24b731b7b93932b1ba1037bbb732b91760811b604482015290519081900360640190fd5b600081815260016020818152604080842080546001600160a01b031916905560058252808420546001600160a01b038716855260049092528320549092916124479190612213565b90508181146124d2576001600160a01b038416600090815260046020526040812080548390811061247457fe5b906000526020600020015490508060046000876001600160a01b03166001600160a01b0316815260200190815260200160002084815481106124b257fe5b600091825260208083209091019290925591825260059052604090208290555b6001600160a01b03841660009081526004602052604090208054806124f357fe5b6001900381819060005260206000200160009055905550505050565b6000818152600160205260409020546001600160a01b031615612579576040805162461bcd60e51b815260206004820152601a60248201527f43616e6e6f74206164642c20616c7265616479206f776e65642e000000000000604482015290519081900360640190fd5b600081815260016020818152604080842080546001600160a01b0319166001600160a01b038816908117909155808552600483529084208054808501825581865292852090920185905590925290546125d191612213565b6000918252600560205260409091205550565b60006001600160a01b038316612637576040805162461bcd60e51b815260206004820152601360248201527221b0b73737ba1036b4b73a103a3790183c181760691b604482015290519081900360640190fd5b61271060095410612686576040805162461bcd60e51b81526020600482015260146024820152732a37b5b2b7103634b6b4ba103932b0b1b432b21760611b604482015290519081900360640190fd5b600980546001019055612699838361250f565b6040516001600160a01b0384169083907ff3cea5493d790af0133817606f7350a91d7f154ea52eaa79d179d4d231e5010290600090a360405182906001600160a01b038516906000906000805160206129e0833981519152908290a450919050565b60608161272057506040805180820190915260018152600360fc1b602082015261093b565b8160005b811561273857600101600a82049150612724565b60008167ffffffffffffffff8111801561275157600080fd5b506040519080825280601f01601f19166020018201604052801561277c576020820181803683370190505b50859350905060001982015b83156127cd57600a840660300160f81b828280600190039350815181106127ab57fe5b60200101906001600160f81b031916908160001a905350600a84049350612788565b50949350505050565b6000818152600260205260409020546001600160a01b03161561281057600081815260026020526040902080546001600160a01b03191690555b50565b3b151590565b600954600f54604080516020808201939093523360601b818301524460548201524260748083019190915282518083039091018152609490910190915280519101206000916127100390829082908161286e57fe5b0690506000601082612710811061288157fe5b01541561289f57601082612710811061289657fe5b015490506128a2565b50805b60106001840361271081106128b357fe5b01546128d2576001830360108361271081106128cb57fe5b01556128f6565b60106001840361271081106128e357fe5b015460108361271081106128f357fe5b01555b600f8054600190810190915561290d908290612243565b935050505090565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928261294b5760008555612991565b82601f1061296457805160ff1916838001178555612991565b82800160010185558215612991579182015b82811115612991578251825591602001919060010190612976565b5061299d9291506129a1565b5090565b5b8082111561299d57600081556001016129a256fe596f752063616e206e6f7420627579206d6f7265207468616e203230204e465473206174206f6e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220d9f744f2c061ea362a370ae78f9df63b08041c8f7cd6be800e48f52f64748bf964736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
6,696
0x8f369AE35Bce72a50f1188B96D516fAb425511C9
// SPDX-License-Identifier: MIT /** *Submitted for verification at arbiscan.io on 2021-09-08 */ //SPDX-License-Identifier: MIT // File: @openzeppelin/contracts/ownership/Ownable.sol pragma solidity ^0.8.0; /** * @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 { address public owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner, '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 { _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; } } 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 StakedTokenWrapper { uint256 public totalSupply; mapping(address => uint256) private _balances; IERC20 public stakedToken; event Staked(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); function balanceOf(address account) public view returns (uint256) { return _balances[account]; } string constant _transferErrorMessage = 'staked token transfer failed'; function stakeFor(address forWhom, uint128 amount) public payable virtual { IERC20 st = stakedToken; if (st == IERC20(address(0))) { //eth unchecked { totalSupply += msg.value; _balances[forWhom] += msg.value; } } else { require(msg.value == 0, 'non-zero eth'); require(amount > 0, 'Cannot stake 0'); require( st.transferFrom(msg.sender, address(this), amount), _transferErrorMessage ); unchecked { totalSupply += amount; _balances[forWhom] += amount; } } emit Staked(forWhom, amount); } function withdraw(uint128 amount) public virtual { require(amount <= _balances[msg.sender], 'withdraw: balance is lower'); unchecked { _balances[msg.sender] -= amount; totalSupply = totalSupply - amount; } IERC20 st = stakedToken; if (st == IERC20(address(0))) { //eth (bool success, ) = msg.sender.call{ value: amount }(''); require(success, 'eth transfer failure'); } else { require( stakedToken.transfer(msg.sender, amount), _transferErrorMessage ); } emit Withdrawn(msg.sender, amount); } } contract StackPoolTwo is StakedTokenWrapper, Ownable { IERC20 public rewardToken; uint256 public rewardRate; uint64 public periodFinish; uint64 public lastUpdateTime; uint128 public rewardPerTokenStored; struct UserRewards { uint128 userRewardPerTokenPaid; uint128 rewards; } mapping(address => UserRewards) public userRewards; event RewardAdded(uint256 reward); event RewardPaid(address indexed user, uint256 reward); constructor(IERC20 _rewardToken, IERC20 _stakedToken) { rewardToken = _rewardToken; stakedToken = _stakedToken; } modifier updateReward(address account) { uint128 _rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); rewardPerTokenStored = _rewardPerTokenStored; userRewards[account].rewards = earned(account); userRewards[account].userRewardPerTokenPaid = _rewardPerTokenStored; _; } function lastTimeRewardApplicable() public view returns (uint64) { uint64 blockTimestamp = uint64(block.timestamp); return blockTimestamp < periodFinish ? blockTimestamp : periodFinish; } function rewardPerToken() public view returns (uint128) { uint256 totalStakedSupply = totalSupply; if (totalStakedSupply == 0) { return rewardPerTokenStored; } unchecked { uint256 rewardDuration = lastTimeRewardApplicable() - lastUpdateTime; return uint128( rewardPerTokenStored + (rewardDuration * rewardRate * 1e18) / totalStakedSupply ); } } function earned(address account) public view returns (uint128) { unchecked { return uint128( (balanceOf(account) * (rewardPerToken() - userRewards[account].userRewardPerTokenPaid)) / 1e18 + userRewards[account].rewards ); } } function stake(uint128 amount) external payable { stakeFor(msg.sender, amount); } function stakeFor(address forWhom, uint128 amount) public payable override updateReward(forWhom) { super.stakeFor(forWhom, amount); } function withdraw(uint128 amount) public override updateReward(msg.sender) { super.withdraw(amount); } function exit() external { getReward(); withdraw(uint128(balanceOf(msg.sender))); } function getReward() public updateReward(msg.sender) { uint256 reward = earned(msg.sender); if (reward > 0) { userRewards[msg.sender].rewards = 0; require( rewardToken.transfer(msg.sender, reward), 'reward transfer failed' ); emit RewardPaid(msg.sender, reward); } } function setRewardParams(uint128 reward, uint64 duration) external onlyOwner { unchecked { require(reward > 0); rewardPerTokenStored = rewardPerToken(); uint64 blockTimestamp = uint64(block.timestamp); uint256 maxRewardSupply = rewardToken.balanceOf(address(this)); if (rewardToken == stakedToken) maxRewardSupply -= totalSupply; uint256 leftover = 0; if (blockTimestamp >= periodFinish) { rewardRate = reward / duration; } else { uint256 remaining = periodFinish - blockTimestamp; leftover = remaining * rewardRate; rewardRate = (reward + leftover) / duration; } require(reward + leftover <= maxRewardSupply, 'not enough tokens'); lastUpdateTime = blockTimestamp; periodFinish = blockTimestamp + duration; emit RewardAdded(reward); } } function withdrawReward() external onlyOwner { uint256 rewardSupply = rewardToken.balanceOf(address(this)); //ensure funds staked by users can't be transferred out if (rewardToken == stakedToken) rewardSupply -= totalSupply; require(rewardToken.transfer(msg.sender, rewardSupply)); rewardRate = 0; periodFinish = uint64(block.timestamp); } } /* ____ __ __ __ _ / __/__ __ ___ / /_ / / ___ / /_ (_)__ __ _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ / /___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\ /___/ * Synthetix: YFIRewards.sol * * Docs: https://docs.synthetix.io/ * * * MIT License * =========== * * Copyright (c) 2020 Synthetix * * 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 */
0x6080604052600436106101045760003560e01c80628cc2621461010957806302387a7b1461013f5780630660f1e81461016157806318160ddd146101c25780633d18b912146101e657806370458d85146101fb57806370a082311461020e578063715018a61461022e5780637b0a47ee1461024357806380faa57d1461025957806388fe2be81461028657806389ee4bde146102995780638da5cb5b146102b9578063c885bc58146102e6578063c8f33c91146102fb578063cc7a262e14610322578063cd3daf9d14610342578063df136d6514610357578063e9fad8ee1461037e578063ebe2b12b14610393578063f2fde38b146103b3578063f7c618c1146103d3575b600080fd5b34801561011557600080fd5b50610129610124366004611262565b6103f3565b60405161013691906113fd565b60405180910390f35b34801561014b57600080fd5b5061015f61015a3660046112d5565b610468565b005b34801561016d57600080fd5b506101a261017c366004611262565b6007602052600090815260409020546001600160801b0380821691600160801b90041682565b604080516001600160801b03938416815292909116602083015201610136565b3480156101ce57600080fd5b506101d860005481565b604051908152602001610136565b3480156101f257600080fd5b5061015f610507565b61015f610209366004611283565b6106d6565b34801561021a57600080fd5b506101d8610229366004611262565b610777565b34801561023a57600080fd5b5061015f610792565b34801561024f57600080fd5b506101d860055481565b34801561026557600080fd5b5061026e6107f4565b6040516001600160401b039091168152602001610136565b61015f6102943660046112d5565b610828565b3480156102a557600080fd5b5061015f6102b43660046112ef565b610835565b3480156102c557600080fd5b506003546102d9906001600160a01b031681565b6040516101369190611348565b3480156102f257600080fd5b5061015f610aaa565b34801561030757600080fd5b5060065461026e90600160401b90046001600160401b031681565b34801561032e57600080fd5b506002546102d9906001600160a01b031681565b34801561034e57600080fd5b50610129610c31565b34801561036357600080fd5b5060065461012990600160801b90046001600160801b031681565b34801561038a57600080fd5b5061015f610cc6565b34801561039f57600080fd5b5060065461026e906001600160401b031681565b3480156103bf57600080fd5b5061015f6103ce366004611262565b610cdc565b3480156103df57600080fd5b506004546102d9906001600160a01b031681565b6001600160a01b0381166000908152600760205260408120546001600160801b03600160801b8204811691670de0b6b3a76400009116610431610c31565b036001600160801b031661044485610777565b028161046057634e487b7160e01b600052601260045260246000fd5b040192915050565b336000610473610c31565b905061047d6107f4565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b029190911693909116929092179190911790556104be826103f3565b6001600160a01b03831660009081526007602052604090206001600160801b038381169216600160801b026001600160801b03191691909117905561050283610d0f565b505050565b336000610512610c31565b905061051c6107f4565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b0291909116939091169290921791909117905561055d826103f3565b6001600160a01b03831660009081526007602052604081206001600160801b038481169316600160801b026001600160801b031916929092179091556105a2336103f3565b6001600160801b03169050801561050257336000818152600760205260409081902080546001600160801b0316905560048054915163a9059cbb60e01b81526001600160a01b039092169263a9059cbb926105ff9286910161135c565b602060405180830381600087803b15801561061957600080fd5b505af115801561062d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065191906112b5565b61069b5760405162461bcd60e51b81526020600482015260166024820152751c995dd85c99081d1c985b9cd9995c8819985a5b195960521b60448201526064015b60405180910390fd5b60405181815233907fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486906020015b60405180910390a2505050565b8160006106e1610c31565b90506106eb6107f4565b600680546001600160801b03808516600160801b026001600160401b03948516600160401b0291909116939091169290921791909117905561072c826103f3565b6001600160a01b03831660009081526007602052604090206001600160801b038381169216600160801b026001600160801b0319169190911790556107718484610f70565b50505050565b6001600160a01b031660009081526001602052604090205490565b6003546001600160a01b031633146107bc5760405162461bcd60e51b8152600401610692906113c8565b6003546040516000916001600160a01b031690600080516020611435833981519152908390a3600380546001600160a01b0319169055565b60065460009042906001600160401b0390811690821610610820576006546001600160401b0316610822565b805b91505090565b61083233826106d6565b50565b6003546001600160a01b0316331461085f5760405162461bcd60e51b8152600401610692906113c8565b6000826001600160801b03161161087557600080fd5b61087d610c31565b600680546001600160801b03928316600160801b029216919091179055600480546040516370a0823160e01b815242926000926001600160a01b0316916370a08231916108cc91309101611348565b60206040518083038186803b1580156108e457600080fd5b505afa1580156108f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091c9190611330565b6002546004549192506001600160a01b039182169116141561093e5760005490035b6006546000906001600160401b039081169084161061099857836001600160401b0316856001600160801b03168161098657634e487b7160e01b600052601260045260246000fd5b046001600160801b03166005556109e2565b506006546005546001600160401b0391821684900382169081029185166001600160801b0387168301816109dc57634e487b7160e01b600052601260045260246000fd5b04600555505b8181866001600160801b0316011115610a315760405162461bcd60e51b81526020600482015260116024820152706e6f7420656e6f75676820746f6b656e7360781b6044820152606401610692565b600680546001600160801b031916600160401b6001600160401b03808716919091026001600160401b03191691909117858701919091161790556040517fde88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d90610a9b9087906113fd565b60405180910390a15050505050565b6003546001600160a01b03163314610ad45760405162461bcd60e51b8152600401610692906113c8565b600480546040516370a0823160e01b81526000926001600160a01b03909216916370a0823191610b0691309101611348565b60206040518083038186803b158015610b1e57600080fd5b505afa158015610b32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b569190611330565b6002546004549192506001600160a01b0391821691161415610b8257600054610b7f9082611411565b90505b6004805460405163a9059cbb60e01b81526001600160a01b039091169163a9059cbb91610bb391339186910161135c565b602060405180830381600087803b158015610bcd57600080fd5b505af1158015610be1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0591906112b5565b610c0e57600080fd5b506000600555600680546001600160401b031916426001600160401b0316179055565b6000805480610c52575050600654600160801b90046001600160801b031690565b600654600090600160401b90046001600160401b0316610c706107f4565b036001600160401b03169050816005548202670de0b6b3a76400000281610ca757634e487b7160e01b600052601260045260246000fd5b6006546001600160801b03600160801b90910416919004019392505050565b610cce610507565b610cda61015a33610777565b565b6003546001600160a01b03163314610d065760405162461bcd60e51b8152600401610692906113c8565b61083281611180565b336000908152600160205260409020546001600160801b0382161115610d745760405162461bcd60e51b815260206004820152601a6024820152793bb4ba34323930bb9d103130b630b731b29034b9903637bbb2b960311b6044820152606401610692565b33600090815260016020526040812080546001600160801b0384169081900390915581540390556002546001600160a01b031680610e4a5760405160009033906001600160801b038516908381818185875af1925050503d8060008114610df7576040519150601f19603f3d011682016040523d82523d6000602084013e610dfc565b606091505b5050905080610e445760405162461bcd60e51b8152602060048201526014602482015273657468207472616e73666572206661696c75726560601b6044820152606401610692565b50610f2b565b60025460405163a9059cbb60e01b81523360048201526001600160801b03841660248201526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610e9e57600080fd5b505af1158015610eb2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ed691906112b5565b6040518060400160405280601c81526020017b1cdd185ad959081d1bdad95b881d1c985b9cd9995c8819985a5b195960221b81525090610f295760405162461bcd60e51b81526004016106929190611375565b505b336001600160a01b03167f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d583604051610f6491906113fd565b60405180910390a25050565b6002546001600160a01b031680610fad57600080543490810182556001600160a01b03851682526001602052604090912080549091019055611147565b3415610fea5760405162461bcd60e51b815260206004820152600c60248201526b0dcdedc5af4cae4de40cae8d60a31b6044820152606401610692565b6000826001600160801b0316116110345760405162461bcd60e51b815260206004820152600e60248201526d043616e6e6f74207374616b6520360941b6044820152606401610692565b6040516323b872dd60e01b81523360048201523060248201526001600160801b03831660448201526001600160a01b038216906323b872dd90606401602060405180830381600087803b15801561108a57600080fd5b505af115801561109e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c291906112b5565b6040518060400160405280601c81526020017b1cdd185ad959081d1bdad95b881d1c985b9cd9995c8819985a5b195960221b815250906111155760405162461bcd60e51b81526004016106929190611375565b50600080546001600160801b03841690810182556001600160a01b038516825260016020526040909120805490910190555b826001600160a01b03167f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d836040516106c991906113fd565b6001600160a01b0381166111e55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610692565b6003546040516001600160a01b0380841692169060008051602061143583398151915290600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b038116811461124657600080fd5b919050565b80356001600160801b038116811461124657600080fd5b600060208284031215611273578081fd5b61127c8261122f565b9392505050565b60008060408385031215611295578081fd5b61129e8361122f565b91506112ac6020840161124b565b90509250929050565b6000602082840312156112c6578081fd5b8151801515811461127c578182fd5b6000602082840312156112e6578081fd5b61127c8261124b565b60008060408385031215611301578182fd5b61130a8361124b565b915060208301356001600160401b0381168114611325578182fd5b809150509250929050565b600060208284031215611341578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6000602080835283518082850152825b818110156113a157858101830151858201604001528201611385565b818111156113b25783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6001600160801b0391909116815260200190565b60008282101561142f57634e487b7160e01b81526011600452602481fd5b50039056fe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a26469706673582212202d28dcbe71d2dfbe83e353f2c46884365b66ab6f439c2d39a77293361af34b5064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
6,697
0xa9b63bc06de5735a2d05bf3f6e47081c6410b823
pragma solidity ^0.5.0; // // Copyright 2017 Christian Reitwiessner // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // 2019 OKIMS // ported to solidity 0.5 // fixed linter warnings // added requiere error messages // library Pairing { struct G1Point { uint256 X; uint256 Y; } // Encoding of field elements is: X[0] * z + X[1] struct G2Point { uint256[2] X; uint256[2] Y; } /// @return the generator of G1 function P1() internal pure returns (G1Point memory) { return G1Point(1, 2); } /// @return the generator of G2 function P2() internal pure returns (G2Point memory) { // Original code point return G2Point( [ 11559732032986387107991004021392285783925812861821192530917403151452391805634, 10857046999023057135944570762232829481370756359578518086990519993285655852781 ], [ 4082367875863433681332203403145435568316851327593401208105741076214120093531, 8495653923123431417604973247489272438418190587263600148770280649306958101930 ] ); /* // Changed by Jordi point return G2Point( [10857046999023057135944570762232829481370756359578518086990519993285655852781, 11559732032986387107991004021392285783925812861821192530917403151452391805634], [8495653923123431417604973247489272438418190587263600148770280649306958101930, 4082367875863433681332203403145435568316851327593401208105741076214120093531] ); */ } /// @return the negation of p, i.e. p.addition(p.negate()) should be zero. function negate(G1Point memory p) internal pure returns (G1Point memory) { // The prime q in the base field F_q for G1 uint256 q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; if (p.X == 0 && p.Y == 0) return G1Point(0, 0); return G1Point(p.X, q - (p.Y % q)); } /// @return the sum of two points of G1 function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) { uint256[4] memory input; input[0] = p1.X; input[1] = p1.Y; input[2] = p2.X; input[3] = p2.Y; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas, 2000), 6, input, 0xc0, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success, "pairing-add-failed"); } /// @return the product of a point on G1 and a scalar, i.e. /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p. function scalar_mul(G1Point memory p, uint256 s) internal view returns (G1Point memory r) { uint256[3] memory input; input[0] = p.X; input[1] = p.Y; input[2] = s; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall(sub(gas, 2000), 7, input, 0x80, r, 0x60) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success, "pairing-mul-failed"); } /// @return the result of computing the pairing check /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1 /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should /// return true. function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) { require(p1.length == p2.length, "pairing-lengths-failed"); uint256 elements = p1.length; uint256 inputSize = elements * 6; uint256[] memory input = new uint256[](inputSize); for (uint256 i = 0; i < elements; i++) { input[i * 6 + 0] = p1[i].X; input[i * 6 + 1] = p1[i].Y; input[i * 6 + 2] = p2[i].X[0]; input[i * 6 + 3] = p2[i].X[1]; input[i * 6 + 4] = p2[i].Y[0]; input[i * 6 + 5] = p2[i].Y[1]; } uint256[1] memory out; bool success; // solium-disable-next-line security/no-inline-assembly assembly { success := staticcall( sub(gas, 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20 ) // Use "invalid" to make gas estimation work switch success case 0 { invalid() } } require(success, "pairing-opcode-failed"); return out[0] != 0; } /// Convenience method for a pairing check for two pairs. function pairingProd2( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](2); G2Point[] memory p2 = new G2Point[](2); p1[0] = a1; p1[1] = b1; p2[0] = a2; p2[1] = b2; return pairing(p1, p2); } /// Convenience method for a pairing check for three pairs. function pairingProd3( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](3); G2Point[] memory p2 = new G2Point[](3); p1[0] = a1; p1[1] = b1; p1[2] = c1; p2[0] = a2; p2[1] = b2; p2[2] = c2; return pairing(p1, p2); } /// Convenience method for a pairing check for four pairs. function pairingProd4( G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2, G1Point memory c1, G2Point memory c2, G1Point memory d1, G2Point memory d2 ) internal view returns (bool) { G1Point[] memory p1 = new G1Point[](4); G2Point[] memory p2 = new G2Point[](4); p1[0] = a1; p1[1] = b1; p1[2] = c1; p1[3] = d1; p2[0] = a2; p2[1] = b2; p2[2] = c2; p2[3] = d2; return pairing(p1, p2); } } contract withdrawVerifier { using Pairing for *; struct VerifyingKey { Pairing.G1Point alfa1; Pairing.G2Point beta2; Pairing.G2Point gamma2; Pairing.G2Point delta2; Pairing.G1Point[] IC; } struct Proof { Pairing.G1Point A; Pairing.G2Point B; Pairing.G1Point C; } function verifyingKey() internal pure returns (VerifyingKey memory vk) { vk.alfa1 = Pairing.G1Point( 16954158942519728638790634699427502617277811890854188736964569712256402108874, 4853887341475411689162752814686977828753659238758624904436464399911233181789 ); vk.beta2 = Pairing.G2Point( [ 3553796587147707868221401440330653878464553447974048256338484083403880871279, 10881436069977331413254194381426315885919138028604310586524088533501358955109 ], [ 554219737543102952744483611874143077462185705309891806989145488801073306271, 9409363920473337588801036819699444134753219954517443484334340645716975900537 ] ); vk.gamma2 = Pairing.G2Point( [ 15835396745809302047857962237408016564677757264735411961895464204275479520101, 4816274361064561217008158949208603992562463552030076130951138882879237876002 ], [ 2657349449553812953795906111583580858867466816674108494349782884813347200025, 10043126501350062935275553474943176726930010914443447816353590070970104772515 ] ); vk.delta2 = Pairing.G2Point( [ 7283580813474622247301806821610231208877772213155618212591703595233267096250, 11707105533135571906914329788444133953060232994662578417597467150398664744282 ], [ 11385749369626680203331401051634580287991672919300551086583617479169513319496, 9611313099024018606232043820986775911468148051140788277551879224697364709191 ] ); vk.IC = new Pairing.G1Point[](8); vk.IC[0] = Pairing.G1Point( 12912565231570889910296955037854848460681054044597840719031679724966236302695, 1618290591174934914130771757973446200900756859557159243491129510642659761181 ); vk.IC[1] = Pairing.G1Point( 14778611837533504514462554570414181360183580929421850888807508102557719724615, 18010365132546690092942406451855070395143860207861052154579931039970828688716 ); vk.IC[2] = Pairing.G1Point( 21842787128839192035269608458300323973858943522443094029988883807219296675218, 12504530341877947596737738199189848566124046550837184854102649615969596397710 ); vk.IC[3] = Pairing.G1Point( 6702350553342235510040006320179244922766468286016493815181054142373284636503, 486510446745553771235793685582506026986002715740751589906965686550863923665 ); vk.IC[4] = Pairing.G1Point( 18295456844681697070812504315172403847139068061461697796154812408892341354744, 8586956606144774575262691355503600322190462693290841310821014264086165739962 ); vk.IC[5] = Pairing.G1Point( 583165178558506337090803701407321068723888683963870553226798646114777438216, 16564448870558779800710568686173987093691200356730792766741354916477305724325 ); vk.IC[6] = Pairing.G1Point( 16894163527567693999351074375562429490067504929935444794046770610649488194723, 6179936640197458957487209685456022255962630517225960304292326023613578579249 ); vk.IC[7] = Pairing.G1Point( 2216753407676926432149475364826467911082264085961142066747165279038767234108, 5023177841759340865723216108966485654591090628700583521267084598058245799942 ); } function verify(uint256[] memory input, Proof memory proof) internal view returns (uint256) { uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617; VerifyingKey memory vk = verifyingKey(); require(input.length + 1 == vk.IC.length, "verifier-bad-input"); // Compute the linear combination vk_x Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0); for (uint256 i = 0; i < input.length; i++) { require( input[i] < snark_scalar_field, "verifier-gte-snark-scalar-field" ); vk_x = Pairing.addition( vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]) ); } vk_x = Pairing.addition(vk_x, vk.IC[0]); if ( !Pairing.pairingProd4( Pairing.negate(proof.A), proof.B, vk.alfa1, vk.beta2, vk_x, vk.gamma2, proof.C, vk.delta2 ) ) return 1; return 0; } function verifyProof( uint256[2] memory a, uint256[2][2] memory b, uint256[2] memory c, uint256[7] memory input ) public view returns (bool r) { Proof memory proof; proof.A = Pairing.G1Point(a[0], a[1]); proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]); proof.C = Pairing.G1Point(c[0], c[1]); uint256[] memory inputValues = new uint256[](input.length); for (uint256 i = 0; i < input.length; i++) { inputValues[i] = input[i]; } if (verify(inputValues, proof) == 0) { return true; } else { return false; } } function verifyProof(bytes calldata proof, uint256[7] calldata inputs) external view returns (bool r) { // solidity does not support decoding uint[2][2] yet ( uint256[2] memory a, uint256[2] memory b1, uint256[2] memory b2, uint256[2] memory c ) = abi.decode(proof, (uint256[2], uint256[2], uint256[2], uint256[2])); return verifyProof(a, [b1, b2], c, inputs); } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063598da1d11461003b578063c894e757146100bf575b600080fd5b6100ab600480360361010081101561005257600080fd5b81019060208101813564010000000081111561006d57600080fd5b82018360208201111561007f57600080fd5b803590602001918460018302840111640100000000831117156100a157600080fd5b91935091506101bb565b604080519115158252519081900360200190f35b6100ab60048036036101e08110156100d657600080fd5b6040805180820182529183019291818301918390600290839083908082843760009201829052506040805180820190915293969594608081019493509150600290835b828210156101575760408051808201825290808402860190600290839083908082843760009201919091525050508152600190910190602001610119565b50506040805180820182529396959481810194935091506002908390839080828437600092019190915250506040805160e0818101909252929594938181019392509060079083908390808284376000920191909152509194506102f49350505050565b60006101c5611186565b6101cd611186565b6101d5611186565b6101dd611186565b87876101008110156101ee57600080fd5b604080518082018252918301929181830191839060029083908390808284376000920191909152505060408051808201825292959493818101939250906002908390839080828437600092019190915250506040805180820182529295949381810193925090600290839083908082843760009201919091525050604080518082018252929594938181019392509060029083908390808284376000920191909152505060408051808201825288815260208101889052815160e0818101909352999d50979b509599509097506102e8968b96958995509093508d92506007915083908390808284376000920191909152506102f4915050565b98975050505050505050565b60006102fe6111a4565b60408051808201825287518152602080890151818301529083528151608081018352875151818401908152885183015160608084019190915290825283518085018552898401805151825251840151818501528284015284830191909152825180840184528751815287830151818401528484015282516007808252610100820190945290929091820160e08038833901905050905060005b60078110156103d0578481600781106103ac57fe5b60200201518282815181106103bd57fe5b6020908102919091010152600101610397565b506103db81836103f9565b6103ea576001925050506103f1565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000016104246111d6565b61042c6105d1565b9050806080015151855160010114610480576040805162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b604482015290519081900360640190fd5b61048861121d565b50604080518082019091526000808252602082018190525b865181101561055a57838782815181106104b657fe5b602002602001015110610510576040805162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c6400604482015290519081900360640190fd5b6105508261054b8560800151846001018151811061052a57fe5b60200260200101518a858151811061053e57fe5b6020026020010151610bfb565b610c90565b91506001016104a0565b5061057d81836080015160008151811061057057fe5b6020026020010151610c90565b90506105b361058f8660000151610d21565b8660200151846000015185602001518587604001518b604001518960600151610dad565b6105c357600193505050506105cb565b600093505050505b92915050565b6105d96111d6565b6040805180820182527f257bb6c24b134cf4f11e5a5aa215ade644e8072caeba95867b05fd3a6798b1ca81527f0abb33efd14404bfd26f4785b36d4d3d7acc2464b2e6fbf32670f81a5a16d85d6020808301919091529083528151608080820184527f07db60a997e93909b643f87a662ddada9ce1aacccc865bd95a6a0344c403356f8285019081527f180eacaffd9fbf49436f20dc26cac1f8ffa058ec7fa7a179cfcaeed1ac28da65606080850191909152908352845180860186527f0139ad6097e0b42f682d1e5bc6dea5236a07ae912e3772afa907869b6ed99a9f81527f14cd82e1475cd2dc0e1cc12be1300a7b75cb32c5105982aa070babbd78935779818601528385015285840192909252835180820185527f2302845614d1054bc37e09ab9d20049dc7dfbbe8293341846c687706bf68a3658186019081527f0aa5ea28d5a78f50f32b89ac95c56b46ef1166b46d00e7ee4dfc501b08176922828501528152845180860186527f05e001a93a654f5422aa5b19224b207939ac26fc9402dd544783780087af9c1981527f16343549e8ce1bc9831b03e549f1887bb09fc4a0070e25213c882f094b4177a3818601528185015285850152835190810184527f101a5c53861085b0f66b2d02ae3bca6898f04b7bee68df5eb70f632536e71aba8185019081527f19e1fca680a5f10da78f1d5c911a82cac3e2f72c3487e3edbe539bf6f1ec1d5a828401528152835180850185527f192c1b13eb88356f23cbcab7d729f00f92b0e208a02bbc4c83b11f14a0876c4881527f153fcf78a17dba6a26872a2600b35f556a0a3413eede70a341c5f0f093887f47818501528184015290840152815160088082526101208201909352919082015b61085d61121d565b81526020019060019003908161085557505060808201908152604080518082019091527f1c8c40bfc7ec87e8a319b7229da3c9167526d99716a7774fe6252e6f3df6ad6781527f0393eb8624d3c7e3228722f2196e30bc3dbe9202477c98717457118b300a1c1d6020820152905180516000906108d657fe5b602002602001018190525060405180604001604052807f20ac65db43964bf64498bedd5a2a2a00fc637d373bc6356833d41a9acf96024781526020017f27d1816341f79de4e1bbfed546cbd205c91b97afa1f67635b79ca5d5ec5b1d4c815250816080015160018151811061094757fe5b602002602001018190525060405180604001604052807f304a9453aa1a4b6e4db5877f9dc777eac370a2890bae289c766b6503102aa59281526020017f1ba550388e36035642a49688927912d993bb67909eb9e7b1e43b21b16fced88e81525081608001516002815181106109b857fe5b602002602001018190525060405180604001604052807f0ed1655ef71784dbcb342d1c6e8c2d8701f2837a84ce11c39ee94e71c501675781526020017f01135aeb6a179f0c76cfbdd6b1cc60345c31f11e6cdef45aaa6e1bfb81a5c9d18152508160800151600381518110610a2957fe5b602002602001018190525060405180604001604052807f2872dc92944cc3cd299ce227f03a8ad7b9e7317154d9a1f44ba1383a9d0800f881526020017f12fc0b92978c1f1299a38a0a86699a1598854eb187d2fda10348788fbf6859ba8152508160800151600481518110610a9a57fe5b602002602001018190525060405180604001604052807f014a0f4eabf86c902a20c7035e9cc81a218437c8454c554e80dddef74076180881526020017f249f25545590b6001e1c2f1e228f60cad29b11d710c6231738aa4dd429f19da58152508160800151600581518110610b0b57fe5b602002602001018190525060405180604001604052807f2559c1f8abf69fec4d28cee7fedfd6d3ad98cf49c0ff20cf18b579d2eb187ca381526020017f0da9b85df77f880ec81529151a6c2b1b60b3231461f4e19f7ba93595ffcd8d318152508160800151600681518110610b7c57fe5b602002602001018190525060405180604001604052807f04e6a351be3d7a1baf8f017bfa6d9410697bf25b8d2b308ed6cdfdcf4695fc3c81526020017f0b1b0495776ce1787e65f884e73890c8409e71dc39c648c41fbaa35b0a59c0068152508160800151600781518110610bed57fe5b602002602001018190525090565b610c0361121d565b610c0b611237565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa9050808015610c3e57610c40565bfe5b5080610c88576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b604482015290519081900360640190fd5b505092915050565b610c9861121d565b610ca0611255565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa9050808015610c3e575080610c88576040805162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b604482015290519081900360640190fd5b610d2961121d565b81517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610d5c57506020830151155b15610d7c5750506040805180820190915260008082526020820152610da8565b60405180604001604052808460000151815260200182856020015181610d9e57fe5b0683038152509150505b919050565b60408051600480825260a0820190925260009160609190816020015b610dd161121d565b815260200190600190039081610dc957505060408051600480825260a0820190925291925060609190602082015b610e07611273565b815260200190600190039081610dff5790505090508a82600081518110610e2a57fe5b60200260200101819052508882600181518110610e4357fe5b60200260200101819052508682600281518110610e5c57fe5b60200260200101819052508482600381518110610e7557fe5b60200260200101819052508981600081518110610e8e57fe5b60200260200101819052508781600181518110610ea757fe5b60200260200101819052508581600281518110610ec057fe5b60200260200101819052508381600381518110610ed957fe5b6020026020010181905250610eee8282610efd565b9b9a5050505050505050505050565b60008151835114610f4e576040805162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b604482015290519081900360640190fd5b8251604080516006830280825260c084028201602001909252606090828015610f81578160200160208202803883390190505b50905060005b8381101561110657868181518110610f9b57fe5b602002602001015160000151828260060260000181518110610fb957fe5b602002602001018181525050868181518110610fd157fe5b602002602001015160200151828260060260010181518110610fef57fe5b60200260200101818152505085818151811061100757fe5b60209081029190910101515151825183906002600685020190811061102857fe5b60200260200101818152505085818151811061104057fe5b6020908102919091010151516001602002015182826006026003018151811061106557fe5b60200260200101818152505085818151811061107d57fe5b60200260200101516020015160006002811061109557fe5b60200201518282600602600401815181106110ac57fe5b6020026020010181815250508581815181106110c457fe5b6020026020010151602001516001600281106110dc57fe5b60200201518282600602600501815181106110f357fe5b6020908102919091010152600101610f87565b5061110f611293565b6000602082602086026020860160086107d05a03fa9050808015610c3e575080611178576040805162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b604482015290519081900360640190fd5b505115159695505050505050565b60405180604001604052806002906020820280388339509192915050565b60405180606001604052806111b761121d565b81526020016111c4611273565b81526020016111d161121d565b905290565b6040518060a001604052806111e961121d565b81526020016111f6611273565b8152602001611203611273565b8152602001611210611273565b8152602001606081525090565b604051806040016040528060008152602001600081525090565b60405180606001604052806003906020820280388339509192915050565b60405180608001604052806004906020820280388339509192915050565b6040518060400160405280611286611186565b81526020016111d1611186565b6040518060200160405280600190602082028038833950919291505056fea265627a7a723158206a457e6d01041c3a76eeefebca6f0e34fe3a121054e1a336d46480fad2a5cd0c64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,698
0xCA106916CA1f9C53442435036Edf9B137b381C90
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } library StringUtil { function equal(string memory a, string memory b) internal pure returns(bool){ return equal(bytes(a),bytes(b)); } function equal(bytes memory a, bytes memory b) internal pure returns(bool){ return keccak256(a) == keccak256(b); } function notEmpty(string memory a) internal pure returns(bool){ return bytes(a).length > 0; } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } contract WhiteList is Ownable{ mapping(address=>bool) public whiteList; event AddWhiteList(address account); event RemoveWhiteList(address account); modifier onlyWhiteList(){ require(whiteList[_msgSender()] == true, "not in white list"); _; } function addWhiteList(address account) public onlyOwner{ require(account != address(0), "address should not be 0"); whiteList[account] = true; emit AddWhiteList(account); } function removeWhiteList(address account) public onlyOwner{ whiteList[account] = false; emit RemoveWhiteList(account); } } contract FilChainStatOracle is WhiteList{ using StringUtil for string; using SafeMath for uint256; // all FIL related value use attoFil uint256 public sectorInitialPledge; // attoFil/TiB mapping(string=>uint256) public minerAdjustedPower; // TiB mapping(string=>uint256) public minerMiningEfficiency; // attoFil/GiB mapping(string=>uint256) public minerSectorInitialPledge; // attoFil/TiB /** TiB, the total adjusted power of all miners listed in the platform */ uint256 public minerTotalAdjustedPower; /** attoFil/GiB/24H, the avg mining efficiency of all miners listed on this platform of last 24 hours */ uint256 public avgMiningEfficiency; /** attoFil/24H, the total block rewards of last 24 hours of the the whole Filecoin network */ uint256 public latest24hBlockReward; uint256 public rewardAttenuationFactor; // *10000 uint256 public networkStoragePower; // TiB uint256 public dailyStoragePowerIncrease; //TiB event SectorInitialPledgeChanged(uint256 originalValue, uint256 newValue); event MinerSectorInitialPledgeChanged(string minerId, uint256 originalValue, uint256 newValue); event MinerAdjustedPowerChanged(string minerId, uint256 originalValue, uint256 newValue); event MinerMiningEfficiencyChanged(string minerId, uint256 originalValue, uint256 newValue); event AvgMiningEfficiencyChanged(uint256 originalValue, uint256 newValue); event Latest24hBlockRewardChanged(uint256 originalValue, uint256 newValue); event RewardAttenuationFactorChanged(uint256 originalValue, uint256 newValue); event NetworkStoragePowerChanged(uint256 originalValue, uint256 newValue); event DailyStoragePowerIncreaseChanged(uint256 originalValue, uint256 newValue); function setSectorInitialPledge(uint256 _sectorInitialPledge) public onlyWhiteList{ require(_sectorInitialPledge>0, "value should not be 0"); emit SectorInitialPledgeChanged(sectorInitialPledge, _sectorInitialPledge); sectorInitialPledge = _sectorInitialPledge; } function setMinerSectorInitialPledge(string memory _minerId, uint256 _minerSectorInitialPledge) public onlyWhiteList{ require(_minerSectorInitialPledge>0, "value should not be 0"); emit MinerSectorInitialPledgeChanged(_minerId, minerSectorInitialPledge[_minerId], _minerSectorInitialPledge); minerSectorInitialPledge[_minerId] = _minerSectorInitialPledge; } function setMinerSectorInitialPledgeBatch(string[] memory _minerIdList, uint256[] memory _minerSectorInitialPledgeList) public onlyWhiteList{ require(_minerIdList.length>0, "miner array should not be 0 length"); require(_minerSectorInitialPledgeList.length>0, "value array should not be 0 length"); require(_minerIdList.length == _minerSectorInitialPledgeList.length, "array length not equal"); for(uint i=0; i<_minerIdList.length; i++){ require(_minerSectorInitialPledgeList[i]>0, "value should not be 0"); emit MinerSectorInitialPledgeChanged(_minerIdList[i], minerSectorInitialPledge[_minerIdList[i]], _minerSectorInitialPledgeList[i]); minerSectorInitialPledge[_minerIdList[i]] = _minerSectorInitialPledgeList[i]; } } function setMinerAdjustedPower(string memory _minerId, uint256 _minerAdjustedPower) public onlyWhiteList{ require(_minerId.notEmpty(), "miner id should not be empty"); require(_minerAdjustedPower>0, "value should not be 0"); minerTotalAdjustedPower = minerTotalAdjustedPower.sub(minerAdjustedPower[_minerId]).add(_minerAdjustedPower); emit MinerAdjustedPowerChanged(_minerId, minerAdjustedPower[_minerId], _minerAdjustedPower); minerAdjustedPower[_minerId] = _minerAdjustedPower; } function setMinerAdjustedPowerBatch(string[] memory _minerIds, uint256[] memory _minerAdjustedPowers) public onlyWhiteList{ require(_minerIds.length == _minerAdjustedPowers.length, "minerId list count is not equal to power list"); for(uint i; i<_minerIds.length; i++){ require(_minerIds[i].notEmpty(), "miner id should not be empty"); require(_minerAdjustedPowers[i]>0, "value should not be 0"); minerTotalAdjustedPower = minerTotalAdjustedPower.sub(minerAdjustedPower[_minerIds[i]]).add(_minerAdjustedPowers[i]); emit MinerAdjustedPowerChanged(_minerIds[i], minerAdjustedPower[_minerIds[i]], _minerAdjustedPowers[i]); minerAdjustedPower[_minerIds[i]] = _minerAdjustedPowers[i]; } } function removeMinerAdjustedPower(string memory _minerId) public onlyWhiteList{ uint256 adjustedPower = minerAdjustedPower[_minerId]; minerTotalAdjustedPower = minerTotalAdjustedPower.sub(adjustedPower); delete minerAdjustedPower[_minerId]; emit MinerAdjustedPowerChanged(_minerId, adjustedPower, 0); } function setMinerMiningEfficiency(string memory _minerId, uint256 _minerMiningEfficiency) public onlyWhiteList{ require(_minerId.notEmpty(), "miner id should not be empty"); require(_minerMiningEfficiency>0, "value should not be 0"); emit MinerMiningEfficiencyChanged(_minerId, minerMiningEfficiency[_minerId], _minerMiningEfficiency); minerMiningEfficiency[_minerId] = _minerMiningEfficiency; } function setMinerMiningEfficiencyBatch(string[] memory _minerIds, uint256[] memory _minerMiningEfficiencys) public onlyWhiteList{ require(_minerIds.length == _minerMiningEfficiencys.length, "minerId list count is not equal to power list"); for(uint i; i<_minerIds.length; i++){ require(_minerIds[i].notEmpty(), "miner id should not be empty"); require(_minerMiningEfficiencys[i]>0, "value should not be 0"); emit MinerMiningEfficiencyChanged(_minerIds[i], minerMiningEfficiency[_minerIds[i]], _minerMiningEfficiencys[i]); minerMiningEfficiency[_minerIds[i]] = _minerMiningEfficiencys[i]; } } function setAvgMiningEfficiency(uint256 _avgMiningEfficiency) public onlyWhiteList{ require(_avgMiningEfficiency>0, "value should not be 0"); emit AvgMiningEfficiencyChanged(avgMiningEfficiency, _avgMiningEfficiency); avgMiningEfficiency = _avgMiningEfficiency; } function setLatest24hBlockReward(uint256 _latest24hBlockReward) public onlyWhiteList{ require(_latest24hBlockReward>0, "value should not be 0"); emit Latest24hBlockRewardChanged(latest24hBlockReward, _latest24hBlockReward); latest24hBlockReward = _latest24hBlockReward; } function setRewardAttenuationFactor(uint256 _rewardAttenuationFactor) public onlyWhiteList{ require(_rewardAttenuationFactor>0, "value should not be 0"); emit RewardAttenuationFactorChanged(rewardAttenuationFactor, _rewardAttenuationFactor); rewardAttenuationFactor = _rewardAttenuationFactor; } function setNetworkStoragePower(uint256 _networkStoragePower) public onlyWhiteList{ require(_networkStoragePower>0, "value should not be 0"); emit NetworkStoragePowerChanged(networkStoragePower, _networkStoragePower); networkStoragePower = _networkStoragePower; } function setDailyStoragePowerIncrease(uint256 _dailyStoragePowerIncrease) public onlyWhiteList{ require(_dailyStoragePowerIncrease>0, "value should not be 0"); emit DailyStoragePowerIncreaseChanged(dailyStoragePowerIncrease, _dailyStoragePowerIncrease); dailyStoragePowerIncrease = _dailyStoragePowerIncrease; } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80635e14d5d511610104578063cf494bf0116100a2578063e70b8f5611610071578063e70b8f56146103d5578063e7cd4a04146103de578063f2fde38b146103f1578063fb14562b1461040457600080fd5b8063cf494bf014610393578063da17f56a146103a6578063db1877f5146103b9578063e0468070146103cc57600080fd5b80639eb2b8ba116100de5780639eb2b8ba1461035b5780639fc616ee14610364578063af7bccc81461036d578063b27216a31461038057600080fd5b80635e14d5d514610325578063715018a6146103385780638da5cb5b1461034057600080fd5b8063373431bc1161017157806344ace91e1161014b57806344ace91e146102c157806346d038f5146102d45780634a1f4c5b146102e757806351bba7751461031257600080fd5b8063373431bc1461027a5780633811d8a3146102a55780633fa61897146102ae57600080fd5b80631d112fab116101ad5780631d112fab146102185780632042e5c21461022b5780632969d27f1461023e578063372c12b11461024757600080fd5b806301447e5d146101d4578063145960f4146101f05780631828429c14610205575b600080fd5b6101dd60065481565b6040519081526020015b60405180910390f35b6102036101fe36600461177f565b61042f565b005b6102036102133660046117ba565b61050b565b6102036102263660046117fd565b610635565b610203610239366004611685565b6106cb565b6101dd60075481565b61026a610255366004611685565b60016020526000908152604090205460ff1681565b60405190151581526020016101e7565b6101dd61028836600461177f565b805160208183018101805160058252928201919093012091525481565b6101dd600a5481565b6102036102bc3660046117fd565b61074d565b6102036102cf3660046117fd565b6107e3565b6102036102e23660046117ba565b610879565b6101dd6102f536600461177f565b805160208183018101805160038252928201919093012091525481565b6102036103203660046117ba565b610953565b6102036103333660046116ac565b610a0f565b610203610cc4565b6000546040516001600160a01b0390911681526020016101e7565b6101dd600b5481565b6101dd60025481565b61020361037b3660046116ac565b610cfa565b61020361038e3660046117fd565b610f31565b6102036103a13660046117fd565b610fc7565b6102036103b43660046116ac565b61105d565b6102036103c73660046117fd565b611336565b6101dd60095481565b6101dd60085481565b6102036103ec366004611685565b6113cc565b6102036103ff366004611685565b6114a1565b6101dd61041236600461177f565b805160208183018101805160048252928201919093012091525481565b3360009081526001602081905260409091205460ff1615151461046d5760405162461bcd60e51b8152600401610464906118cf565b60405180910390fd5b600060038260405161047f9190611841565b90815260200160405180910390205490506104a58160065461153c90919063ffffffff16565b6006556040516003906104b9908490611841565b9081526020016040518091039020600090557ff15a0b37d340c71c76d8e1f7cd2c6eae8de0fae6683eaa13061dbd1f31e258f0828260006040516104ff9392919061185d565b60405180910390a15050565b3360009081526001602081905260409091205460ff161515146105405760405162461bcd60e51b8152600401610464906118cf565b815161055e5760405162461bcd60e51b8152600401610464906118fa565b6000811161057e5760405162461bcd60e51b815260040161046490611931565b6105b4816105ae6003856040516105959190611841565b908152604051908190036020019020546006549061153c565b9061154f565b6006819055507ff15a0b37d340c71c76d8e1f7cd2c6eae8de0fae6683eaa13061dbd1f31e258f0826003846040516105ec9190611841565b908152604051908190036020018120546106089291859061185d565b60405180910390a1806003836040516106219190611841565b908152604051908190036020019020555050565b3360009081526001602081905260409091205460ff1615151461066a5760405162461bcd60e51b8152600401610464906118cf565b6000811161068a5760405162461bcd60e51b815260040161046490611931565b60025460408051918252602082018390527f6d1cb01342704ec3527e962d2c7b2ff671b40e2a36229cf08bb07e02a599ec64910160405180910390a1600255565b6000546001600160a01b031633146106f55760405162461bcd60e51b815260040161046490611960565b6001600160a01b038116600081815260016020908152604091829020805460ff1916905590519182527f1e17ee0599b7c09bb1d0ff1e8086007909da8bfba5c7d18319cb558e66db37ee91015b60405180910390a150565b3360009081526001602081905260409091205460ff161515146107825760405162461bcd60e51b8152600401610464906118cf565b600081116107a25760405162461bcd60e51b815260040161046490611931565b60085460408051918252602082018390527f154e68f6f37e38b031fa4bac858933af2c6c11e863bee7418d6dfe1f9c156c68910160405180910390a1600855565b3360009081526001602081905260409091205460ff161515146108185760405162461bcd60e51b8152600401610464906118cf565b600081116108385760405162461bcd60e51b815260040161046490611931565b600a5460408051918252602082018390527f0b88739224ca257753ad19037d2e8c55222bce7d42f3b1c2dd8a581fa7424a8c910160405180910390a1600a55565b3360009081526001602081905260409091205460ff161515146108ae5760405162461bcd60e51b8152600401610464906118cf565b81516108cc5760405162461bcd60e51b8152600401610464906118fa565b600081116108ec5760405162461bcd60e51b815260040161046490611931565b7f83bcedaf7f926405de3ef1d50fe5b19742038a8f91e10ae11a5d4955887119038260048460405161091e9190611841565b9081526040519081900360200181205461093a9291859061185d565b60405180910390a1806004836040516106219190611841565b3360009081526001602081905260409091205460ff161515146109885760405162461bcd60e51b8152600401610464906118cf565b600081116109a85760405162461bcd60e51b815260040161046490611931565b7f727a41e3b4b2a96286e1897fdff681b3c2898897551d4df8ed8e7448f02c5609826005846040516109da9190611841565b908152604051908190036020018120546109f69291859061185d565b60405180910390a1806005836040516106219190611841565b3360009081526001602081905260409091205460ff16151514610a445760405162461bcd60e51b8152600401610464906118cf565b8051825114610a655760405162461bcd60e51b815260040161046490611882565b60005b8251811015610cbf57610aa2838281518110610a9457634e487b7160e01b600052603260045260246000fd5b602002602001015151151590565b610abe5760405162461bcd60e51b8152600401610464906118fa565b6000828281518110610ae057634e487b7160e01b600052603260045260246000fd5b602002602001015111610b055760405162461bcd60e51b815260040161046490611931565b610b6a828281518110610b2857634e487b7160e01b600052603260045260246000fd5b60200260200101516105ae6003868581518110610b5557634e487b7160e01b600052603260045260246000fd5b60200260200101516040516105959190611841565b6006819055507ff15a0b37d340c71c76d8e1f7cd2c6eae8de0fae6683eaa13061dbd1f31e258f0838281518110610bb157634e487b7160e01b600052603260045260246000fd5b60200260200101516003858481518110610bdb57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051610bf09190611841565b908152602001604051809103902054848481518110610c1f57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051610c369392919061185d565b60405180910390a1818181518110610c5e57634e487b7160e01b600052603260045260246000fd5b60200260200101516003848381518110610c8857634e487b7160e01b600052603260045260246000fd5b6020026020010151604051610c9d9190611841565b9081526040519081900360200190205580610cb781611a49565b915050610a68565b505050565b6000546001600160a01b03163314610cee5760405162461bcd60e51b815260040161046490611960565b610cf8600061155b565b565b3360009081526001602081905260409091205460ff16151514610d2f5760405162461bcd60e51b8152600401610464906118cf565b8051825114610d505760405162461bcd60e51b815260040161046490611882565b60005b8251811015610cbf57610d7f838281518110610a9457634e487b7160e01b600052603260045260246000fd5b610d9b5760405162461bcd60e51b8152600401610464906118fa565b6000828281518110610dbd57634e487b7160e01b600052603260045260246000fd5b602002602001015111610de25760405162461bcd60e51b815260040161046490611931565b7f83bcedaf7f926405de3ef1d50fe5b19742038a8f91e10ae11a5d495588711903838281518110610e2357634e487b7160e01b600052603260045260246000fd5b60200260200101516004858481518110610e4d57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051610e629190611841565b908152602001604051809103902054848481518110610e9157634e487b7160e01b600052603260045260246000fd5b6020026020010151604051610ea89392919061185d565b60405180910390a1818181518110610ed057634e487b7160e01b600052603260045260246000fd5b60200260200101516004848381518110610efa57634e487b7160e01b600052603260045260246000fd5b6020026020010151604051610f0f9190611841565b9081526040519081900360200190205580610f2981611a49565b915050610d53565b3360009081526001602081905260409091205460ff16151514610f665760405162461bcd60e51b8152600401610464906118cf565b60008111610f865760405162461bcd60e51b815260040161046490611931565b60095460408051918252602082018390527f21150aa62b1b77998c5958e0ce35c4f39bbb7fa762c47ee07cab5c7c253ad10f910160405180910390a1600955565b3360009081526001602081905260409091205460ff16151514610ffc5760405162461bcd60e51b8152600401610464906118cf565b6000811161101c5760405162461bcd60e51b815260040161046490611931565b60075460408051918252602082018390527f720ac076bf91988ef86f0058721c0de3f619ba39619409e5338548e3e1b70dd1910160405180910390a1600755565b3360009081526001602081905260409091205460ff161515146110925760405162461bcd60e51b8152600401610464906118cf565b60008251116110ee5760405162461bcd60e51b815260206004820152602260248201527f6d696e65722061727261792073686f756c64206e6f742062652030206c656e676044820152610e8d60f31b6064820152608401610464565b600081511161114a5760405162461bcd60e51b815260206004820152602260248201527f76616c75652061727261792073686f756c64206e6f742062652030206c656e676044820152610e8d60f31b6064820152608401610464565b80518251146111945760405162461bcd60e51b8152602060048201526016602482015275185c9c985e481b195b99dd1a081b9bdd08195c5d585b60521b6044820152606401610464565b60005b8251811015610cbf5760008282815181106111c257634e487b7160e01b600052603260045260246000fd5b6020026020010151116111e75760405162461bcd60e51b815260040161046490611931565b7f727a41e3b4b2a96286e1897fdff681b3c2898897551d4df8ed8e7448f02c560983828151811061122857634e487b7160e01b600052603260045260246000fd5b6020026020010151600585848151811061125257634e487b7160e01b600052603260045260246000fd5b60200260200101516040516112679190611841565b90815260200160405180910390205484848151811061129657634e487b7160e01b600052603260045260246000fd5b60200260200101516040516112ad9392919061185d565b60405180910390a18181815181106112d557634e487b7160e01b600052603260045260246000fd5b602002602001015160058483815181106112ff57634e487b7160e01b600052603260045260246000fd5b60200260200101516040516113149190611841565b908152604051908190036020019020558061132e81611a49565b915050611197565b3360009081526001602081905260409091205460ff1615151461136b5760405162461bcd60e51b8152600401610464906118cf565b6000811161138b5760405162461bcd60e51b815260040161046490611931565b600b5460408051918252602082018390527f80645fac7be0a4452a38c0da41b6a5057fced6ff989979444fceddbdfae5f338910160405180910390a1600b55565b6000546001600160a01b031633146113f65760405162461bcd60e51b815260040161046490611960565b6001600160a01b03811661144c5760405162461bcd60e51b815260206004820152601760248201527f616464726573732073686f756c64206e6f7420626520300000000000000000006044820152606401610464565b6001600160a01b038116600081815260016020818152604092839020805460ff191690921790915590519182527ff8d5f40934646cedded2cab1b5960f020db583f154fabcf831277b87d1803d139101610742565b6000546001600160a01b031633146114cb5760405162461bcd60e51b815260040161046490611960565b6001600160a01b0381166115305760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610464565b6115398161155b565b50565b60006115488284611a02565b9392505050565b600061154882846119ea565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082601f8301126115bb578081fd5b813560206115d06115cb836119c6565b611995565b80838252828201915082860187848660051b89010111156115ef578586fd5b855b8581101561160d578135845292840192908401906001016115f1565b5090979650505050505050565b600082601f83011261162a578081fd5b813567ffffffffffffffff81111561164457611644611a7a565b611657601f8201601f1916602001611995565b81815284602083860101111561166b578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215611696578081fd5b81356001600160a01b0381168114611548578182fd5b600080604083850312156116be578081fd5b823567ffffffffffffffff808211156116d5578283fd5b818501915085601f8301126116e8578283fd5b813560206116f86115cb836119c6565b8083825282820191508286018a848660051b8901011115611717578788fd5b875b858110156117505781358781111561172f57898afd5b61173d8d87838c010161161a565b8552509284019290840190600101611719565b50909750505086013592505080821115611768578283fd5b50611775858286016115ab565b9150509250929050565b600060208284031215611790578081fd5b813567ffffffffffffffff8111156117a6578182fd5b6117b28482850161161a565b949350505050565b600080604083850312156117cc578182fd5b823567ffffffffffffffff8111156117e2578283fd5b6117ee8582860161161a565b95602094909401359450505050565b60006020828403121561180e578081fd5b5035919050565b6000815180845261182d816020860160208601611a19565b601f01601f19169290920160200192915050565b60008251611853818460208701611a19565b9190910192915050565b6060815260006118706060830186611815565b60208301949094525060400152919050565b6020808252602d908201527f6d696e65724964206c69737420636f756e74206973206e6f7420657175616c2060408201526c1d1bc81c1bddd95c881b1a5cdd609a1b606082015260800190565b6020808252601190820152701b9bdd081a5b881dda1a5d19481b1a5cdd607a1b604082015260600190565b6020808252601c908201527f6d696e65722069642073686f756c64206e6f7420626520656d70747900000000604082015260600190565b602080825260159082015274076616c75652073686f756c64206e6f74206265203605c1b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156119be576119be611a7a565b604052919050565b600067ffffffffffffffff8211156119e0576119e0611a7a565b5060051b60200190565b600082198211156119fd576119fd611a64565b500190565b600082821015611a1457611a14611a64565b500390565b60005b83811015611a34578181015183820152602001611a1c565b83811115611a43576000848401525b50505050565b6000600019821415611a5d57611a5d611a64565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fdfea2646970667358221220e733587ac49f84babd3cb82673a5a04e8566be9a180dc34d9d59c3aece64aa5764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
6,699